Skip to content

List page doesn't render theme properly  #302

@Yuan-Meng

Description

@Yuan-Meng

I encountered a weird issue when trying to display subsection titles on a list page. Compared to single pages in this theme (which is hugo-coder), the text on the list page and its subpages (as shown in picture below) is too small and too much to the left. Another issue is that content in /content/projects/_index.md didn't render at all.

enter image description here

The only thing I did was to add a list.html file in /layouts/projects. Why did this happen and how can I render the list page more properly? Thanks!! (GitHub repo and website.)

{{ define "title" }}
  {{ .Title }} · {{ .Site.Title }}
{{ end }}

{{ define "content" }}

  {{ if (eq $.Parent.Title "Projects") }}
    <ul class="no-bullet">
      {{ range .Paginator.Pages }}
      {{ .Render "li" }}
      {{ end }}
    </ul>
    {{ partial "pagination.html" . }}

  {{ else }}
    {{ range (where .Site.Pages "Section" "projects") }}
      <ul class="no-bullet">
        {{ range .Sections }}
        <li>
            <span class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
            <a class="title" href="{{ .Params.ExternalLink | default .RelPermalink }}">{{ .Title }}</a>
        </li>
        {{ end }}
      </ul>
     {{ end }}
   {{ end }}

{{ end }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions