Browse Source

docs(shortcodes): remove inline documentation

docs to be moved into online help
Josh Habdas 1 year ago
parent
commit
fc10eda142
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74

+ 0
- 9
layouts/shortcodes/blockquote.html View File

@@ -1,12 +1,3 @@
1
-<!--{{/*
2
-Create pull quotes with citations and optional citation links.
3
-
4
-Basic usage:
5
-{{< blockquote cite="https://bitly.is/2mkxskj" citelink="https://bitly.is/2mkxskj" >}}
6
-  When you create your own Branded Short Domain, you can expect to see up to a 34% increase in CTR when compared to standard bit.ly links.
7
-{{< /blockquote >}}
8
-*/}}-->
9
-
10 1
 {{ $body := .Get "text" | default .Inner }}
11 2
 {{ $class := .Get "class" }}
12 3
 {{ $citelink := .Get "citelink" }}

+ 0
- 34
layouts/shortcodes/external.html View File

@@ -1,37 +1,3 @@
1
-<!-- {{/*
2
-HTML attributes: "href" [default: "#"], "class", "referrerpolicy", "target" [default: "_blank"], "type", "title", "rel" [default: "external noopener"]
3
-Custom attributes: "text" [default: Inner], "itemtype"
4
-
5
-Basic usage:
6
-{{< external "https://after-dark.habd.as" />}}
7
-{{< external text="After Dark" href="//after-dark.habd.as" />}}
8
-{{< external class="muted" href="//after-dark.habd.as" />}}
9
-{{< external "gopher://gopher.quux.org:70" />}}
10
-
11
-With external link styling removed:
12
-{{< external rel="noopener" href="https://keybase.io/jhabdas" />}}
13
-
14
-With internal link opening in a new window:
15
-{{< external href="crypto-anarchist-manifesto.pdf" text="Manifesto" />}}
16
-
17
-With structured data type:
18
-{{< external itemtype="significantLink" href="https://habd.as" />}}
19
-
20
-With site-wide Referrer Policy overridden:
21
-{{< external referrerpolicy="unsafe-url" href="http://goo.gl" />}}
22
-
23
-With markdown image and link styling removed:
24
-{{% external rel="noopener" href="https://source.unsplash.com/collection/983219/2160x1440" %}}
25
-  ![Example image](https://source.unsplash.com/collection/983219/1080x720 "Click to view enlaged")
26
-{{% /external %}}
27
-
28
-Combined with button shortcode opening in same window with search query:
29
-{{< external rel="search" target="_self" href="?s=query" >}}
30
-  {{< hackcss-button text="Default" />}}
31
-{{< /external >}}
32
-
33
-*/}} -->
34
-
35 1
 {{ $href := .Get "href" | default nil }}
36 2
 {{ $body := .Get "text" | default .Inner }}
37 3
 {{ $class := .Get "class" }}

+ 1
- 10
layouts/shortcodes/figure.html View File

@@ -1,12 +1,3 @@
1
-<!--{{/*
2
-Like the Hugo built-in, but easier to grok with Lazy Loading and LQIP support.
3
-
4
-Basic usage:
5
-{{< figure src="https://i.supload.com/r1gXlwuXiZ.png" link="https://supload.com/r1gXlwuXiZ" caption="Ethereum value explosion in 2017. You do the math." >}}
6
-
7
-Internal usage reference:
8
-https://gohugo.io/content-management/shortcodes/#figure
9
-*/}}-->
10 1
 {{ $src := .Get "src" }}
11 2
 {{ $lqipsrc := .Get "lqipsrc" }}
12 3
 {{ $caption := .Get "caption" }}
@@ -36,4 +27,4 @@ https://gohugo.io/content-management/shortcodes/#figure
36 27
     </small>{{ end }}
37 28
   </figcaption>
38 29
   {{ end }}
39
-</figure>
30
+</figure>

+ 0
- 10
layouts/shortcodes/hackcss-alert.html View File

@@ -1,13 +1,3 @@
1
-<!-- {{/*
2
-Custom attributes: "type", "text" [default: Inner]
3
-Possible types: "success", "info", "warning", "error"
4
-
5
-Basic Usage:
6
-{{< hackcss-alert type="info" text="Alert Text" />}}
7
-{{< hackcss-alert >}}Inner block of text{{< /hackcss-alert >}}
8
-{{% hackcss-alert %}}**Note:** Markdown available{{% /hackcss-alert %}}
9
-
10
-*/}} -->
11 1
 {{ $type := .Get "type" }}
12 2
 {{ $body := .Get "text" | default .Inner }}
13 3
 {{ partial "components/alert.html" (dict "type" $type "body" $body) }}

+ 0
- 31
layouts/shortcodes/hackcss-button.html View File

@@ -1,34 +1,3 @@
1
-<!-- {{/*
2
-HTML attributes: "id", "action", "value", "onclick", "tabindex", "target", "method", "disabled"
3
-Custom attributes: "type", "text", "isghost", "isblock"
4
-
5
-Available types: [default], "primary", "success", "info", "warning", "error"
6
-
7
-Basic usage:
8
-{{< hackcss-button text="Default" />}}
9
-{{< hackcss-button text="Info" type="info" />}}
10
-{{< hackcss-button text="Default Ghost" isghost="true" />}}
11
-{{< hackcss-button text="Block Level Button" isblock="true" />}}
12
-{{< hackcss-button text="Primary Ghost" type="primary" isghost="true" />}}
13
-
14
-Inner usage:
15
-{{< hackcss-button type="error" >}}<b>ABORT</b>{{< /hackcss-button >}}
16
-{{% hackcss-button type="success" %}}**Purchase**{{% /hackcss-button %}}
17
-
18
-With loading indicator:
19
-{{< hackcss-button >}}
20
-  Please wait&hellip; {{< hackcss-throbber >}}
21
-{{< /hackcss-button >}}
22
-
23
-Inside a button group:
24
-{{< hackcss-buttongroup >}}
25
-  {{< hackcss-button id="" text="Default Action" isghost="true" />}}
26
-  {{< hackcss-button text="Custom Action" action="/go/elsewhere" />}}
27
-  {{< hackcss-button text="Custom Target" target="_blank" tabindex="-1" />}}
28
-  {{< hackcss-button text="Custom Method" method="get" />}}
29
-{{< /hackcss-buttongroup >}}
30
-
31
-*/}} -->
32 1
 {{ $type := .Get "type" }}
33 2
 {{ $body := .Get "text" | default .Inner }}
34 3
 {{ $isghost := .Get "isghost" }}

+ 0
- 34
layouts/shortcodes/hackcss-buttongroup.html View File

@@ -1,37 +1,3 @@
1
-<!-- {{/*
2
-HTML attributes: "class"
3
-Custom attributes: "formactions"
4
-
5
-Outside form with a single button:
6
-{{< hackcss-buttongroup >}}
7
-  {{< hackcss-button text="Print" action="javascript:window.print()" />}}
8
-{{< /hackcss-buttongroup >}}
9
-
10
-With three buttons, one ghosted and one of type info
11
-{{< hackcss-buttongroup >}}
12
-  {{< hackcss-button text="Left" />}}
13
-  {{< hackcss-button text="Middle" type="info" />}}
14
-  {{< hackcss-button text="Right" isghost="true" />}}
15
-{{< /hackcss-buttongroup >}}
16
-
17
-With self-targeted button and custom class names:
18
-{{< hackcss-buttongroup class="targetself" >}}
19
-  {{< hackcss-button text="Left" target="_self" />}}
20
-  {{< hackcss-button text="Right" isghost="true" />}}
21
-{{< /hackcss-buttongroup >}}
22
-
23
-Inside a form with a default action, target and hidden inputs:
24
-{{< hackcss-form action="/do/something" target="_blank" >}}
25
-  {{< hackcss-textinput type="hiddden" name="AssociateTag" value="jhabdas-20" >}}
26
-  {{< hackcss-textinput type="hidden" name="ASIN.1" value="B0736PV196" >}}
27
-  {{< hackcss-textinput type="hidden" name="Quantity.1" value="2" >}}
28
-  {{< hackcss-buttongroup formactions="true" >}}
29
-    {{< hackcss-button text="Print" action="javascript:window.print()" />}}
30
-    {{< hackcss-button text="Purchase" isghost="true" />}}
31
-  {{< /hackcss-buttongroup >}}
32
-{{< /hackcss-form >}}
33
-
34
-*/}} -->
35 1
 {{ $formactions := .Get "formactions" }}
36 2
 {{ $class := .Get "class" }}
37 3
 {{ $body := .Inner }}

+ 0
- 13
layouts/shortcodes/hackcss-card.html View File

@@ -1,16 +1,3 @@
1
-<!-- {{/*
2
-Basic usage:
3
-{{< hackcss-card header="title" text="Lorem ipsum dolor sit amet" />}}
4
-{{% hackcss-card header="Bacon Ipsum" %}}
5
-  _Flank **pancetta** beef tri-tip frankfurter chuck._
6
-{{% /hackcss-card %}}
7
-
8
-Advanced usage:
9
-{{< hackcss-card header="SUX 3000 (2 left in stock)" >}}
10
-  <p>Available now for a limited time at the low price of just $1,000,000.</p>
11
-  {{< hackcss-button type="success" text="Buy Now" isblock="true" />}}
12
-{{< /hackcss-card >}}
13
-*/}} -->
14 1
 {{ $header := .Get "header" }}
15 2
 {{ $body := .Get "text" | default .Inner }}
16 3
 {{ partial "components/card.html" (dict "header" $header "body" $body) }}

+ 0
- 27
layouts/shortcodes/hackcss-form.html View File

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

+ 0
- 26
layouts/shortcodes/hackcss-formgroup.html View File

@@ -1,29 +1,3 @@
1
-<!-- {{/*
2
-HTML attributes: "disabled", "form", "name", "class", "legend", "body"
3
-Custom attributes: "hastextarea", "state"
4
-
5
-Possible states: "success", "warning", "error"
6
-
7
-Basic example:
8
-{{< hackcss-formgroup >}}
9
-  {{< hackcss-label for="query" text="Query:" />}}
10
-  {{< hackcss-textinput id="query" type="search" >}}
11
-{{< /hackcss-formgroup >}}
12
-
13
-With text area:
14
-{{< hackcss-formgroup hastextarea="true" >}}
15
-  {{< hackcss-label for="message" text="Message:" />}}
16
-  {{< hackcss-textarea id="message" rows="10" >}}
17
-{{< /hackcss-formgroup >}}
18
-
19
-With legend and helper text:
20
-{{< hackcss-formgroup legend="Personal Information" >}}
21
-  {{< hackcss-label for="phone" text="Phone Number:" />}}
22
-  {{< hackcss-textinput id="phone" type="tel" value="+86 180 800 8000" >}}
23
-  {{< hackcss-helpblock text="In this format: +86 xxx xxx xxxxx" />}}
24
-{{< /hackcss-formgroup >}}
25
-
26
-*/}} -->
27 1
 {{ $hastextarea := .Get "hastextarea" }}
28 2
 {{ $state := .Get "state" }}
29 3
 {{ $disabled := .Get "disabled" }}

+ 0
- 20
layouts/shortcodes/hackcss-helpblock.html View File

@@ -1,23 +1,3 @@
1
-<!-- {{/*
2
-HTML attributes: "class"
3
-Custom attributes: "text" [default: Inner]
4
-
5
-Basic usage:
6
-{{< hackcss-helpblock text="You need help. Seriously." />}}
7
-
8
-With markdown formatting:
9
-{{% hackcss-helpblock %}}**Pay attention!**{{% /hackcss-helpblock %}}
10
-
11
-Affixed above and below input control:
12
-{{< hackcss-formgroup >}}
13
-  {{< hackcss-helpblock >}}
14
-    <em>Enter a secure password below:</em>
15
-  {{< /hackcss-helpblock >}}
16
-  {{< hackcss-textinput type="password" >}}
17
-  {{< hackcss-helpblock text="Min. 27 chars" />}}
18
-{{< /hackcss-formgroup >}}
19
-
20
-*/}} -->
21 1
 {{ $class := .Get "class" }}
22 2
 {{ $body := .Get "text" | default .Inner }}
23 3
 {{ partial "components/helpblock.html" (dict "class" $class "body" $body) }}

+ 0
- 20
layouts/shortcodes/hackcss-label.html View File

@@ -1,23 +1,3 @@
1
-<!-- {{/*
2
-Permitted attributes: "for", "form", "text"
3
-
4
-Explicit label association (preferred):
5
-{{< hackcss-label for="query" text="Enter search query:" />}}
6
-{{< hackcss-textinput type="search" id="query" >}}
7
-
8
-Implicit label association with markup:
9
-{{< hackcss-label >}}
10
-  mau kemana?<sup><a href="#kemana">§</a></sup>
11
-  {{< hackcss-textinput placeholder="di ingres" >}}
12
-{{< /hackcss-label >}}
13
-
14
-Inside form group for default label styling:
15
-{{< hackcss-formgroup >}}
16
-  {{< hackcss-label for="fullname" text="Name:" />}}
17
-  {{< hackcss-textinput id="fullname" >}}
18
-{{< /hackcss-formgroup >}}
19
-
20
-*/}} -->
21 1
 {{ $for := .Get "for" }}
22 2
 {{ $form := .Get "form" }}
23 3
 {{ $body := .Get "text" | default .Inner }}

+ 0
- 9
layouts/shortcodes/hackcss-progress.html View File

@@ -1,12 +1,3 @@
1
-<!-- {{/*
2
-Custom attributes: "showpercent", "value", "filltext" [default: "Loading"]
3
-
4
-Basic usage:
5
-{{< hackcss-progress value="40" >}}
6
-{{< hackcss-progress value="30" showpercent="true" >}}
7
-{{< hackcss-progress value="70" showpercent="true" filltext="pemuatan" >}}
8
-
9
-*/}} -->
10 1
 {{ $show_percent := .Get "showpercent" }}
11 2
 {{ $fill_text := .Get "filltext" | default "Loading" }}
12 3
 {{ $value := .Get "value" }}

+ 0
- 24
layouts/shortcodes/hackcss-textarea.html View File

@@ -1,27 +1,3 @@
1
-<!-- {{/*
2
-HTML attributes: "id", "name", "class", "autocomplete", "autofocus", "cols", "disabled", "form", "maxlength", "minlength", "name", "placeholder", "readonly", "required", "rows", "spellcheck", "wrap", "tabindex"
3
-Custom attributes: "text"
4
-
5
-Possible autocompletes: [none], "on", "off"
6
-Possible wraps: [none], "hard", "soft", "off"
7
-Possible spellchecks: [none], "true", "default", "false"
8
-
9
-Read-only with prefilled text:
10
-{{< hackcss-textarea readonly="true" text="Only this and nothing more." >}}
11
-
12
-With spellcheck disabled:
13
-{{< hackcss-textarea spellcheck="false" >}}
14
-
15
-With 16 columns and hard wrapping enabled:
16
-{{< hackcss-textarea cols="16" wrap="hard" >}}
17
-
18
-Inside disabled form group With error label and placeholder:
19
-{{< hackcss-formgroup hastextarea="true" disabled="true" state="error" >}}
20
-  {{< hackcss-label for="message" text="Message:" />}}
21
-  {{< hackcss-textarea id="message" placeholder="Guestbook offline…" rows="10" >}}
22
-{{< /hackcss-formgroup >}}
23
-
24
-*/}} -->
25 1
 {{ $id := .Get "id" | default nil }}
26 2
 {{ $name := .Get "name" | default nil }}
27 3
 {{ $class := .Get "class" | default nil }}

+ 0
- 32
layouts/shortcodes/hackcss-textinput.html View File

@@ -1,35 +1,3 @@
1
-<!-- {{/*
2
-HTML attributes: "id", "name", "class", "autocomplete", "autofocus", "disabled", "form", "formaction", "formmethod", "formtarget", "height", "max", "maxlength", "min", "minlength", "multiple", "pattern", "placeholder", "readonly", "required", "size", "spellcheck", "step", "tabindex", "type", "value", "width"
3
-Possible types: "email", "hidden", "number", "password", "search", "tel", "text", "url"
4
-
5
-Basic usage:
6
-{{< hackcss-textinput >}}
7
-{{< hackcss-textinput type="password" >}}
8
-{{< hackcss-textinput type="email" placeholder="name@domain.example" >}}
9
-{{< hackcss-textinput disabled="true" >}}
10
-
11
-With control label and search input targeting form owner:
12
-{{< hackcss-formgroup >}}
13
-  {{< hackcss-label for="query" text="Enter search query:" />}}
14
-  {{< hackcss-textinput type="search" id="query" form="search" >}}
15
-{{< /hackcss-formgroup >}}
16
-
17
-Required with placeholder text and custom regex validation:
18
-{{< hackcss-form autocomplete="disabled" >}}
19
-  {{< hackcss-textinput
20
-      placeholder="associate-20"
21
-      name="AssociateTag"
22
-      pattern="^\b\w*\b-20$" >}}
23
-{{< /hackcss-form >}}
24
-
25
-Inside form group with warning label and help block:
26
-{{< hackcss-formgroup state="warning" >}}
27
-  {{< hackcss-label for="key64" text="64-bit PGP key:" />}}
28
-  {{< hackcss-textinput type="text" id="key64" >}}
29
-  {{< hackcss-helpblock text="In this format: BB73 67EE 9A70 A631" />}}
30
-{{< /hackcss-formgroup >}}
31
-
32
-*/}} -->
33 1
 {{ $id := .Get "id" | default nil }}
34 2
 {{ $name := .Get "name" | default nil }}
35 3
 {{ $class := .Get "class" | default nil }}

+ 0
- 13
layouts/shortcodes/hackcss-throbber.html View File

@@ -1,14 +1 @@
1
-<!-- {{/*
2
-Basic usage:
3
-{{< hackcss-throbber >}}
4
-
5
-Inside button:
6
-{{< hackcss-button >}}
7
-  Please wait&hellip; {{< hackcss-throbber >}}
8
-{{< /hackcss-button >}}
9
-
10
-Additional CSS-only loading elements:
11
-https://www.pexels.com/blog/css-only-loaders/
12
-
13
-*/}} -->
14 1
 {{ partial "components/throbber.html" . }}

Loading…
Cancel
Save