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

Ramiro Morales
24.31.2025 3dcd9912208fb764fd61791b06af5ee55db21580
fix(theme): center post body horizontally if there is no toc nor related blocks (#784)

1 files modified
9 ■■■■■ changed files
layouts/_default/single.html 9 ●●●●● patch | view | raw | blame | history
layouts/_default/single.html
@@ -4,9 +4,11 @@
{{ end }}
{{ define "main" }}
  {{- $related_content := .RegularPages.Related . -}}
  {{- $needs_aside := or .Params.toc $related_content -}}
  {{ $page := .}}
  {{ $section := .Site.GetPage "section" .Section }}
  <article class="flex-l mw8 center ph3 flex-wrap justify-between">
  <article class="flex-l {{ if $needs_aside }}mw8{{ else }}mw7{{ end }} center ph3 flex-wrap justify-between">
    <header class="mt4 w-100">
      <aside class="instapaper_ignoref b helvetica tracked ttu">
          {{/*
@@ -56,7 +58,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" }} w-two-thirds-l">
    <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 }}">
      {{- .Content -}}
      {{- partials.Include "tags.html" . -}}
      <div class="mt6 instapaper_ignoref">
@@ -68,10 +70,11 @@
      {{ end }}
      </div>
    </div>
    {{- if $needs_aside -}}
    <aside class="w-30-l mt6-l">
      {{- partials.Include "menu-contextual.html" . -}}
    </aside>
    {{- end -}}
  </article>
{{ end }}