mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Patrick Kollitsch
24.28.2024 ae14ccf4072c13069e1f28e3c5f39bce4b917885
docs(fix): update theme.toml with min version and authors

Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
2 files added
3 files modified
115 ■■■■ changed files
layouts/partials/func/social/getShareLink.html 24 ●●●●● patch | view | raw | blame | history
layouts/partials/func/social/sortNetworks.html 23 ●●●●● patch | view | raw | blame | history
layouts/partials/social/follow.html 26 ●●●●● patch | view | raw | blame | history
layouts/partials/social/share.html 29 ●●●●● patch | view | raw | blame | history
theme.toml 13 ●●●● patch | view | raw | blame | history
layouts/partials/func/social/getShareLink.html
New file
@@ -0,0 +1,24 @@
{{- $context := .context -}}
{{- $setup := .setup -}}
{{- $separator := "&" -}}
{{- $title := $context.Title | transform.HTMLEscape -}}
{{- $description := $context.Summary | transform.Plainify | transform.HTMLEscape -}}
{{- $permalink := $context.Permalink | transform.HTMLEscape -}}
{{- with $setup.separator -}}
  {{- $separator = . -}}
{{- end -}}
{{- $link := fmt.Printf "%s%s" $setup.link "?" -}}
{{- range $key, $value := $setup.particles -}}
  {{- if compare.Eq $key "params" -}}
    {{- $link = fmt.Printf "%s%s%s" $permalink $separator $value -}}
  {{- else -}}
    {{- if compare.Eq $value "description" -}}
      {{- $link = fmt.Printf "%s%s%s" $link $separator (collections.Querify $key $description) -}}
    {{- else if compare.Eq $value "title" -}}
      {{- $link = fmt.Printf "%s%s%s" $link $separator (collections.Querify $key $title) -}}
    {{- else if compare.Eq $value "permalink" -}}
      {{- $link = fmt.Printf "%s%s%s" $link $separator (collections.Querify $key $permalink) -}}
    {{- end -}}
  {{- end -}}
{{- end -}}
{{- return $link -}}
layouts/partials/func/social/sortNetworks.html
New file
@@ -0,0 +1,23 @@
{{- /*
Sorting a list of social networks defined by the order in `networks`.
Only networks present in both `networks` and `setups` will be included. Items missing from `networks` are ignored.
Use `networks` to setup the order of the networks and which network to enable.
Usage: {{ $setups = partials.IncludeCached "func/sortNetworks.html" (dict "networks" $networks "setups" $setups) }}
See also `config/_default/params.toml` > `ananke.social` for details.
*/ -}}
{{- $networks := .networks -}}
{{- $setups := .setups -}}
{{- $output := collections.Slice -}}
{{- range $networks -}}
  {{- $network := . -}}
  {{- range $setups -}}
    {{- if compare.Eq .slug $network -}}
      {{- $output = $output | collections.Append . -}}
    {{- end -}}
  {{- end -}}
{{- end -}}
{{- return $output -}}
layouts/partials/social/follow.html
@@ -44,29 +44,3 @@
    </a>
  {{- end -}}
</div>
{{ define "partials/func/sortNetworks.html" }}
  {{- /*
  Sorting a list of social networks defined by the order in `networks`.
  Only networks present in both `networks` and `setups` will be included. Items missing from `networks` are ignored.
  Use `networks` to setup the order of the networks and which network to enable.
  Usage: {{ $setups = partials.IncludeCached "func/sortNetworks.html" (dict "networks" $networks "setups" $setups) }}
  See also `config/_default/params.toml` > `ananke.social` for details.
  */ -}}
  {{- $networks := .networks -}}
  {{- $setups := .setups -}}
  {{- $output := collections.Slice -}}
  {{- range $networks -}}
    {{- $network := . -}}
    {{- range $setups -}}
      {{- if compare.Eq .slug $network -}}
        {{- $output = $output | collections.Append . -}}
      {{- end -}}
    {{- end -}}
  {{- end -}}
  {{- return $output -}}
{{- end -}}
layouts/partials/social/share.html
@@ -33,7 +33,7 @@
        {{- continue -}}
        {{/* @todo notification into CLI that a network is configured but not supported */}}
      {{- end -}}
      {{- $options := (dict "context" page "setup" $setup) }}
      {{- $options := (dict "context" $context "setup" $setup) }}
      {{- $href := partialCached "func/getShareLink.html" $options $options -}}
      <a href="{{ $href }}"
        class="ananke-social-link {{ $setup.slug }} no-underline"
@@ -60,30 +60,3 @@
  </div>
{{- end -}} {{/* if eq "true" $disabled */}}
{{ define "partials/func/getShareLink.html" }}
  {{- $context := .context -}}
  {{- $setup := .setup -}}
  {{- $separator := "&" -}}
  {{- $title := $context.Title | transform.HTMLEscape -}}
  {{- $description := $context.Summary | transform.Plainify | transform.HTMLEscape -}}
  {{- $permalink := $context.Permalink | transform.HTMLEscape -}}
  {{- with $setup.separator -}}
    {{- $separator = . -}}
  {{- end -}}
  {{- $link := fmt.Printf "%s%s" $setup.link "?" -}}
  {{- range $key, $value := $setup.particles -}}
    {{- if compare.Eq $key "params" -}}
      {{- $link = fmt.Printf "%s%s%s" $permalink $separator $value -}}
    {{- else -}}
      {{- if compare.Eq $value "description" -}}
        {{- $link = fmt.Printf "%s%s%s" $link $separator (collections.Querify $key $description) -}}
      {{- else if compare.Eq $value "title" -}}
        {{- $link = fmt.Printf "%s%s%s" $link $separator (collections.Querify $key $title) -}}
      {{- else if compare.Eq $value "permalink" -}}
        {{- $link = fmt.Printf "%s%s%s" $link $separator (collections.Querify $key $permalink) -}}
      {{- end -}}
    {{- end -}}
  {{- end -}}
  {{- return $link -}}
{{ end }}
theme.toml
@@ -1,6 +1,3 @@
# theme.toml template for a Hugo theme
# See https://github.com/gohugoio/hugoThemes#themetoml for an example
name = "Ananke Gohugo Theme"
license = "MIT"
licenselink = "https://github.com/theNewDynamic/gohugo-theme-ananke/blob/master/LICENSE.md"
@@ -8,8 +5,10 @@
homepage = "https://github.com/theNewDynamic/gohugo-theme-ananke"
tags = ["website", "starter", "responsive", "Disqus", "blog", "Tachyons", "Multilingual", "Stackbit"]
features = ["posts", "shortcodes", "related content", "comments"]
min_version = "0.84.0"
min_version = "0.128.0"
[author]
  name = "theNewDynamic"
  homepage = "https://www.thenewdynamic.com/"
authors = [
  {name = "Patrick Kollitsch", homepage = "https://github.com/davidsneighbour"},
  {name = "Regis Philibert", homepage = "https://github.com/regisphilibert"},
  {name = "Bud Parr", homepage = "https://github.com/budparr"}
]