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

Joe Mooring
yesterday 039d10644c072488fe820a39e253ba5a2124f10b
fix: address deprecations in language API (#933)

See https://discourse.gohugo.io/t/deprecations-in-v0-158-0/56869.
9 files modified
27 ■■■■ changed files
layouts/_partials/i18nlist.html 4 ●●●● patch | view | raw | blame | history
layouts/_partials/site-navigation.html 4 ●●●● patch | view | raw | blame | history
layouts/_partials/social/follow.html 2 ●●● patch | view | raw | blame | history
layouts/_partials/summary-with-image.html 4 ●●●● patch | view | raw | blame | history
layouts/baseof.html 2 ●●● patch | view | raw | blame | history
layouts/home.html 3 ●●●● patch | view | raw | blame | history
layouts/single.html 2 ●●● patch | view | raw | blame | history
layouts/summary-with-image.html 4 ●●●● patch | view | raw | blame | history
site/config/_default/hugo.toml 2 ●●● patch | view | raw | blame | history
layouts/_partials/i18nlist.html
@@ -1,8 +1,8 @@
{{ if .IsTranslated }}
<h4>{{ lang.Translate "translations" }}</h4>
<ul class="{{ compare.Conditional (compare.Eq $.Site.Language.LanguageDirection "rtl") "pr0 ml3" "pl0 mr3" }}">
<ul class="{{ compare.Conditional (compare.Eq $.Site.Language.Direction "rtl") "pr0 ml3" "pl0 mr3" }}">
    {{ range .Translations }}
    <li class="list f5 f4-ns fw4 dib {{ compare.Conditional (compare.Eq $.Site.Language.LanguageDirection "rtl") "pl3" "pr3" }}">
    <li class="list f5 f4-ns fw4 dib {{ compare.Conditional (compare.Eq $.Site.Language.Direction "rtl") "pl3" "pr3" }}">
        <a class="hover-white white-90 no-underline" href="{{ .RelPermalink }}">{{ .Lang }}</a>
    </li>
    {{ end}}
layouts/_partials/site-navigation.html
@@ -10,9 +10,9 @@
    <div class="flex-l items-center">
      {{ partials.Include "i18nlist.html" . }}
      {{ if .Site.Menus.main }}
        <ul class="{{ compare.Conditional (compare.Eq $.Site.Language.LanguageDirection "rtl") "pr0 ml3" "pl0 mr3" }}">
        <ul class="{{ compare.Conditional (compare.Eq $.Site.Language.Direction "rtl") "pr0 ml3" "pl0 mr3" }}">
          {{ range .Site.Menus.main }}
          <li class="list f5 f4-ns fw4 dib {{ compare.Conditional (compare.Eq $.Site.Language.LanguageDirection "rtl") "pl3" "pr3" }}">
          <li class="list f5 f4-ns fw4 dib {{ compare.Conditional (compare.Eq $.Site.Language.Direction "rtl") "pl3" "pr3" }}">
            <a class="hover-white white-90 no-underline" href="{{ .URL }}" title="{{ lang.Translate "pageTitle" . }}">
              {{ .Name }}
            </a>
layouts/_partials/social/follow.html
@@ -19,7 +19,7 @@
      {{- $link = $profile.profilelink -}}
    {{- end -}}
    {{- $languageDirection := compare.Conditional (compare.Eq $.Site.Language.LanguageDirection "rtl") "ml1" "mr1" -}}
    {{- $languageDirection := compare.Conditional (compare.Eq $.Site.Language.Direction "rtl") "ml1" "mr1" -}}
    <a href="{{ $link }}" target="_blank" rel="noopener{{- with $rel }} {{ . -}}{{- end -}}"
        class="ananke-social-link link-transition {{ $network }} link dib z-999 pt3 pt0-l {{ $languageDirection }}"
        title="follow on {{ $label }} - Opens in a new window"
layouts/_partials/summary-with-image.html
@@ -7,13 +7,13 @@
    <div class="flex-column flex-row-ns flex">
      {{ if $featured_image }}
          {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
        <div class="{{ compare.Conditional (compare.Eq $.Site.Language.LanguageDirection "rtl") "pl3-ns" "pr3-ns" }} mb4 mb0-ns w-100 w-40-ns">
        <div class="{{ compare.Conditional (compare.Eq $.Site.Language.Direction "rtl") "pl3-ns" "pr3-ns" }} mb4 mb0-ns w-100 w-40-ns">
          <a href="{{.RelPermalink}}" class="db grow">
            <img src="{{ $featured_image }}" class="img" alt="image from {{ .Title }}">
          </a>
        </div>
      {{ end }}
      <div class="blah w-100{{ if $featured_image }} w-60-ns {{ compare.Conditional (compare.Eq $.Site.Language.LanguageDirection "rtl") "pr3-ns" "pl3-ns" }}{{ end }}">
      <div class="blah w-100{{ if $featured_image }} w-60-ns {{ compare.Conditional (compare.Eq $.Site.Language.Direction "rtl") "pr3-ns" "pl3-ns" }}{{ end }}">
        <h1 class="f3 fw1 athelas mt0 lh-title">
          <a href="{{.RelPermalink}}" class="color-inherit dim link">
            {{ .Title }}
layouts/baseof.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ site.Language.LanguageCode }}" {{- if eq site.Language.LanguageDirection "rtl" }} dir="rtl" {{- end }}>
<html lang="{{ site.Language.Locale }}" {{- if eq site.Language.Direction "rtl" }} dir="rtl" {{- end }}>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
layouts/home.html
@@ -36,7 +36,7 @@
          <h1 class="f3">{{ lang.Translate "more" }}</h1>
          {{/* Now, range through the next four after the initial $n_posts items. Nest the requirements, "after" then "first" on the outside */}}
          {{ range (collections.First 4 (collections.After $n_posts $section))  }}
            <h2 class="f5 fw4 mb4 dib {{ compare.Conditional (compare.Eq $.Site.Language.LanguageDirection "rtl") "ml3" "mr3" }}">
            <h2 class="f5 fw4 mb4 dib {{ compare.Conditional (compare.Eq $.Site.Language.Direction "rtl") "ml3" "mr3" }}">
              <a href="{{ .RelPermalink }}" class="link black dim">
                {{ .Title }}
              </a>
@@ -48,4 +48,3 @@
    </div>
  {{ end }}
{{ end }}
layouts/single.html
@@ -65,7 +65,7 @@
        <span class="f6 mv4 dib tracked"> - {{ lang.Translate "wordCount" .WordCount }} </span>
      {{ end }}
    </header>
    <div class="nested-copy-line-height lh-copy {{ $.Param "post_content_classes"  | compare.Default "serif"}} f4 nested-links {{ $.Param "text_color" | compare.Default "mid-gray" }} {{ compare.Conditional (compare.Eq $.Site.Language.LanguageDirection "rtl") "pl4-l" "pr4-l" }} {{ if $needs_aside }}w-two-thirds-l{{ else }}w-100-l{{ end }}">
    <div class="nested-copy-line-height lh-copy {{ $.Param "post_content_classes"  | compare.Default "serif"}} f4 nested-links {{ $.Param "text_color" | compare.Default "mid-gray" }} {{ compare.Conditional (compare.Eq $.Site.Language.Direction "rtl") "pl4-l" "pr4-l" }} {{ if $needs_aside }}w-two-thirds-l{{ else }}w-100-l{{ end }}">
      {{- .Content -}}
      {{- partials.Include "tags.html" . -}}
      {{ if .Site.Config.Services.Disqus.Shortname }}
layouts/summary-with-image.html
@@ -4,13 +4,13 @@
    <div class="flex-column flex-row-ns flex">
      {{ if $featured_image }}
          {{/* Trimming the slash and adding absURL make sure the image works no matter collections.Where our site lives */}}
        <div class="{{ compare.Conditional (compare.Eq $.Site.Language.LanguageDirection "rtl") "pl3-ns" "pr3-ns" }} mb4 mb0-ns w-100 w-40-ns">
        <div class="{{ compare.Conditional (compare.Eq $.Site.Language.Direction "rtl") "pl3-ns" "pr3-ns" }} mb4 mb0-ns w-100 w-40-ns">
          <a href="{{.RelPermalink}}" class="db grow">
            <img src="{{ $featured_image }}" class="img" alt="image from {{ .Title }}">
          </a>
        </div>
      {{ end }}
      <div class="blah w-100{{ if $featured_image }} w-60-ns {{ compare.Conditional (compare.Eq $.Site.Language.LanguageDirection "rtl") "pr3-ns" "pl3-ns" }}{{ end }}">
      <div class="blah w-100{{ if $featured_image }} w-60-ns {{ compare.Conditional (compare.Eq $.Site.Language.Direction "rtl") "pr3-ns" "pl3-ns" }}{{ end }}">
        <h1 class="f3 fw1 athelas mt0 lh-title">
          <a href="{{.RelPermalink}}" class="color-inherit dim link">
            {{ .Title }}
site/config/_default/hugo.toml
@@ -1,5 +1,5 @@
baseURL = "http://localhost/"
languageCode = "en-us"
locale = "en-us"
title = "Ananke Documentation"
contentDir = "../docs"
enableRobotsTXT = true