theNewDynamic / gohugo-theme-ananke

Ananke: A theme for Hugo Sites
https://gohugo-ananke-theme-demo.netlify.com/
MIT License
1.09k stars 1.12k forks source link

Unnecessary vertical space below posts if commends are disabled #662

Open mikaelstaldal opened 8 months ago

mikaelstaldal commented 8 months ago

In layouts/_default/single.html, there is a div for comments, which creates unnecessary (and IMHO annoying) vertical space if comments are disabled:

      <div class="mt6 instapaper_ignoref">
      {{ if .Site.DisqusShortname }}
        {{ template "_internal/disqus.html" . }}
      {{ end }}
      {{ if .Site.Params.commentoEnable }}
        {{- partial "commento.html" . -}}
      {{ end }}
      </div>

https://github.com/theNewDynamic/gohugo-theme-ananke/blob/master/layouts/_default/single.html#L53

I suggest that this div is only included if any comment system is enabled. Something like this:

      {{ if .Site.DisqusShortname }}
        <div class="mt6 instapaper_ignoref">
          {{ template "_internal/disqus.html" . }}
        </div>
      {{ end }}
      {{ if .Site.Params.commentoEnable }}
        <div class="mt6 instapaper_ignoref">
          {{- partial "commento.html" . -}}
        </div>
      {{ end }}