{{ block "main" . }}{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index a934e59..7225d09 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,3 +1,7 @@

© {{ now.Year }} {{ site.Params.author.name }}

+ + + +
diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html index 8e6c145..c3c6e33 100644 --- a/layouts/partials/head/css.html +++ b/layouts/partials/head/css.html @@ -6,5 +6,4 @@ {{- end }} {{- end }} -{{- end }} - +{{- end -}} diff --git a/layouts/partials/head/js.html b/layouts/partials/head/js.html index 6123e7f..0baf831 100644 --- a/layouts/partials/head/js.html +++ b/layouts/partials/head/js.html @@ -6,12 +6,11 @@ }} {{- with . | js.Build $opts }} {{- if hugo.IsDevelopment }} - + {{- else }} {{- with . | fingerprint }} - + {{- end }} {{- end }} {{- end }} -{{- end }} - +{{- end -}} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 7b728a6..9195345 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,7 +1,12 @@ diff --git a/layouts/partials/list/recent-posts.html b/layouts/partials/list/recent-posts.html index c1075e2..d774138 100644 --- a/layouts/partials/list/recent-posts.html +++ b/layouts/partials/list/recent-posts.html @@ -1,5 +1,5 @@ {{- /* -List of Recent Posts. Accepts a dict with the following optional parameters: +List of specified number of the most recent and published posts. Accepts a dict with the following optional parameters: @context {int} count: Number of posts to display (default: 10). @context {string} title: Section title (default: "Recent Articles"). @@ -11,7 +11,6 @@ List of Recent Posts. Accepts a dict with the following optional parameters: {{- $count := .count | default 10 -}} {{- $title := .title | default (lang.Translate "posts.recent" | default "Recent Articles") -}} {{- $showViewAll := .show_view_all | default true -}} -

@@ -19,7 +18,6 @@ List of Recent Posts. Accepts a dict with the following optional parameters:

- {{- /* Get published 10 most recent posts */ -}} {{- $recentPosts := where site.RegularPages "Date" "!=" nil }} {{- $recentPosts = where $recentPosts ".Date" "le" now }} {{- $recentPosts = first $count $recentPosts }} @@ -35,14 +33,14 @@ List of Recent Posts. Accepts a dict with the following optional parameters: {{- if $showViewAll }} - + {{ lang.Translate "posts.view_all" | default "View all posts" }} {{- end }} {{ else }}
-

+

{{ lang.Translate "list.empty" | default "No posts in this section." }}

diff --git a/layouts/partials/selectLanguage.html b/layouts/partials/selectLanguage.html new file mode 100644 index 0000000..752b605 --- /dev/null +++ b/layouts/partials/selectLanguage.html @@ -0,0 +1,39 @@ +{{- /* +Selection of available languages. +Dynamically links to corresponding page/post if a translated version exists, otherwise to homepage of that language as fallback. + +Note: `$activeLang` and `$allTranslationsForPage` are technically unnecessary variables, their values could be called with `$.Lang` and `$.Translations` respectively. +These variables - together with the explicit naming of `.` context variables in other cases - were chosen for better readability and understandability of the code. +*/ -}} + +{{- if gt (len site.Languages) 1 }} +{{- $activeLang := .Lang }} +{{- $allTranslationsForPage := .Translations }} +
+
    + {{- range site.Languages }} + {{- $currLangSlice := . }} + {{- if ne $currLangSlice.Lang $activeLang }} + {{- $targetPage := index (where site.Home.Translations "Lang" $currLangSlice.Lang) 0 }} + {{- $translatedPage := index (where $allTranslationsForPage "Lang" $currLangSlice.Lang) 0 }} + {{- if $translatedPage }}{{- $targetPage = $translatedPage }}{{- end }} +
  • + + + +
  • + {{- end }} + {{- end }} +
+
+{{- end }} diff --git a/layouts/partials/selectTheme.html b/layouts/partials/selectTheme.html new file mode 100644 index 0000000..e9114cc --- /dev/null +++ b/layouts/partials/selectTheme.html @@ -0,0 +1,15 @@ + diff --git a/layouts/partials/single/tags.html b/layouts/partials/single/tags.html index e90b909..f9c8105 100644 --- a/layouts/partials/single/tags.html +++ b/layouts/partials/single/tags.html @@ -7,7 +7,7 @@