#39, Add button shortcode

pull/54/head
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;
}
}
// {{< 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
{{< columns >}}
## Astris ipse furtiva
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.
{{< /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
```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>