From 8dad1d1bd0bc7206f16323d220fdce73c400f470 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Tue, 18 Aug 2020 15:18:25 +0300 Subject: Squashed 'website/themes/hugo-clarity/' content from commit 4969d5a git-subtree-dir: website/themes/hugo-clarity git-subtree-split: 4969d5a1fb2c358c00e2d7f6fc1e39024d7d2355 --- layouts/404.html | 8 +++++ layouts/_default/baseof.html | 76 +++++++++++++++++++++++++++++++++++++++++ layouts/_default/list.html | 3 ++ layouts/_default/single.html | 26 ++++++++++++++ layouts/index.html | 3 ++ layouts/partials/analytics.html | 9 +++++ layouts/partials/archive.html | 15 ++++++++ layouts/partials/excerpt.html | 25 ++++++++++++++ layouts/partials/favicon.html | 7 ++++ layouts/partials/follow.html | 15 ++++++++ layouts/partials/footer.html | 7 ++++ layouts/partials/head.html | 14 ++++++++ layouts/partials/icons.html | 62 +++++++++++++++++++++++++++++++++ layouts/partials/mode.html | 4 +++ layouts/partials/nav.html | 43 +++++++++++++++++++++++ layouts/partials/opengraph.html | 71 ++++++++++++++++++++++++++++++++++++++ layouts/partials/pager.html | 19 +++++++++++ layouts/partials/post-meta.html | 16 +++++++++ layouts/partials/share.html | 29 ++++++++++++++++ layouts/partials/sidebar.html | 67 ++++++++++++++++++++++++++++++++++++ layouts/partials/top.html | 6 ++++ layouts/shortcodes/video.html | 4 +++ 22 files changed, 529 insertions(+) create mode 100644 layouts/404.html create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/index.html create mode 100644 layouts/partials/analytics.html create mode 100644 layouts/partials/archive.html create mode 100644 layouts/partials/excerpt.html create mode 100644 layouts/partials/favicon.html create mode 100644 layouts/partials/follow.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/icons.html create mode 100644 layouts/partials/mode.html create mode 100644 layouts/partials/nav.html create mode 100644 layouts/partials/opengraph.html create mode 100644 layouts/partials/pager.html create mode 100644 layouts/partials/post-meta.html create mode 100644 layouts/partials/share.html create mode 100644 layouts/partials/sidebar.html create mode 100644 layouts/partials/top.html create mode 100644 layouts/shortcodes/video.html (limited to 'layouts') diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..30115e8 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,8 @@ +{{ define "main" }} +
+

Lost

+

We couldn't find the page you're looking for


+
Go Back
+
+{{ end }} + diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..18f14e6 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,76 @@ + + + + {{- partial "head" . }} + + {{- $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") -}} + {{ $mainSassFile := "sass/main.sass" }} + {{- $styles := resources.Get $mainSassFile | resources.ExecuteAsTemplate $mainSassFile . | resources.ToCSS $options | resources.Fingerprint "sha512" }} + + + {{- $highlightPath := "js/highlight.js" }} + {{- $highlight := resources.Get $highlightPath | resources.ExecuteAsTemplate $highlightPath . }} + + {{- $functionsScriptPath := "js/functions.js" }} + {{- $functions := resources.Get $functionsScriptPath | resources.ExecuteAsTemplate $functionsScriptPath . }} + + {{- $codeScriptPath := "js/code.js" }} + {{- $code := resources.Get $codeScriptPath | resources.ExecuteAsTemplate $codeScriptPath . }} + + {{- $customScriptPath := "js/custom.js" }} + {{- $custom := resources.Get $customScriptPath | resources.ExecuteAsTemplate $customScriptPath . }} + + {{- $mainScriptPath := "js/index.js" }} + {{- $main := resources.Get $mainScriptPath | resources.ExecuteAsTemplate $mainScriptPath . }} + + {{- $bundle := slice $highlight $functions $code $main $custom | resources.Concat "js/bundle.js" | resources.Fingerprint "sha512" -}} + + + + + + + + {{- with .Site.Params.customCSS }} + {{- range . -}} + + {{- end }} + {{- end }} + + + {{- $maxCodeLines := 100 }} + {{- $params := .Site.Params }} + {{- with $params.codeMaxLines }} + {{- $maxCodeLines = . }} + {{- end }} + {{- with .Params.codeMaxLines }} + {{- $maxCodeLines = . }} + {{- end }} + {{- $codeLineNumbers := false }} + {{ with $params.codeLineNumbers }} + {{- $codeLineNumbers = . }} + {{ end }} + {{ with .Params.codeLineNumbers }} + {{- $codeLineNumbers = . }} + {{ else }} + {{ if eq .Params.codeLineNumbers false }} + {{- $codeLineNumbers = false }} + {{ end }} + {{ end }} + + {{- partial "nav" . }} +
+ {{- block "main" . }}{{ end }} +
+ {{- partial "icons" }} + {{- partial "footer" . }} + + {{- with .Site.Params.customJS }} + {{- range . -}} + + {{- end }} + {{- end }} + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..35a8ba8 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,3 @@ +{{ define "main" }} + {{- partial "archive" . }} +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..1749a4e --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,26 @@ +{{- define "main" }} +{{- $scratch := newScratch }} +{{- if isset .Params "image" }} + {{- $scratch.Set "image" .Params.image }} +{{- else }} + {{ $scratch.Set "image" .Site.Params.fallBackOgImage }} +{{- end }} +{{- $image := $scratch.Get "image" }} +{{- $bg := (path.Join "images" $image | absLangURL) }} +
+
+

{{ .Title }}

+ {{- partial "post-meta" . }} + {{ partial "share" . }} + {{ with .Params.featureImage }} + + {{ end }} + {{ if .Params.toc }} +

Overview

+ {{ .TableOfContents }} + {{ end }} + {{- .Content }} +
+ {{- partial "sidebar" . }} +
+{{- end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..35a8ba8 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,3 @@ +{{ define "main" }} + {{- partial "archive" . }} +{{ end }} diff --git a/layouts/partials/analytics.html b/layouts/partials/analytics.html new file mode 100644 index 0000000..9c2a200 --- /dev/null +++ b/layouts/partials/analytics.html @@ -0,0 +1,9 @@ +{{- with .Site.Params.ga_analytics }} + + +{{- end -}} diff --git a/layouts/partials/archive.html b/layouts/partials/archive.html new file mode 100644 index 0000000..d83d69c --- /dev/null +++ b/layouts/partials/archive.html @@ -0,0 +1,15 @@ +{{ $pages := .Pages }} +{{ if .IsHome }} + {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} +{{ end }} +
+ + {{- partial "sidebar" . }} +
diff --git a/layouts/partials/excerpt.html b/layouts/partials/excerpt.html new file mode 100644 index 0000000..1f0fcdd --- /dev/null +++ b/layouts/partials/excerpt.html @@ -0,0 +1,25 @@ + +
  • +
    +
    +

    + {{ .Title }} +

    + {{ partial "post-meta.html" . }} +
    + {{- with .Params.thumbnail }} + +
  • + \ No newline at end of file diff --git a/layouts/partials/favicon.html b/layouts/partials/favicon.html new file mode 100644 index 0000000..2c78928 --- /dev/null +++ b/layouts/partials/favicon.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/layouts/partials/follow.html b/layouts/partials/follow.html new file mode 100644 index 0000000..96c7cc2 --- /dev/null +++ b/layouts/partials/follow.html @@ -0,0 +1,15 @@ +{{- $items := .Site.Data.social }} +
    + {{- range $items }} + {{- $url := .url }} + {{- if .internal }} + {{ $url = absURL .url }} + {{- end }} + + + + + + {{- end }} + {{- partial "mode" . }} +
    diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..1b3eccf --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..c2544b8 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,14 @@ + {{ if and .Title (ne (trim (lower .Site.Title) "") (trim (lower .Title) "")) }}{{ .Title }} | {{ end }}{{ .Site.Title }} + + {{ hugo.Generator }} + {{- with .Site.Params.ga_verify }} + + {{- end }} + + + {{- if (ne hugo.Environment "development") }} + {{- partial "analytics.html" . }} + {{- end }} + {{- partial "opengraph.html" . }} + {{- partial "favicon.html" . }} + diff --git a/layouts/partials/icons.html b/layouts/partials/icons.html new file mode 100644 index 0000000..f8b40fd --- /dev/null +++ b/layouts/partials/icons.html @@ -0,0 +1,62 @@ + diff --git a/layouts/partials/mode.html b/layouts/partials/mode.html new file mode 100644 index 0000000..227738b --- /dev/null +++ b/layouts/partials/mode.html @@ -0,0 +1,4 @@ + +
    + +
    diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html new file mode 100644 index 0000000..e21e054 --- /dev/null +++ b/layouts/partials/nav.html @@ -0,0 +1,43 @@ +{{- $params := .Site.Params }} +{{- $centerLogo := $params.centerLogo }} +{{ $logo := $params.logo }} + diff --git a/layouts/partials/opengraph.html b/layouts/partials/opengraph.html new file mode 100644 index 0000000..29332fd --- /dev/null +++ b/layouts/partials/opengraph.html @@ -0,0 +1,71 @@ +{{- $summary := .Summary | truncate 160 }} +{{- with .Params.description }} + {{- $summary = (. | truncate 160) }} +{{- end }} +{{- $site := .Site.Title }} +{{- $title := .Title }} +{{- $params := .Site.Params }} +{{- $permalink := .Permalink }} +{{- $logo := absURL $params.logo }} +{{- $author := $params.author }} +{{- with .Params.author }} + {{ $author := . }} +{{- end }} +{{- $image := absURL $params.fallBackOgImage }} +{{- with .Params.featureImage }} + {{- $image = absURL . }} +{{- end }} +{{- with .Params.thumbnail }} + {{- $image = absURL . }} +{{- end }} +{{- with .Params.shareImage }} + {{- $image = absURL . }} +{{- end }} + +{{- if .IsHome }} + +{{- else }} + +{{- end }} + + + + + + + + +{{- if eq .Section $params.blogDir -}} + {{- $date := ( .Date.Format "2006-02-01") -}} + {{- $date := (time .Date) }} + {{- $lastMod := (time .Lastmod) }} + +{{- end }} diff --git a/layouts/partials/pager.html b/layouts/partials/pager.html new file mode 100644 index 0000000..9848fb4 --- /dev/null +++ b/layouts/partials/pager.html @@ -0,0 +1,19 @@ +{{- $imageBase := absURL "images/icons/" }} +{{- $paginator := .Paginator }} +{{- if gt $paginator.TotalPages 1 }} +
    + {{- if $paginator.HasPrev }} + + {{- else }} + + {{- end }} + {{- range first 4 $paginator.Pagers }} + {{ .PageNumber }} + {{- end }} + {{- if $paginator.HasNext -}} + + {{- else -}} + + {{- end }} +
    +{{- end }} diff --git a/layouts/partials/post-meta.html b/layouts/partials/post-meta.html new file mode 100644 index 0000000..f39b050 --- /dev/null +++ b/layouts/partials/post-meta.html @@ -0,0 +1,16 @@ +
    + + + + + {{- with .Params.tags -}} + {{- range . }} + {{- $tag := . | urlize }} + + {{- end }} + {{- end }} +
    diff --git a/layouts/partials/share.html b/layouts/partials/share.html new file mode 100644 index 0000000..c2c5d83 --- /dev/null +++ b/layouts/partials/share.html @@ -0,0 +1,29 @@ +
    + Share on: + + + + + + + + + + + + + + +
    diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html new file mode 100644 index 0000000..c54285b --- /dev/null +++ b/layouts/partials/sidebar.html @@ -0,0 +1,67 @@ +{{ $title := .Title }} + diff --git a/layouts/partials/top.html b/layouts/partials/top.html new file mode 100644 index 0000000..54ac4c1 --- /dev/null +++ b/layouts/partials/top.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html new file mode 100644 index 0000000..5f29d66 --- /dev/null +++ b/layouts/shortcodes/video.html @@ -0,0 +1,4 @@ +{{ $url := .Get 0 }} +
    + +
    -- cgit v1.3.1-26-gb76a