Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary vertical space on index page if there is no content #663

Open
mikaelstaldal opened this issue Oct 29, 2023 · 0 comments
Open
Milestone

Comments

@mikaelstaldal
Copy link

mikaelstaldal commented Oct 29, 2023

In layouts/index.html, there is a article element for content, which creates unnecessary (and IMHO annoying) vertical space if there is no content to display:

    <article class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}">
      {{ .Content }}
    </article>

https://github.com/theNewDynamic/gohugo-theme-ananke/blob/master/layouts/index.html#L2

I suggest that this article element is only included if there is content to display. Something like this:

  {{ if .Content }}
    <article class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}">
      {{ .Content }}
    </article>
  {{ end }}
@davidsneighbour davidsneighbour added this to the unplanned milestone Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants