#39, Add button shortcode

This commit is contained in:
Alex Shpak 2019-05-27 18:25:58 +02:00
parent e452a7beda
commit a299a4b07b
6 changed files with 35 additions and 3 deletions

View file

@ -67,3 +67,16 @@
margin-left: $padding-16 * 2; margin-left: $padding-16 * 2;
} }
} }
// {{< button >}}
a.book-btn {
display: inline-block;
color: $color-link !important;
text-decoration: none !important;
border: $padding-1 solid $color-link;
border-radius: $padding-4;
padding: $padding-4 $padding-16;
margin-top: $padding-8;
margin-bottom: $padding-8;
cursor: pointer;
}

View file

@ -6,7 +6,6 @@ type: docs
# Acerbo datus maxime # Acerbo datus maxime
{{< columns >}} {{< columns >}}
## Astris ipse furtiva ## Astris ipse furtiva
Est in vagis et Pittheus tu arge accipiter regia iram vocatur nurus. Omnes ut Est in vagis et Pittheus tu arge accipiter regia iram vocatur nurus. Omnes ut

View file

@ -31,6 +31,16 @@ protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia. Miseratus fonte Ditis conubia.
{{< /expand >}} {{< /expand >}}
# Buttons
```tpl
{{</* button relref="/" */>}}Get Home{{</* /button */>}}
{{</* button href="https://github.com/alex-shpak/hugo-book" */>}}Contribute{{</* /button */>}}
```
{{< button relref="/" >}}Get Home{{< /button >}}
{{< button href="https://github.com/alex-shpak/hugo-book" >}}Contribute{{< /button >}}
# Tabs # Tabs
```tpl ```tpl

View file

@ -1 +1 @@
{"Target":"book.min.3c69b4506bc4a8da260ab28ed0c14019a49435aed9fd20517f353987fa0f60ec.css","MediaType":"text/css","Data":{"Integrity":"sha256-PGm0UGvEqNomCrKO0MFAGaSUNa7Z/SBRfzU5h/oPYOw="}} {"Target":"book.min.b7d5ee4f671b06dde5fd61ab409a54048ba7759e99fed39ac32a7be45d4d92cd.css","MediaType":"text/css","Data":{"Integrity":"sha256-t9XuT2cbBt3l/WGrQJpUBIundZ6Z/tOawyp75F1Nks0="}}

View file

@ -0,0 +1,10 @@
{{ $ref := "" }}
{{ $target := "" }}
{{ with .Get "href" }}
{{ $ref = . }}
{{ $target = "_blank" }}
{{ end }}
{{ with .Get "relref" }}
{{ $ref = relref $ . }}
{{ end }}
<a {{ with $ref }} href="{{.}}" {{ end }} {{ with $target }} target="{{.}}" {{ end }} class="book-btn">{{ $.Inner }}</a>