This commit is contained in:
4
themes/Eclectic/layouts/shortcodes/divider.html
Normal file
4
themes/Eclectic/layouts/shortcodes/divider.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<div style="background-image: linear-gradient(to right, transparent, #4f46e5, transparent);margin:15px 0;height:2px;position:relative">
|
||||
<!-- Additional trick: We can add Unicode characters as-is in HTML to render them.-->
|
||||
<span style="position:absolute; left:calc(50% - 10px); line-height:2px; font-size:30px; padding: 0 5px;background: white; color:#4f46e5">☺</span>
|
||||
</div>
|
30
themes/Eclectic/layouts/shortcodes/fig.html
Normal file
30
themes/Eclectic/layouts/shortcodes/fig.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!-- image -->
|
||||
<figure {{ with .Get "class" }} class="{{.}}" {{ end }}>
|
||||
{{ if .Get "link"}}<a href="{{ .Get "link" }}" {{ with .Get "target" }} target="{{ . }}" {{ end }}
|
||||
{{ with .Get "rel" }} rel="{{ . }}" {{ end }}>{{ end }}
|
||||
{{ $url := .Get "src" }}
|
||||
{{ if ne (.Get "nomin") "true" }}
|
||||
{{ if gt (.Get "width" ) 0}}
|
||||
{{ if gt (.Get "height") 0 }}
|
||||
{{ $k := $.Page.Resources.GetMatch $url }}
|
||||
{{ $k = $k.Fill (print (.Get "width" ) "x" (.Get "height") " " (default (.Get "anchor") "Center")) }}
|
||||
{{ $url = $k.RelPermalink }}
|
||||
{{ end }}
|
||||
{{end}}
|
||||
{{end}}
|
||||
<img src="{{$url}}" {{ if or (.Get "alt") (.Get "caption") }} alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"
|
||||
{{ end }} {{ with .Get "width" }} width="{{.}}" {{ end }} {{ with .Get "height" }} height="{{.}}" {{ end }} />
|
||||
{{ if .Get "link"}}</a>{{ end }}
|
||||
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
|
||||
<figcaption>{{ if isset .Params "title" }}
|
||||
<h4>{{ .Get "title" }}</h4>{{ end }}
|
||||
{{ if or (.Get "caption") (.Get "attr")}}<p>
|
||||
{{ .Get "caption" }}
|
||||
{{ with .Get "attrlink"}}<a href="{{.}}"> {{ end }}
|
||||
{{ .Get "attr" }}
|
||||
{{ if .Get "attrlink"}}</a> {{ end }}
|
||||
</p> {{ end }}
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
<!-- image -->
|
5
themes/Eclectic/layouts/shortcodes/guitar.html
Normal file
5
themes/Eclectic/layouts/shortcodes/guitar.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<!-- guitar -->
|
||||
{{- $json := getJSON $.Site.Params.Guitar "?" (querify "q" .Inner) -}}
|
||||
{{- with $json.svg -}}
|
||||
{{. | safeHTML}}
|
||||
{{- end -}}
|
2
themes/Eclectic/layouts/shortcodes/price.html
Normal file
2
themes/Eclectic/layouts/shortcodes/price.html
Normal file
@@ -0,0 +1,2 @@
|
||||
{{$product := default (.Get 0) (.Get "product")}}
|
||||
{{index (index (partialCached "products.html" "nothing") $product) "Price" }}
|
9
themes/Eclectic/layouts/shortcodes/productInfo.md
Normal file
9
themes/Eclectic/layouts/shortcodes/productInfo.md
Normal file
@@ -0,0 +1,9 @@
|
||||
We make over ***200 shapes***. The most popular of these include:
|
||||
|
||||
Shape | Design | Description | Links
|
||||
--- | --- | --- | ---
|
||||
Line | -- | Two pointy ends and a straight stretch of ink | [Line on Wikipedia](https://en.wikipedia.org/wiki/Line_(geometry))
|
||||
Circle | ⃝ | A full round with no corners | [Circle on Wikipedia]
|
||||
Triangle | △ | Three lines with three corners | [Triangle on Wikipedia](https://en.wikipedia.org/wiki/Triangle)
|
||||
|
||||
[Circle on Wikipedia]: https://en.wikipedia.org/wiki/Circle
|
10
themes/Eclectic/layouts/shortcodes/repeat.html
Normal file
10
themes/Eclectic/layouts/shortcodes/repeat.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{$count := default 5 (default (.Get 0) (.Get "count"))}}
|
||||
{{/* Preprocess to speed up */}}
|
||||
{{$inner := .Inner | markdownify}}
|
||||
{{if gt $count 0}}
|
||||
<ul>
|
||||
{{ range seq $count}}
|
||||
<li>{{$inner}}</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{end}}
|
10
themes/Eclectic/layouts/shortcodes/tex.html
Normal file
10
themes/Eclectic/layouts/shortcodes/tex.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!-- tex -->
|
||||
{{ $inline := "" }}
|
||||
{{- if eq (.Get 0) "inline" -}}
|
||||
{{ $inline = "&inline=true" }}
|
||||
{{- end -}}
|
||||
{{- $json := getJSON $.Site.Params.Tex "?" (querify "q" .Inner) $inline -}}
|
||||
{{- with $json.svg -}}
|
||||
{{. | safeHTML}}
|
||||
{{- end -}}
|
||||
|
5
themes/Eclectic/layouts/shortcodes/yt.html
Normal file
5
themes/Eclectic/layouts/shortcodes/yt.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{- $id := .Get "id" | default (.Get 0) -}}
|
||||
<div class="yt">
|
||||
<iframe src="https://www.youtube-nocookie.com/embed/{{ $id }}?showinfo=0&modestbranding=1&iv_load_policy=3&rel=0{{ with .Get "autoplay" }}{{ if eq . "true" }}&autoplay=1{{ end }}{{ end }}"
|
||||
allowfullscreen title="{{$.Page.Title}}"></iframe>
|
||||
</div>
|
Reference in New Issue
Block a user