Extract website theme into its own repository
This commit is contained in:
2
layouts/shortcodes/codeblock.html
Normal file
2
layouts/shortcodes/codeblock.html
Normal file
@@ -0,0 +1,2 @@
|
||||
{{ partial "geturl.html" (dict "scratch" .Scratch "path" (.Get 1) "submoduleLinks" .Site.Params.submoduleLinks) }}
|
||||
{{ partial "highlightgroup.html" (dict "url" (.Scratch.Get "bestUrl") "path" (.Get 1) "comment" ", entire file" "code" (readFile (printf "code/%s" (.Get 1))) "language" (.Get 0) "opts" "linenos=table") }}
|
||||
23
layouts/shortcodes/codelines.html
Normal file
23
layouts/shortcodes/codelines.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{{ $source := (readFile (printf "code/%s" (.Get 1))) }}
|
||||
{{ $allLines := split $source "\n" }}
|
||||
{{ if not (eq (int (.Get 2)) 1) }}
|
||||
{{ .Scratch.Set "remLines" (after (sub (int (.Get 2)) 1) $allLines) }}
|
||||
{{ else }}
|
||||
{{ .Scratch.Set "remLines" $allLines }}
|
||||
{{ end }}
|
||||
{{ $lines := first (add (sub (int (.Get 3)) (int (.Get 2))) 1) (.Scratch.Get "remLines") }}
|
||||
|
||||
{{ if (.Get 4) }}
|
||||
{{ .Scratch.Set "opts" (printf ",%s" (.Get 4)) }}
|
||||
{{ else }}
|
||||
{{ .Scratch.Set "opts" "" }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "geturl.html" (dict "scratch" .Scratch "path" (.Get 1) "submoduleLinks" .Site.Params.submoduleLinks) }}
|
||||
|
||||
{{ if eq (.Get 2) (.Get 3) }}
|
||||
{{ .Scratch.Set "comment" (printf ", line %d" (.Get 2)) }}
|
||||
{{ else }}
|
||||
{{ .Scratch.Set "comment" (printf ", lines %d through %d" (.Get 2) (.Get 3)) }}
|
||||
{{ end }}
|
||||
{{ partial "highlightgroup.html" (dict "url" (.Scratch.Get "bestUrl") "path" (.Get 1) "comment" (.Scratch.Get "comment") "code" (delimit $lines "\n") "language" (.Get 0) "opts" (printf "linenos=table,linenostart=%d%s" (.Get 2) (.Scratch.Get "opts"))) }}
|
||||
3
layouts/shortcodes/latex.html
Normal file
3
layouts/shortcodes/latex.html
Normal file
@@ -0,0 +1,3 @@
|
||||
$$
|
||||
{{ .Inner }}
|
||||
$$
|
||||
11
layouts/shortcodes/numberedsidenote.html
Normal file
11
layouts/shortcodes/numberedsidenote.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{ .Page.Scratch.Add "numbernote-id" 1 }}
|
||||
{{ $id := .Page.Scratch.Get "numbernote-id" }}
|
||||
<span class="sidenote">
|
||||
<label class="sidenote-label" for="numbernote-{{ $id }}">({{ $id }})</label>
|
||||
<input class="sidenote-checkbox" type="checkbox" id="numbernote-{{ $id }}"></input>
|
||||
<span class="sidenote-content sidenote-{{ .Get 0 }}">
|
||||
<span class="sidenote-delimiter">[note:</span>
|
||||
{{ .Inner }}
|
||||
<span class="sidenote-delimiter">]</span>
|
||||
</span>
|
||||
</span>
|
||||
2
layouts/shortcodes/rawblock.html
Normal file
2
layouts/shortcodes/rawblock.html
Normal file
@@ -0,0 +1,2 @@
|
||||
{{ partial "geturl.html" (dict "scratch" .Scratch "path" (.Get 0) "submoduleLinks" .Site.Params.submoduleLinks) }}
|
||||
{{ partial "group.html" (dict "url" (.Scratch.Get "bestUrl") "path" (.Get 0) "comment" ", entire file" "content" (safeHTML (printf "<pre><code>%s</code></pre>" (readFile (printf "code/%s" (.Get 0)))))) }}
|
||||
9
layouts/shortcodes/sidenote.html
Normal file
9
layouts/shortcodes/sidenote.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<span class="sidenote">
|
||||
<label class="sidenote-label" for="{{ .Get 1 }}">{{ .Get 2 }}</label>
|
||||
<input class="sidenote-checkbox" type="checkbox" id="{{ .Get 1 }}"></input>
|
||||
<span class="sidenote-content sidenote-{{ .Get 0 }}">
|
||||
<span class="sidenote-delimiter">[note:</span>
|
||||
{{ .Inner }}
|
||||
<span class="sidenote-delimiter">]</span>
|
||||
</span>
|
||||
</span>
|
||||
3
layouts/shortcodes/todo.html
Normal file
3
layouts/shortcodes/todo.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<div style="background-color: tomato; color: white; padding: 10px;">
|
||||
<em>TODO: </em>{{ .Inner }}
|
||||
</div>
|
||||
Reference in New Issue
Block a user