Added shortcodes, lots of improvements and content dump
This commit is contained in:
1
layouts/_default/_markup/render-link.html
Normal file
1
layouts/_default/_markup/render-link.html
Normal file
@@ -0,0 +1 @@
|
||||
<a href='{{ .Destination | safeURL }}' target='_blank'>{{ .Text | safeHTML }}</a>
|
@@ -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>
|
||||
|
@@ -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 }}
|
@@ -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 }}
|
||||
|
@@ -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>
|
1
layouts/shortcodes/asset.html
Normal file
1
layouts/shortcodes/asset.html
Normal file
@@ -0,0 +1 @@
|
||||
{{ with resources.Get (.Get 0) }}{{ .Content }}{{ end }}
|
5
layouts/shortcodes/highlight.html
Normal file
5
layouts/shortcodes/highlight.html
Normal 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 ",") }}
|
20
layouts/shortcodes/img.html
Normal file
20
layouts/shortcodes/img.html
Normal 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>
|
1
layouts/shortcodes/raw.html
Normal file
1
layouts/shortcodes/raw.html
Normal file
@@ -0,0 +1 @@
|
||||
{{ .Inner }}
|
3
layouts/shortcodes/script.html
Normal file
3
layouts/shortcodes/script.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{ with resources.Get (.Get 0) | fingerprint }}
|
||||
<script src='{{ .RelPermalink }}' integrity='{{ .Data.Integrity }}'></script>
|
||||
{{ end }}
|
Reference in New Issue
Block a user