From 60fe49ea3af38d4a7d5e8de1cdb72887b167b22d Mon Sep 17 00:00:00 2001 From: gabrielgio Date: Sat, 11 Jul 2020 22:35:14 +0200 Subject: Moving from jekyll to hugo --- themes/ananke/layouts/partials/commento.html | 2 + .../layouts/partials/func/GetFeaturedImage.html | 35 ++++++++++ themes/ananke/layouts/partials/head-additions.html | 0 themes/ananke/layouts/partials/i18nlist.html | 10 +++ .../ananke/layouts/partials/menu-contextual.html | 33 +++++++++ .../ananke/layouts/partials/new-window-icon.html | 2 + themes/ananke/layouts/partials/page-header.html | 26 +++++++ themes/ananke/layouts/partials/site-favicon.html | 3 + themes/ananke/layouts/partials/site-footer.html | 8 +++ themes/ananke/layouts/partials/site-header.html | 36 ++++++++++ .../ananke/layouts/partials/site-navigation.html | 26 +++++++ themes/ananke/layouts/partials/site-scripts.html | 4 ++ themes/ananke/layouts/partials/social-follow.html | 80 ++++++++++++++++++++++ themes/ananke/layouts/partials/social-share.html | 26 +++++++ .../layouts/partials/summary-with-image.html | 29 ++++++++ themes/ananke/layouts/partials/summary.html | 13 ++++ themes/ananke/layouts/partials/svg/facebook.svg | 1 + themes/ananke/layouts/partials/svg/github.svg | 3 + themes/ananke/layouts/partials/svg/gitlab.svg | 1 + themes/ananke/layouts/partials/svg/instagram.svg | 1 + themes/ananke/layouts/partials/svg/keybase.svg | 3 + themes/ananke/layouts/partials/svg/linkedin.svg | 3 + themes/ananke/layouts/partials/svg/mastodon.svg | 4 ++ themes/ananke/layouts/partials/svg/medium.svg | 3 + themes/ananke/layouts/partials/svg/new-window.svg | 3 + themes/ananke/layouts/partials/svg/rss.svg | 5 ++ themes/ananke/layouts/partials/svg/slack.svg | 27 ++++++++ .../ananke/layouts/partials/svg/stackoverflow.svg | 8 +++ themes/ananke/layouts/partials/svg/twitter.svg | 1 + themes/ananke/layouts/partials/svg/youtube.svg | 1 + themes/ananke/layouts/partials/tags.html | 9 +++ 31 files changed, 406 insertions(+) create mode 100644 themes/ananke/layouts/partials/commento.html create mode 100644 themes/ananke/layouts/partials/func/GetFeaturedImage.html create mode 100644 themes/ananke/layouts/partials/head-additions.html create mode 100644 themes/ananke/layouts/partials/i18nlist.html create mode 100644 themes/ananke/layouts/partials/menu-contextual.html create mode 100644 themes/ananke/layouts/partials/new-window-icon.html create mode 100644 themes/ananke/layouts/partials/page-header.html create mode 100644 themes/ananke/layouts/partials/site-favicon.html create mode 100755 themes/ananke/layouts/partials/site-footer.html create mode 100755 themes/ananke/layouts/partials/site-header.html create mode 100644 themes/ananke/layouts/partials/site-navigation.html create mode 100644 themes/ananke/layouts/partials/site-scripts.html create mode 100644 themes/ananke/layouts/partials/social-follow.html create mode 100644 themes/ananke/layouts/partials/social-share.html create mode 100644 themes/ananke/layouts/partials/summary-with-image.html create mode 100644 themes/ananke/layouts/partials/summary.html create mode 100644 themes/ananke/layouts/partials/svg/facebook.svg create mode 100644 themes/ananke/layouts/partials/svg/github.svg create mode 100644 themes/ananke/layouts/partials/svg/gitlab.svg create mode 100644 themes/ananke/layouts/partials/svg/instagram.svg create mode 100644 themes/ananke/layouts/partials/svg/keybase.svg create mode 100644 themes/ananke/layouts/partials/svg/linkedin.svg create mode 100644 themes/ananke/layouts/partials/svg/mastodon.svg create mode 100644 themes/ananke/layouts/partials/svg/medium.svg create mode 100644 themes/ananke/layouts/partials/svg/new-window.svg create mode 100644 themes/ananke/layouts/partials/svg/rss.svg create mode 100644 themes/ananke/layouts/partials/svg/slack.svg create mode 100644 themes/ananke/layouts/partials/svg/stackoverflow.svg create mode 100644 themes/ananke/layouts/partials/svg/twitter.svg create mode 100644 themes/ananke/layouts/partials/svg/youtube.svg create mode 100644 themes/ananke/layouts/partials/tags.html (limited to 'themes/ananke/layouts/partials') diff --git a/themes/ananke/layouts/partials/commento.html b/themes/ananke/layouts/partials/commento.html new file mode 100644 index 0000000..54e7589 --- /dev/null +++ b/themes/ananke/layouts/partials/commento.html @@ -0,0 +1,2 @@ +
+ diff --git a/themes/ananke/layouts/partials/func/GetFeaturedImage.html b/themes/ananke/layouts/partials/func/GetFeaturedImage.html new file mode 100644 index 0000000..3c0d5de --- /dev/null +++ b/themes/ananke/layouts/partials/func/GetFeaturedImage.html @@ -0,0 +1,35 @@ +{{/* + GetFeaturedImage + + This partial gets the url for featured image for a given page. + + If a featured_image was set in the page's front matter, then that will be used. + + If not set, this will search page resources to find an image that contains the word + "cover", and if found, returns the path to that resource. + + If no featured_image was set, and there's no "cover" image in page resources, then + this partial returns an empty string (which evaluates to false). + + @return Permalink to featured image, or an empty string if not found. + +*/}} + +{{/* Declare a new string variable, $linkToCover */}} +{{ $linkToCover := "" }} + +{{/* Use the value from front matter if present */}} +{{ if .Params.featured_image }} + {{ $linkToCover = .Params.featured_image }} + +{{/* Find the first image with 'cover' in the name in this page bundle. */}} +{{ else }} + {{ $img := (.Resources.ByType "image").GetMatch "*cover*" }} + {{ with $img }} + {{ $linkToCover = .Permalink }} + {{ end }} +{{ end }} + +{{/* return either a permalink, or an empty string. Note that partials can only have a single +return statement, so this needs to be at the end of the partial (and not in the if block) */}} +{{ return $linkToCover }} \ No newline at end of file diff --git a/themes/ananke/layouts/partials/head-additions.html b/themes/ananke/layouts/partials/head-additions.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/ananke/layouts/partials/i18nlist.html b/themes/ananke/layouts/partials/i18nlist.html new file mode 100644 index 0000000..ba7c1ea --- /dev/null +++ b/themes/ananke/layouts/partials/i18nlist.html @@ -0,0 +1,10 @@ +{{ if .IsTranslated }} +

{{ i18n "translations" }}

+ +{{ end }} diff --git a/themes/ananke/layouts/partials/menu-contextual.html b/themes/ananke/layouts/partials/menu-contextual.html new file mode 100644 index 0000000..ae50dc6 --- /dev/null +++ b/themes/ananke/layouts/partials/menu-contextual.html @@ -0,0 +1,33 @@ +{{/* + Use Hugo's native Table of contents feature. You must set `toc: true` in your parameters for this to show. + https://gohugo.io/content-management/toc/ +*/}} + +{{- if .Params.toc -}} + +{{- end -}} + +{{/* + Use Hugo's native related content feature to pull in content that may have similar parameters, like tags. etc. + https://gohugo.io/content-management/related/ +*/}} + +{{ $related := .Site.RegularPages.Related . | first 15 }} + +{{ with $related }} + +{{ end }} diff --git a/themes/ananke/layouts/partials/new-window-icon.html b/themes/ananke/layouts/partials/new-window-icon.html new file mode 100644 index 0000000..8f422ca --- /dev/null +++ b/themes/ananke/layouts/partials/new-window-icon.html @@ -0,0 +1,2 @@ +{{ $new_window_icon_size := "8px" }} +{{ partial "svg/new-window.svg" (dict "size" $new_window_icon_size) }} \ No newline at end of file diff --git a/themes/ananke/layouts/partials/page-header.html b/themes/ananke/layouts/partials/page-header.html new file mode 100644 index 0000000..9f2ebd5 --- /dev/null +++ b/themes/ananke/layouts/partials/page-header.html @@ -0,0 +1,26 @@ +{{ $featured_image := partial "func/GetFeaturedImage.html" . }} +{{ if $featured_image }} + {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} + {{ $featured_image := (trim $featured_image "/") | absURL }} +
+
+ {{ partial "site-navigation.html" . }} +
+ {{ if not .Params.omit_header_text }} +

{{ .Title | default .Site.Title }}

+ {{ with .Params.description }} +

+ {{ . }} +

+ {{ end }} + {{ end }} +
+
+
+{{ else }} +
+
+ {{ partial "site-navigation.html" . }} +
+
+{{ end }} diff --git a/themes/ananke/layouts/partials/site-favicon.html b/themes/ananke/layouts/partials/site-favicon.html new file mode 100644 index 0000000..b7bb9c1 --- /dev/null +++ b/themes/ananke/layouts/partials/site-favicon.html @@ -0,0 +1,3 @@ +{{ if .Site.Params.favicon }} + +{{ end }} diff --git a/themes/ananke/layouts/partials/site-footer.html b/themes/ananke/layouts/partials/site-footer.html new file mode 100755 index 0000000..41c0629 --- /dev/null +++ b/themes/ananke/layouts/partials/site-footer.html @@ -0,0 +1,8 @@ + diff --git a/themes/ananke/layouts/partials/site-header.html b/themes/ananke/layouts/partials/site-header.html new file mode 100755 index 0000000..10a682f --- /dev/null +++ b/themes/ananke/layouts/partials/site-header.html @@ -0,0 +1,36 @@ +{{ $featured_image := .Param "featured_image"}} +{{ if $featured_image }} + {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} + {{ $featured_image := (trim $featured_image "/") | absURL }} +
+
+ {{ partial "site-navigation.html" .}} +
+

+ {{ .Title | default .Site.Title }} +

+ {{ with .Params.description }} +

+ {{ . }} +

+ {{ end }} +
+
+
+{{ else }} +
+
+ {{ partial "site-navigation.html" . }} +
+

+ {{ .Title | default .Site.Title }} +

+ {{ with .Params.description }} +

+ {{ . }} +

+ {{ end }} +
+
+
+{{ end }} diff --git a/themes/ananke/layouts/partials/site-navigation.html b/themes/ananke/layouts/partials/site-navigation.html new file mode 100644 index 0000000..d73c66d --- /dev/null +++ b/themes/ananke/layouts/partials/site-navigation.html @@ -0,0 +1,26 @@ + diff --git a/themes/ananke/layouts/partials/site-scripts.html b/themes/ananke/layouts/partials/site-scripts.html new file mode 100644 index 0000000..bd6c7f5 --- /dev/null +++ b/themes/ananke/layouts/partials/site-scripts.html @@ -0,0 +1,4 @@ +{{ $script := .Site.Data.webpack_assets.app }} +{{ with $script.js }} + +{{ end }} diff --git a/themes/ananke/layouts/partials/social-follow.html b/themes/ananke/layouts/partials/social-follow.html new file mode 100644 index 0000000..0755ce2 --- /dev/null +++ b/themes/ananke/layouts/partials/social-follow.html @@ -0,0 +1,80 @@ + +{{ $icon_size := "32px" }} +{{ with .Param "stackoverflow" }} + + {{ partial "svg/stackoverflow.svg" (dict "size" $icon_size) }} + {{- partial "new-window-icon.html" . -}} + +{{ end }} +{{ with .Param "facebook" }} + + {{ partial "svg/facebook.svg" (dict "size" $icon_size) }} + {{- partial "new-window-icon.html" . -}} + +{{ end }} +{{ with .Param "twitter" }} + + {{ partial "svg/twitter.svg" (dict "size" $icon_size) }} + {{- partial "new-window-icon.html" . -}} + +{{ end }} +{{ with .Param "instagram" }} + + {{ partial "svg/instagram.svg" (dict "size" $icon_size) }} + {{- partial "new-window-icon.html" . -}} + +{{ end }} +{{ with .Param "youtube" }} + + {{ partial "svg/youtube.svg" (dict "size" $icon_size) }} + {{- partial "new-window-icon.html" . -}} + +{{ end }} +{{ with .Param "linkedin" }} + + {{ partial "svg/linkedin.svg" (dict "size" $icon_size) }} + {{- partial "new-window-icon.html" . -}} + +{{ end }} +{{ with .Param "github" }} + + {{ partial "svg/github.svg" (dict "size" $icon_size) }} + {{- partial "new-window-icon.html" . -}} + +{{ end }} +{{ with .Param "gitlab" }} + + {{ partial "svg/gitlab.svg" (dict "size" $icon_size) }} + {{- partial "new-window-icon.html" . -}} + +{{ end }} +{{ with .Param "keybase" }} + + {{ partial "svg/keybase.svg" (dict "size" $icon_size) }} + {{- partial "new-window-icon.html" . -}} + +{{ end }} +{{ with .Param "medium" }} + + {{ partial "svg/medium.svg" (dict "size" $icon_size) }} + {{- partial "new-window-icon.html" . -}} + +{{ end }} +{{ with .Param "mastodon" }} + + {{ partial "svg/mastodon.svg" (dict "size" $icon_size) }} + {{- partial "new-window-icon.html" . -}} + +{{ end }} +{{ with .Param "slack" }} + + {{ partial "svg/slack.svg" (dict "size" $icon_size) }} + {{- partial "new-window-icon.html" . -}} + +{{ end }} +{{ with .Param "rss" }} + + {{ partial "svg/rss.svg" (dict "size" $icon_size) }} + {{- partial "new-window-icon.html" . -}} + +{{ end }} diff --git a/themes/ananke/layouts/partials/social-share.html b/themes/ananke/layouts/partials/social-share.html new file mode 100644 index 0000000..eb313c0 --- /dev/null +++ b/themes/ananke/layouts/partials/social-share.html @@ -0,0 +1,26 @@ +{{ $title := .Title }} +{{ $url := printf "%s" .Permalink | absLangURL }} +{{ $icon_size := "32px" }} + +{{ if not .Params.disable_share }} +
+ + {{ $facebook_href := printf "https://www.facebook.com/sharer.php?u=%s" $url }} + + + {{ $twitter_href := printf "https://twitter.com/share?url=%s&text=%s" $url $title }} + {{ with .Site.Social.twitter }} + {{ $twitter_href = printf "%s&via=%s" $twitter_href . }} + {{ end }} + + + {{ $linkedin_href := printf "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" $url $title }} + + {{ partialCached "svg/linkedin.svg" (dict "size" $icon_size) $icon_size }} + +
+{{ end }} diff --git a/themes/ananke/layouts/partials/summary-with-image.html b/themes/ananke/layouts/partials/summary-with-image.html new file mode 100644 index 0000000..702a305 --- /dev/null +++ b/themes/ananke/layouts/partials/summary-with-image.html @@ -0,0 +1,29 @@ +{{ $featured_image := partial "func/GetFeaturedImage.html" . }} +
+
+
+ {{ if $featured_image }} + {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} + {{ $featured_image := (trim $featured_image "/") | absURL }} +
+ + image from {{ .Title }} + +
+ {{ end }} +
+

+ + {{ .Title }} + +

+ + {{ $.Param "read_more_copy" | default (i18n "readMore") }} + {{/* TODO: add author +

By {{ .Author }}

*/}} +
+
+
+
diff --git a/themes/ananke/layouts/partials/summary.html b/themes/ananke/layouts/partials/summary.html new file mode 100644 index 0000000..65b3eaa --- /dev/null +++ b/themes/ananke/layouts/partials/summary.html @@ -0,0 +1,13 @@ +
+
+ {{ humanize .Section }} +

+ + {{ .Title }} + +

+ +
+
diff --git a/themes/ananke/layouts/partials/svg/facebook.svg b/themes/ananke/layouts/partials/svg/facebook.svg new file mode 100644 index 0000000..0afb80f --- /dev/null +++ b/themes/ananke/layouts/partials/svg/facebook.svg @@ -0,0 +1 @@ + diff --git a/themes/ananke/layouts/partials/svg/github.svg b/themes/ananke/layouts/partials/svg/github.svg new file mode 100644 index 0000000..a362a60 --- /dev/null +++ b/themes/ananke/layouts/partials/svg/github.svg @@ -0,0 +1,3 @@ + + + diff --git a/themes/ananke/layouts/partials/svg/gitlab.svg b/themes/ananke/layouts/partials/svg/gitlab.svg new file mode 100644 index 0000000..36a3bed --- /dev/null +++ b/themes/ananke/layouts/partials/svg/gitlab.svg @@ -0,0 +1 @@ + diff --git a/themes/ananke/layouts/partials/svg/instagram.svg b/themes/ananke/layouts/partials/svg/instagram.svg new file mode 100644 index 0000000..2fa7d47 --- /dev/null +++ b/themes/ananke/layouts/partials/svg/instagram.svg @@ -0,0 +1 @@ + diff --git a/themes/ananke/layouts/partials/svg/keybase.svg b/themes/ananke/layouts/partials/svg/keybase.svg new file mode 100644 index 0000000..9fdb8b3 --- /dev/null +++ b/themes/ananke/layouts/partials/svg/keybase.svg @@ -0,0 +1,3 @@ + + + diff --git a/themes/ananke/layouts/partials/svg/linkedin.svg b/themes/ananke/layouts/partials/svg/linkedin.svg new file mode 100644 index 0000000..744ef7c --- /dev/null +++ b/themes/ananke/layouts/partials/svg/linkedin.svg @@ -0,0 +1,3 @@ + + + diff --git a/themes/ananke/layouts/partials/svg/mastodon.svg b/themes/ananke/layouts/partials/svg/mastodon.svg new file mode 100644 index 0000000..205345b --- /dev/null +++ b/themes/ananke/layouts/partials/svg/mastodon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/themes/ananke/layouts/partials/svg/medium.svg b/themes/ananke/layouts/partials/svg/medium.svg new file mode 100644 index 0000000..cc5dc23 --- /dev/null +++ b/themes/ananke/layouts/partials/svg/medium.svg @@ -0,0 +1,3 @@ + + + diff --git a/themes/ananke/layouts/partials/svg/new-window.svg b/themes/ananke/layouts/partials/svg/new-window.svg new file mode 100644 index 0000000..ba148ad --- /dev/null +++ b/themes/ananke/layouts/partials/svg/new-window.svg @@ -0,0 +1,3 @@ + + + diff --git a/themes/ananke/layouts/partials/svg/rss.svg b/themes/ananke/layouts/partials/svg/rss.svg new file mode 100644 index 0000000..084cff5 --- /dev/null +++ b/themes/ananke/layouts/partials/svg/rss.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/themes/ananke/layouts/partials/svg/slack.svg b/themes/ananke/layouts/partials/svg/slack.svg new file mode 100644 index 0000000..57974d4 --- /dev/null +++ b/themes/ananke/layouts/partials/svg/slack.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/ananke/layouts/partials/svg/stackoverflow.svg b/themes/ananke/layouts/partials/svg/stackoverflow.svg new file mode 100644 index 0000000..ece303f --- /dev/null +++ b/themes/ananke/layouts/partials/svg/stackoverflow.svg @@ -0,0 +1,8 @@ + + + diff --git a/themes/ananke/layouts/partials/svg/twitter.svg b/themes/ananke/layouts/partials/svg/twitter.svg new file mode 100644 index 0000000..6803558 --- /dev/null +++ b/themes/ananke/layouts/partials/svg/twitter.svg @@ -0,0 +1 @@ + diff --git a/themes/ananke/layouts/partials/svg/youtube.svg b/themes/ananke/layouts/partials/svg/youtube.svg new file mode 100644 index 0000000..9a55379 --- /dev/null +++ b/themes/ananke/layouts/partials/svg/youtube.svg @@ -0,0 +1 @@ + diff --git a/themes/ananke/layouts/partials/tags.html b/themes/ananke/layouts/partials/tags.html new file mode 100644 index 0000000..4fce241 --- /dev/null +++ b/themes/ananke/layouts/partials/tags.html @@ -0,0 +1,9 @@ + -- cgit v1.2.3