First version of the theme
This commit is contained in:
commit
8dd30f6eb8
61 changed files with 1658 additions and 0 deletions
42
layouts/shortcodes/img.html
Normal file
42
layouts/shortcodes/img.html
Normal file
|
@ -0,0 +1,42 @@
|
|||
{{ $img := $.Page.Resources.GetMatch (.Get "src")}}
|
||||
{{ $name_splitted := split $img.RelPermalink "." }}
|
||||
{{ $name_base := index $name_splitted 0 }}
|
||||
{{ $ext_base := index $name_splitted 1 }}
|
||||
<figure {{ with .Get "class" }} class="{{ . }}"{{ end }}>
|
||||
{{ with .Get "link" }}
|
||||
<a href="{{ . | absURL }}">
|
||||
{{ else }}
|
||||
<a href="{{ $img.RelPermalink }}">
|
||||
{{ end }}
|
||||
<picture>
|
||||
{{ if ( in "svg ico gif" $ext_base ) }}
|
||||
<img src="{{ $img.RelPermalink }}"
|
||||
{{ with .Get "alt"}} alt="{{ . }}"{{ end }}
|
||||
{{ with .Get "title"}} title="{{ . }}"{{ end }}/>
|
||||
{{ else }}
|
||||
<source srcset="{{ $name_base }}.thumb.avif" type="image/avif"/>
|
||||
<source srcset="{{ $name_base }}.thumb.webp" type="image/webp"/>
|
||||
<img src="{{ $name_base }}.thumb.{{ $ext_base }}"
|
||||
{{ with .Get "alt"}} alt="{{ . }}"{{ end }}
|
||||
{{ with .Get "title"}} title="{{ . }}"{{ end }}/>
|
||||
{{ end }}
|
||||
</picture>
|
||||
</a>
|
||||
{{ if .Get "caption" }}
|
||||
<figcaption>
|
||||
<p>{{ .Get "caption" }}
|
||||
{{ if .Get "attr" }}
|
||||
<span class="attribution">
|
||||
{{ with .Get "attrlink" }}
|
||||
<a href="{{ . }}">
|
||||
{{ end }}
|
||||
{{ .Get "attr" }}
|
||||
{{ with .Get "attrlink" }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
</p>
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
18
layouts/shortcodes/quote.html
Normal file
18
layouts/shortcodes/quote.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<blockquote {{ with .Get "class" }}class="{{ . }}"{{ end }}{{ with .Get "url" }} cite="{{ . }}" {{ end }}>
|
||||
{{ $s := split (trim .Inner "\t \n") "\n\n" }}
|
||||
{{ if eq ( first 1 $s) ( last 1 $s )}}
|
||||
<p>{{ .Inner | markdownify }}</p>
|
||||
{{ else }}
|
||||
{{ .Inner | markdownify }}
|
||||
{{ end }}
|
||||
{{ if .Get "author" }}
|
||||
<footer>
|
||||
<cite>
|
||||
{{ with .Get "url" }}
|
||||
<a href="{{ . }}" {{ with $.Get "title"}}title="{{ . }}"{{ end }}>
|
||||
{{ end }}
|
||||
{{ .Get "author" | markdownify }}
|
||||
{{ with .Get "url" }}</a>{{end}}</cite>
|
||||
</footer>
|
||||
{{ end }}
|
||||
</blockquote>
|
3
layouts/shortcodes/table_of_contents.html
Normal file
3
layouts/shortcodes/table_of_contents.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<div class="toc">
|
||||
{{ .Page.TableOfContents }}
|
||||
</div>
|
8
layouts/shortcodes/tabular.html
Normal file
8
layouts/shortcodes/tabular.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<figure class="tabular {{ with .Get "class"}}{{ . }}{{ end }}">
|
||||
{{ .Inner | markdownify }}
|
||||
{{ with .Get "title" }}
|
||||
<figcaption>
|
||||
<p>{{ . }}</p>
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
Loading…
Add table
Add a link
Reference in a new issue