diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..436461d8 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,5 @@ +# Code of Conduct + +We want to foster a positive, inclusive, and welcoming environment 💜 + +We expect you to follow our [Code of Conduct](https://wowchemy.com/docs/hugo-tutorials/contribute/) to fulfil this goal. diff --git a/modules/wowchemy/layouts/partials/components/footers/minimal.html b/modules/wowchemy/layouts/partials/components/footers/minimal.html new file mode 100644 index 00000000..e5a195cc --- /dev/null +++ b/modules/wowchemy/layouts/partials/components/footers/minimal.html @@ -0,0 +1,30 @@ +{{ if .IsTranslated | and site.Params.footer.show_translations }} +
+
{{ i18n "languages" }}:
+
{{ index site.Data.i18n.languages .Lang }}
+ {{ range .Translations }} +
{{ index site.Data.i18n.languages .Lang }}
+ {{ end }} +
+{{ end }} + +{{ if or (site.GetPage "/terms.md") (site.GetPage "/privacy.md") }} +

+ {{ with site.GetPage "/privacy.md" }} + {{ printf "%s" .RelPermalink .Title | safeHTML }} + {{ end }} + {{ with site.GetPage "/terms.md" }} + {{ if site.GetPage "/privacy.md" }} · {{ end }} + {{ printf "%s" .RelPermalink .Title | safeHTML }} + {{ end }} +

+{{ end }} + +{{ with site.Params.footer.text }} +

+ {{ . | markdownify | emojify }} +

+{{ end }} + +{{/* Display copyright license. */}} +{{ partial "site_footer_license" . }} diff --git a/modules/wowchemy/layouts/partials/site_footer.html b/modules/wowchemy/layouts/partials/site_footer.html index 34c13e01..1602355e 100644 --- a/modules/wowchemy/layouts/partials/site_footer.html +++ b/modules/wowchemy/layouts/partials/site_footer.html @@ -2,36 +2,13 @@ {{ partial "functions/get_hook" (dict "hook" "footer-start" "context" .) }} - {{ if .IsTranslated | and site.Params.footer.show_translations }} -
-
{{ i18n "languages" }}:
-
{{ index site.Data.i18n.languages .Lang }}
- {{ range .Translations }} -
{{ index site.Data.i18n.languages .Lang }}
- {{ end }} -
+ {{/* Load footer widget */}} + {{ $footer_section_name := site.Params.footer.widget | default "minimal" }} + {{ $footer_section_path := printf "components/footers/%s.html" $footer_section_name }} + {{ if not (templates.Exists (printf "partials/%s" $footer_section_path)) }} + {{ errorf "Check your `params.yaml`. Cannot find footer widget at `layouts/partials/%s`" $footer_section_path }} {{ end }} - - {{ if or (site.GetPage "/terms.md") (site.GetPage "/privacy.md") }} -

- {{ with site.GetPage "/privacy.md" }} - {{ printf "%s" .RelPermalink .Title | safeHTML }} - {{ end }} - {{ with site.GetPage "/terms.md" }} - {{ if site.GetPage "/privacy.md" }} · {{ end }} - {{ printf "%s" .RelPermalink .Title | safeHTML }} - {{ end }} -

- {{ end }} - - {{ with site.Params.footer.text }} -

- {{ . | markdownify | emojify }} -

- {{ end }} - - {{/* Display copyright license. */}} - {{ partial "site_footer_license" . }} + {{ partial $footer_section_path . }}

{{ $is_sponsor := site.Params.i_am_a_sponsor | default false }} @@ -46,7 +23,7 @@ {{ $i18n_published_with = replace $i18n_published_with "{wowchemy}" "Wowchemy" | safeHTML }} {{ $i18n_published_with = replace $i18n_published_with "{repo_link}" "" | safeHTML }} {{ $i18n_published_with = replace $i18n_published_with "{/repo_link}" "" | safeHTML }} - {{ $i18n_published_with | markdownify | emojify }} + {{ $i18n_published_with | replaceRE "{year}" now.Year | markdownify | emojify | safeHTML }} {{ end }}