Added shortcodes, lots of improvements and content dump

This commit is contained in:
2022-06-07 13:54:07 +00:00
parent 6c98fcf57a
commit 9859c9e5ba
34 changed files with 448 additions and 59 deletions

View File

@@ -0,0 +1 @@
<a href='{{ .Destination | safeURL }}' target='_blank'>{{ .Text | safeHTML }}</a>

View File

@@ -28,11 +28,11 @@
{{ end }}
{{ block "head" . }}{{ end }}
{{ if .Param "chroma" }}
{{ with resources.Get "chroma.scss" | toCSS | postCSS | minify | fingerprint | resources.PostProcess }}
{{ with resources.Get "chroma.scss" | toCSS | minify | fingerprint | resources.PostProcess }}
<link href='{{ .RelPermalink }}' integrity="{{ .Data.Integrity }}" rel='stylesheet'>
{{ end }}
{{ end }}
{{ with resources.Get "main.scss" | toCSS | postCSS | minify | fingerprint | resources.PostProcess }}
{{ with resources.Get "main.scss" | toCSS | minify | fingerprint | resources.PostProcess }}
<link href='{{ .RelPermalink }}' integrity="{{ .Data.Integrity }}" rel='stylesheet'>
{{ end }}
</head>

View File

@@ -4,6 +4,9 @@
<h1>{{ .Title | humanize }}</h1>
</header>
{{ .Content }}
{{if gt (len .Pages) 0}}
<br />
<h3>Posts</h3>
<ul class='contents'>
{{ range .Pages }}
<br />
@@ -12,5 +15,6 @@
</a>
{{ end }}
</ul>
{{ end }}
</article>
{{ end }}

View File

@@ -1,7 +1,9 @@
<nav id='navbar'>
<ul class='top-nav'>
<li><a href='/{{ .Language.Lang }}'>{{ site.Title }}</a></li>
<li><a href='/{{ if ne .Language.Lang "en" }}{{ .Language.Lang }}{{ end }}'>{{ site.Title }}</a></li>
{{ if gt (len .AllTranslations) 1 }}
{{ partial "i18n/nav.html" . }}
{{ end }}
<div class='link-group'>
{{ $currentPage := . }}
{{ range .Site.Menus.main }}

View File

@@ -1,14 +1,21 @@
<aside id='meta'>
<header>
<h4>{{ or (.Param "tit") .Title }}</h4>
<h4>{{ or (.Param "tit") .Title | humanize }}</h4>
<p>
{{ i18n "readingTime" .ReadingTime }}.
{{ i18n "wordCount" .WordCount }}.
</p>
{{ with .Param "git" }}
<p>Check out the git repo; <a href='{{ .url }}'>{{ .name }}</a>!</p>
{{ end }}
</header>
{{ if .Param "docs" }}
<h6>Documentation:</h6>
<ul>
{{ range .Param "docs" }}
<li><a href='{{ .url }}' target='_blank'>{{ .name }}</a></li>
{{ end }}</ul>{{ end }}
{{ with .Param "git" }}
<p>Check out the git repo; <a href='{{ .url }}'>{{ .name }}</a>!</p>
{{ end }}
<h6>Table of Contents:</h6>
{{ .TableOfContents }}
{{ partial "i18n/list.html" . }}
</aside>

View File

@@ -0,0 +1 @@
{{ with resources.Get (.Get 0) }}{{ .Content }}{{ end }}

View File

@@ -0,0 +1,5 @@
{{ $opts := slice "lineNos=table" "tabWidth=2" "noClasses=false" "style=fruity" }}
{{ if .Get 1 }}
{{ $opts = $opts | append (split (.Get 1) ",") }}
{{ end }}
{{ transform.Highlight (htmlUnescape .Inner) (.Get 0) (delimit $opts ",") }}

View File

@@ -0,0 +1,20 @@
<figure {{ with .Get "class" }}class='{{.}}'{{ end }}>
{{ with resources.Get (.Get "src") | fingerprint }}
<a href='{{ with $.Get "link" }}{{ . }}{{ else }}{{ .RelPermalink }}{{ end }}' target='_blank'>
<img src='{{ .RelPermalink }}' integrity='{{ .Data.Integrity }}'
{{ if or ($.Get "alt") ($.Get "caption") }}alt='{{ with $.Get "alt" }}{{ . }}
{{ else }}{{ $.Get "caption" }}{{ end }}'{{ end }} />
</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>

View File

@@ -0,0 +1 @@
{{ .Inner }}

View File

@@ -0,0 +1,3 @@
{{ with resources.Get (.Get 0) | fingerprint }}
<script src='{{ .RelPermalink }}' integrity='{{ .Data.Integrity }}'></script>
{{ end }}