mirror of https://github.com/lxndrblz/anatole.git

google-labs-jules[bot]
23 hours ago 95062b90538c4d3616f0acbcb27991490dc52f44
Refactor deprecated isset usage for Hugo Params

Hugo recommends directly accessing params with `if .Site.Params.param_name`. Using `isset` is discouraged.
This updates listdateformat, singledateformat, and indexdateformat usages to be accessed directly.

Co-authored-by: KarelZe <12801659+KarelZe@users.noreply.github.com>
3 files modified
6 ■■■■■ changed files
layouts/_default/list.html 2 ●●●●● patch | view | raw | blame | history
layouts/_default/single.html 2 ●●●●● patch | view | raw | blame | history
layouts/index.html 2 ●●●●● patch | view | raw | blame | history
layouts/_default/list.html
@@ -17,7 +17,7 @@
              <a class="archive__list-title" href="{{ .RelPermalink }}" title="{{ .Title }}">{{ upper .Title }}</a>
            {{ end }}
            <div class="archive__list-date">
              {{ if isset .Site.Params "listdateformat" }}
              {{ if .Site.Params.listDateFormat }}
                {{ if .Site.Params.localizedDates }}
                  {{ time.Format .Site.Params.listDateFormat .Date }}
                {{ else }}
layouts/_default/single.html
@@ -22,7 +22,7 @@
          <li class="post__meta-item">
            <em class="fas fa-calendar-day post__meta-icon"></em>
            <span class="post__meta-text"
              >{{ if isset .Site.Params "singledateformat" }}
              >{{ if .Site.Params.singleDateFormat }}
                {{ if .Site.Params.localizedDates }}
                  {{ time.Format .Site.Params.singleDateFormat .Date }}
                {{ else }}
layouts/index.html
@@ -69,7 +69,7 @@
      <div class="post__footer">
        <em class="fas fa-calendar-day"></em>
        <span class="post__footer-date"
          >{{ if isset .Site.Params "indexdateformat" }}
          >{{ if .Site.Params.indexDateFormat }}
            {{ if .Site.Params.localizedDates }}
              {{ time.Format .Site.Params.indexDateFormat .Date }}
            {{ else }}