Hugo Dark Theme Site Generator https://after-dark.habd.as
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hackcss-form.html 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <!-- {{/*
  2. HTML attributes: "name", "accept-charset", "action", "enctype", "target", "novalidate", "method", "class", "autocomplete"
  3. Available states: [default], "success", "error", "warning"
  4. Possible methods: "get", "post"
  5. Possible autocompletes: "on", "off"
  6. Basic usage:
  7. {{< hackcss-form >}}
  8. {{< hackcss-textinput >}}
  9. {{< /hackcss-form >}}
  10. Named targeting self with text input and autocomplete disabled:
  11. {{< hackcss-form name="search" autocomplete="disabled" >}}
  12. {{< hackcss-textinput name="query" >}}
  13. {{< /hackcss-form >}}
  14. Hidden with blank target, no validation and custom post action:
  15. {{< hackcss-form novalidate="true" method="post" action="/do/something" target="_blank" >}}
  16. {{< hackcss-textinput type="hidden" name="throttle" value="80" >}}
  17. {{< /hackcss-form >}}
  18. Specify allowed encodings:
  19. {{< hackcss-form acceptcharset="UTF-8 ISO-8859-1" >}}
  20. {{< hackcss-textinput value="☻" >}}
  21. {{< /hackcss-form >}}
  22. */}} -->
  23. {{ $accept_charset := .Get "acceptcharset" }}
  24. {{ $name := .Get "name" }}
  25. {{ $action := .Get "action" }}
  26. {{ $enctype := .Get "enctype" }}
  27. {{ $target := .Get "target" }}
  28. {{ $novalidate := .Get "novalidate" }}
  29. {{ $autocomplete := .Get "autocomplete" }}
  30. {{ $method := .Get "method" }}
  31. {{ $class := .Get "class" }}
  32. {{ $body := .Inner }}
  33. {{ partial "components/form.html" (dict "name" $name "accept_charset" $accept_charset "action" $action "enctype" $enctype "target" $target "novalidate" $novalidate "method" $method "class" $class "body" $body) }}