Template order being ignored

Hi,

My team uses Hugo and we have our project set up like this: (content removed for clarity)

├── CONTRIBUTING.md
├── Dockerfile
├── Jenkinsfile
├── Makefile
├── README.md
├── archetypes
│   └── default.md
├── codespell-ignore-words.txt
├── config.toml
├── content
│   ├── docs
│   │   ├── _index.md
│   │   ├── topic
│   │   │   ├── _index.md
│   ├── events
│   │   ├── _index.md
│   │   └── template.md
│   ├── images
│   ├── latest
│   │   ├── latest-announcement.md
│   │   └── latest-release-notes.md
│   ├── news
│   │   ├── _index.md
│   │   ├── images
│   ├── recurring-events
│   │   ├── _index.md
│   ├── search.md
│   ├── training
│   │   └── _index.md
│   └── training-selfpaced
│       ├── _index.md
├── themes
│   └── rainbow
│       ├── archetypes
│       │   └── default.md
│       ├── assets
│       │   └── css
│       │       └── styles.css
│       ├── layouts
│       │   ├── 404.html
│       │   ├── _default
│       │   │   ├── baseof.html
│       │   │   ├── list.html
│       │   │   ├── section.ics
│       │   │   ├── single.html
│       │   │   └── single.ics
│       │   ├── docs
│       │   │   ├── section.html
│       │   │   └── single.html
│       │   ├── events
│       │   │   ├── section.html
│       │   │   ├── section.ics
│       │   │   ├── single.html
│       │   │   └── single.ics
│       │   ├── index.html
│       │   ├── index.json
│       │   ├── news
│       │   │   ├── section.html
│       │   │   └── single.html
│       │   ├── partials
│       │   │   ├── add_heading_anchors.html
│       │   │   ├── calendar-icon.html
│       │   │   ├── date-breadcrumbs.html
│       │   │   ├── debug.html
│       │   │   ├── disqus.html
│       │   │   ├── docs-content.html
│       │   │   ├── docs-descendant-section.html
│       │   │   ├── docs-page-date.html
│       │   │   ├── docs-section.html
│       │   │   ├── docs-sidebar.html
│       │   │   ├── event.ics
│       │   │   ├── events-abbreviated-dates.html
│       │   │   ├── events-calendar-icon.html
│       │   │   ├── events-location.html
│       │   │   ├── events-platform-filter.html
│       │   │   ├── events-sidebar.html
│       │   │   ├── events-tags.html
│       │   │   ├── events-toc.html
│       │   │   ├── fs-breadcrumbs.html
│       │   │   ├── generic-breadcrumbs.html
│       │   │   ├── head.html
│       │   │   ├── header.html
│       │   │   ├── news-card-latest.html
│       │   │   ├── news-card.html
│       │   │   ├── news-sidebar.html
│       │   │   ├── news-toc.html
│       │   │   ├── recurring-events-full-dates.html
│       │   │   ├── replace_summary_headers.html
│       │   │   ├── search.html
│       │   │   ├── tags.html
│       │   │   ├── toc.html
│       │   │   ├── training-abbreviated-dates.html
│       │   │   ├── training-sidebar.html
│       │   │   ├── training-tags.html
│       │   │   └── training-toc.html
│       │   ├── recurring-events
│       │   │   ├── single.html
│       │   │   └── single.ics
│       │   ├── shortcodes
│       │   │   ├── asciinema.html
│       │   │   ├── figure.html
│       │   │   ├── note.html
│       │   │   ├── tip.html
│       │   │   ├── video.html
│       │   │   └── warning.html
│       │   ├── training
│       │   │   ├── section.html
│       │   │   └── single.html
│       │   └── training-selfpaced
│       │       └── single.html
│       ├── static
│       │   ├── assets
│       │   │   └── img
│       │   ├── css
│       │   │   ├── asciinema-player.css
│       │   │   ├── events.css
│       │   │   ├── highlight-tooltip.css
│       │   │   └── syntax.css
│       │   ├── images
│       │   └── js
│       └── theme.toml

We’ve noticed a pretty obscure bug – out of maybe 100 recent builds, a handful have come back using a template defined in _default rather than the right ones – and it’s been themes/rainbow/layouts/events/section.html being ignored in favour of themes/rainbow/layouts/_default/list.html.

What makes this strange for us is that there’s no warnings in the console, even with verbose mode, and there’s no indicator that anything failed. We make use of some more advanced formatting options, but nothing that should cause it to silently fail to parse our template (and I see no reason why it fails sometimes but on re-build it’s fine). Our build process uses Jenkins to build the site in docker with a recent hugo image (0.72 when the failures occurred).

Sometimes it fails to deploy correctly, but when pulled it runs fine with hugo serve, and then re-builds correctly. Has anyone had this behaviour before? Is there an easy way to debug this? Maybe to see which templates are applied to which .md files?

The templates for the /news, /training, and /events sections are very similar – so it strikes me as weird that one fails and the others work…

I’m not sure what template files / hugo files would be useful to share.

Did you experience the problem with 0.71 or earlier?

How many pages each in events, news, and training?

There are about 112 in news, 131 in events, and 4 in training. I don’t recall having the problem with 0.71 or earlier but it’s possible. We’re currently using 0.72.

Can you share the repo?

I can’t, sorry. Is there anything I can enable in hugo to help debug, or any segments in particular that would be more useful? Was there an issue in older versions that was later fixed?

Not that I know of.

Yes: /content, /layouts, /themes, and config.toml. :wink:

In all seriousness, I don’t know how to help you without looking at the templates, configuration, and at and least one example (including front matter) of each content type, even if contrived.

I don’t think so, but see the release notes.

You can search through this forum for words like “template” or “inconsistent” — perhaps you’ll find something that looks familiar. For example:

Finally, take a hard look at the difference between events and news. You have a similar quantity of each content type, so, all other things being equal, I would expect a similar number of failures. One obvious difference is the existence of .ics templates for events, but not for news, and I’m sure there are other differences as well.

1 Like

Hi,

here’s _default/list.html:

{{ if .GitInfo }}
{{ "<!--" | safeHTML }}
{{ "FINGERPRINT:" | safeHTML }}
{{ "---" | safeHTML }}
{{ "revision: " | safeHTML }}{{.GitInfo.Hash}}
{{ "build-time: " | safeHTML }}{{dateFormat "2006-01-02T15:04:05Z" now.UTC}}
{{ "-->" | safeHTML }}
{{ end }}
<!-- default/list.html -->

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Homepage</title>
</head>

<body>
    <div class="container-fluid clouds">
        {{ partial "header.html" . }}
        <div class="row">
            <div class="col-2">
                <div class="row">

                    <ul class="nav flex-column">
                        {{ range .Pages }}
                        <li>
                            <a class="nav-link active" href="{{.Permalink}}">{{.Title}}</a>
                        </li>
                        {{ end }}

                    </ul>
                </div>
            </div>
            <div class="col-10">
                <div class="jumbotron p-3 p-md-5 rounded bg-light shadow d-none" id="results">
                    <div class="col-md-12 px-0">
                        <div  class="row"></div>
                    </div>
                </div>
                <div class="row">
                    {{ if not .Lastmod.IsZero }}
                    <h6 class="pt-2">
                        <small>Last modified on {{ .Lastmod.Format "Jan 02, 2006" }}</small>
                    </h6>
                    {{ end }}
                </div>
                <div class="row">
                    <h3>
                        {{ .Title }}
                    </h3>
                </div>
                <div class="row">
                    <div class="content">
                        {{ .Content }}
                    </div>
                </div>

            </div>
        </div>

    </div>
    {{ template "_internal/google_analytics_async.html" . }}

</body>

</html>

here’s events/section.html:

{{ if .GitInfo }}
{{ "<!--" | safeHTML }}
{{ "FINGERPRINT:" | safeHTML }}
{{ "---" | safeHTML }}
{{ "revision: " | safeHTML }}{{.GitInfo.Hash}}
{{ "build-time: " | safeHTML }}{{dateFormat "2006-01-02T15:04:05Z" now.UTC}}
{{ "-->" | safeHTML }}
{{ end }}
<!DOCTYPE html>
<html>

<head>
  {{ partial "head.html" . }}
</head>

<body>
  <div class="oc-page">
    <div class="oc-page-header">
      {{ partial "header.html" . }}
    </div>

    {{ partial "events-sidebar.html" . }}

    <div class="oc-main oc-content--has-toc" id="oc-main-content">
      <div class="oc-content">
        <div body-content>
          {{ partial "search.html" . }}
          {{ partial "events-toc.html" . }}

          <section class="oc-section">
            <h1 class="oc-hero">Events</h1>

            <p>
              Welcome to the events pages. Listed below are recurring and other upcoming events and training
              opportunities.
            </p>
            <p>
              Please use the links to the left to navigate upcoming and past events.
            </p>

            <div class="oc-documentation-callout oc-documentation-callout--tip">
              <svg class="oc-icon">
                <use xlink:href="/assets/img/svg/svg-sprite.svg#icon-info"></use>
              </svg>
              <div class="oc-documentation-callout-content">
                <div class="oc-documentation-callout-title">
                  Tip
                </div>
                Synchronize events in iCalendar with a few clicks.
                <a href="{{ ref . "/docs/user-guide/calendar-sync" }}">Learn how</a>.
              </div>
            </div>
          </section>

          <section class="oc-section">
            <h2 class="oc-h2">Scheduled Events</h2>
            
            {{ partial "events-platform-filter.html" . }}
            
            <div class="oc-grid">

              <!-- non-recurring events -->
              <div class="oc-grid-item oc-grid-item--6-12">
                <div class="oc-subheader">Non-recurring Events</div>

                {{ $visible := where .Site.RegularPages ".Params.hidden" "ne" true }}
                {{ $events := where .Site.RegularPages "Section" "events" }}
                {{ $filtered := $visible | intersect $events }}
                {{ range $filtered.ByParam "timeslot.start" }}

                {{ $startTime := time .Params.timeslot.start }}
                {{ $endTime := time .Params.timeslot.end }}
                {{ $dateDifference := $endTime.Sub $startTime }}
                {{ if ge $endTime.Unix now.Unix }}

                <oc-documentation-card>
                  {{ $anchorId := (.Title | plainify | htmlUnescape | anchorize) }}
                  <div class="oc-event-card" id="{{printf "card-%s" $anchorId}}" name="card">
                    <div id="platform-tag" class="oc-event-card-content" data-tag="{{ .Params.tags }}">

                      {{ if .Params.topic_image }}
                      <div class="oc-event-card-img" alt="image relating to main topic">
                        <a href="{{.Permalink}}"><img src="/images/{{.Params.topic_image}}.png"></a>
                      </div>
                      {{ end }}

                      <div class="oc-event-card-title" id="{{$anchorId}}">
                        <a href="{{.Permalink}}">{{ .Title }}</a>
                      </div>

                      <div class="oc-event-date-elements">
                        {{ partial "events-calendar-icon.html" . }}

                        <div class=" oc-event-date oc-subheader">
                          {{ if lt $dateDifference.Hours 24 }}

                          {{ $startTime.Format "Jan 02, 2006" }}</b>
                          from {{ dateFormat "3:04 PM" $startTime }}
                          to {{ dateFormat "3:04 PM" $endTime }}<br>

                          {{ else }}

                          {{ $startTime.Format "Jan 02, 2006" }}
                          - {{ $endTime.Format "Jan 02, 2006" }}<br>

                          {{ end }}
                        </div>
                      </div>

                      <div class="oc-event-card-location">
                        {{ partial "events-location.html" .}}
                      </div>

                      <p class="oc-event-card-blurb">
                        {{ if .Params.blurb }}
                        {{ .Params.blurb }}
                        {{ end }}
                      </p>

                      <div class="oc-event-card-tags">
                        {{ partial "events-tags.html" . }}
                      </div>

                      <div class="oc-event-card-learn-more">
                        <a href="{{.Permalink}}">Learn more ... </a>
                      </div>
                    </div>
                  </div>
                </oc-documentation-card>
                {{ end }}
                {{ end }}
              </div>

              <!-- recurring events -->
              <div class="oc-grid-item oc-grid-item--6-12">
                <div class="oc-subheader">Recurring Events</div>

                {{ $visible := where .Site.RegularPages ".Params.hidden" "ne" true }}
                {{ $recurringEvents := where .Site.RegularPages "Section" "recurring-events" }}
                {{ $filtered := $visible | intersect $recurringEvents }}
                {{ range $filtered }}

                <oc-documentation-card>
                  {{ $anchorId := (.Title | plainify | htmlUnescape | anchorize) }}
                  <div class="oc-documentation-card" id="{{printf "card-%s" $anchorId}}" name="card">
                    <div id="platform-tag" class="oc-event-card-content" data-tag="{{ .Params.tags }}">

                      {{ if .Params.topic_image }}
                      <div class="oc-event-card-img" alt="image relating to main topic">
                        <a href="{{.Permalink}}"><img src="/images/{{.Params.topic_image}}.png"></a>
                      </div>
                      {{ end }}

                      <div class="oc-event-card-title" id="{{$anchorId}}">

                        <a href="{{.Permalink}}">{{ .Title }}</a>
                      </div>

                      <div class="oc-event-date-elements">
                        <div class="oc-event-date-icon">
                          <svg class="oc-icon" alt="image indicating recurring event">
                            <use xlink:href="#icon-loading"></use>
                          </svg>
                        </div>

                        {{ partial "events-calendar-icon.html" . }}

                        <div class=" oc-event-date oc-subheader">
                          {{ partial "recurring-events-full-dates.html" . }}
                        </div>
                      </div>

                      <div class="oc-event-card-location">
                        {{ partial "events-location.html" .}}
                      </div>
                      <div class="oc-event-card-tags">
                        {{ partial "events-tags.html" . }}
                      </div>
                      <p class="oc-event-card-blurb">
                        {{ if .Params.blurb }}
                        {{ .Params.blurb }}
                        {{ end }}
                      </p>
                      <div class="oc-event-card-learn-more">
                        <a href="{{.Permalink}}">Learn more ... </a>
                      </div>
                    </div>
                  </div>
                </oc-documentation-card>
                {{ end }}
              </div>

            </div>
          </section>
        </div>
      </div>
    </div>
  </div>
  </div>
</body>

</html>

here’s training/section.html

{{ $currentPage := . }}

{{ if .GitInfo }}
{{ "<!--" | safeHTML }}
{{ "FINGERPRINT:" | safeHTML }}
{{ "---" | safeHTML }}
{{ "revision: " | safeHTML }}{{.GitInfo.Hash}}
{{ "build-time: " | safeHTML }}{{dateFormat "2006-01-02T15:04:05Z" now.UTC}}
{{ "-->" | safeHTML }}
{{ end }}
<!
DOCTYPE html>
<html>

<head>
  {{ partial "head.html" . }}
</head>

<body>
  <div class="oc-page">
    <div class="oc-page-header">
      {{ partial "header.html" . }}
    </div>

    {{ partial "training-sidebar.html" . }}

    <div class="oc-main oc-content--has-toc" id="oc-main-content">
      <div class="oc-content">
        <div body-content>
          {{ partial "search.html" . }}
          {{ partial "training-toc.html" . }}

          <section class="oc-section">
            <h1 class="oc-hero">Training</h1>

            <p>Find our scheduled and self-paced training resources below.
              To request training specifically tailored to your team's needs,
              please email <a href="mailto:team@org.com">team@org.com</a>.
            </p>

            <div class="oc-documentation-callout oc-documentation-callout--tip">
              <svg class="oc-icon">
                <use xlink:href="/assets/img/svg/svg-sprite.svg#icon-info"></use>
              </svg>
              <div class="oc-documentation-callout-content">
                <div class="oc-documentation-callout-title">
                  Tip
                </div>
                Synchronize events in iCalendar with a few clicks.
                <a href="{{ ref . "/docs/user-guide/calendar-sync" }}">Learn how</a>.
              </div>
            </div>
          </section>

          <section class="oc-section">
            <h2 class="oc-h2">Upcoming and Self-Paced Training</h2>

            {{ partial "events-platform-filter.html" . }}

            <div class="oc-grid">

              <!-- scheduled training events -->
              <div class="oc-grid-item oc-grid-item--6-12">
                <div class="oc-subheader">Scheduled Training Events</div>

                {{ $visible := where .Site.RegularPages ".Params.hidden" "ne" true }}
                {{ $events := where .Site.RegularPages "Section" "events" }}
                {{ $nonTraining := where .Site.RegularPages ".Params.training" "eq" true }}
                {{ $visibleEvents := $visible | intersect $events }}
                {{ $filtered := $visibleEvents | intersect $nonTraining }}
                {{ range $index, $filtered.ByParam "timeslot.start" }}

                {{ $startTime := time .Params.timeslot.start }}
                {{ $endTime := time .Params.timeslot.end }}
                {{ $dateDifference := $endTime.Sub $startTime }}
                {{ if ge $endTime.Unix now.Unix }}

                <oc-documentation-card>
                  {{ $anchorId := (.Title | plainify | htmlUnescape | anchorize) }}
                  <div class="oc-event-card" id="{{printf "card-%s" $anchorId}}" name="card">
                    <div id="platform-tag" class="oc-event-card-content" data-tag="{{ .Params.tags }}">

                      {{ if .Params.topic_image }}
                      <div class="oc-event-card-img" alt="image relating to main topic">
                        <a href="{{.Permalink}}"><img src="/images/{{.Params.topic_image}}.png"></a>
                      </div>
                      {{ end }}

                      <div class="oc-event-card-title" id="{{$anchorId}}">
                        <a href="{{.Permalink}}">{{ .Title }}</a>
                      </div>

                      <div class="oc-event-date-elements">
                        {{ partial "events-calendar-icon.html" . }}

                        <div class=" oc-event-date oc-subheader">
                          {{ if lt $dateDifference.Hours 24 }}

                          {{ $startTime.Format "Jan 02, 2006" }}</b>
                          from {{ dateFormat "3:04 PM" $startTime }}
                          to {{ dateFormat "3:04 PM" $endTime }}<br>

                          {{ else }}

                          {{ $startTime.Format "Jan 02, 2006" }}
                          - {{ $endTime.Format "Jan 02, 2006" }}<br>

                          {{ end }}
                        </div>
                      </div>

                      <div class="oc-event-card-location">
                        {{ partial "events-location.html" .}}
                      </div>

                      <p class="oc-event-card-blurb">
                        {{ .Summary }}
                      </p>

                      <div class="oc-event-card-tags">
                        {{ partial "training-tags.html" . }}
                      </div>

                      {{ if (or .Truncated .Params.summary) }}
                      <div class="oc-event-card-learn-more">
                        <a href="{{.Permalink}}">Learn more ... </a>
                      </div>
                      {{ end }}

                    </div>
                  </div>
                </oc-documentation-card>
                {{ end }}
                {{ end }}
              </div>

              <!-- self-paced training -->
              <div class="oc-grid-item oc-grid-item--6-12">
                <div class="oc-subheader">Self-Paced Training</div>

                {{ with .Site.GetPage "/training-selfpaced/_index.md" }}
                {{ $navigation := .Params.navigation }}
                {{ range $index, $elem := $navigation }}
                {{ $path := (printf "/training-selfpaced/%s" $elem) }}
                {{ with $currentPage.Site.GetPage $path }}
                {{ if  not .Params.hidden }}
                <oc-documentation-card>
                  {{ $anchorId := (.Title | plainify | htmlUnescape | anchorize) }}
                  <div class="oc-documentation-card" id="{{printf "card-%s" $anchorId}}" name="card">
                    <div id="platform-tag" class="oc-event-card-content" data-tag="{{ .Params.tags }}">

                      {{ if .Params.topic_image }}
                      <div class="oc-event-card-img" alt="image relating to main topic">
                        <a href="{{.Permalink}}"><img src="/images/{{.Params.topic_image}}.png"></a>
                      </div>
                      {{ end }}

                      <div class="oc-event-card-title" id="{{$anchorId}}">
                        <a href="{{.Permalink}}">{{ .Title }}</a>
                      </div>

                      <h3 class="oc-subheader">
                        <oc-icon type="person"><svg class="oc-icon" alt="image indicating self-paced training">
                            <use xlink:href="#icon-person"></use>
                          </svg></oc-icon>
                        &nbsp; {{ .Params.timeslot.recurrence }}
                      </h3>

                      <p class="oc-event-card-blurb">
                        {{ .Summary }}
                      </p>

                      <div class="oc-event-card-tags">
                        {{ partial "training-tags.html" . }}
                      </div>

                      {{ if (or .Truncated .Params.summary) }}
                      <div class="oc-event-card-learn-more">
                        <a href="{{.Permalink}}">Learn more ... </a>
                      </div>
                      {{ end }}
                      
                    </div>
                  </div>
                </oc-documentation-card>
                {{ end }}
                {{ end }}
                {{ end }}
                {{ end }}
              </div>

            </div>
          </section>
        </div>
      </div>
    </div>
  </div>
  </div>
</body>

</html>

There’s a lot of partials and not all of them are relevant, and I can’t share all of them. I wonder if the problem is in these files or if it’s in the partials?

config.toml:

baseURL = "https://org.corp.com"
languageCode = "en-us"
title = "org"
theme = "rainbow"
#refLinksErrorLevel = "WARNING"

enableGitInfo = true

pygmentsUseClasses=true

googleAnalytics = ""

disqusShortname = "rainbow-1"
sectionPagesMenu = "main"

disableKinds = ["taxonomy", "taxonomyTerm"]

[outputs]
home = [ "HTML", "JSON"]
page = [ "HTML", "Calendar"]
events = [ "HTML", "Calendar"]
section = ["HTML", "Calendar"]
[outputFormats.Calendar]
	protocol = "https://"

[blackfriday]
    fractions = false

[markup]
	defaultMarkdownHandler = "blackfriday"
	[markup.blackfriday]
		plainIDAnchors = true
	[markup.highlight]
		codeFences = true
		guessSyntax = false
		hl_Lines = ""
		lineNoStart = 1
		lineNos = false
		lineNumbersInTable = true
		noClasses = true
		style = "friendly"
		tabWidth = 4

our events look like:

---
date: "2029-10-25T08:30:00-07:00"
draft: true
hidden: true
location:
  physical:
    name: HQ
    link: 
  virtual:
    name: WebEx
    link: https://corp.webex.com/meet/someone

# OPTIONAL: These values will be shown on the detailed event view, below the event title.
organizer:
  name: Corp
  link: mailto:jdoe@corp.com

slug: the-event-template
summary: This is a summary.

tags:
- optional
- onboarding

timeslot:
  start: "2029-10-25T08:30:00-07:00"
  end: "2029-10-26T16:00:00-07:00"

title: Events Template

topic_image: "aws-logo"

training: true
---
## Level-2 Header Will Appear in the TOC

Sample content.<!-- more -->This "more" is a summary divider.
It indicates the end of the page summary (displayed on training landing page). It's
optional.

### Level-3 Header Will Also Appear in the TOC

Some other content.

#### Level-4+ Headers Will NOT Appear in the TOC

Some more content.  Note that headers this size and higher are rendered as expected on the page
but won't show up in the TOC.

# Level-1 Header--Don't Use

Content with the wrong type of header.  `# Header` won't be rendered properly in your page, and
won't show up in the TOC.  It shouldn't be used and will produce a lint error.

if any partials in particular are useful I can upload them – we have about 14 that are used on those pages so it can be a big amount of stuff to sift through…

Does hugo --path-warnings print anything?

1 Like

interesting – we usually build with --buildFuture so I’ve added that:

$ hugo --path-warnings --buildFuture

                   | EN
-------------------+------
  Pages            | 558
  Paginator pages  |   0
  Non-page files   | 218
  Static files     | 111
  Processed images |   0
  Aliases          |   1
  Sitemaps         |   1
  Cleaned          |   0

WARN 2020/07/28 14:03:48 Duplicate target paths: /Users/me/code/rainbow/public/docs/my-slug/index.html (2), /Users/me/code/rainbow/public/events/index.html (2), /Users/me/code/rainbow/public/training/index.html (2)
Total in 1781 ms

Not sure where my-slug/index.html is coming from – I’ll have to check it out. Is it also possible then that training and events are clashing?

edit: my-slug is coming from our template.md (is there any way to hide this? We’ve already marked it as hidden: true and draft:true …)

You cannot expect us to guess that without seeng the full picture. Looks like my first guess was spot on, though.

Nothing concrete here, just observations:

Output Formats

[outputs]
home = [ "HTML", "JSON"]
page = [ "HTML", "Calendar"]
events = [ "HTML", "Calendar"]
section = ["HTML", "Calendar"]

The line that begins with “events” should be irrelevant and ignored per the documentation. Valid page kinds (as of version 0.73) are: page, home, section, taxonomy, and term. Nevertheless, I would delete this line and test again.

Template: baseof.html

You have a baseof.html file in layouts/_default, but based on what I’ve seen so far you don’t use it—your single and list/section templates define a complete HTML page, not just a block. If you don’t use it, I would delete it and test again.

Page Kinds

disableKinds = ["taxonomy", "taxonomyTerm"]

This should be changed when you upgrade to 0.73 or later:

disableKinds = ["taxonomy", "term"]

thanks @jmooring. Noted :slight_smile:

@bep, is it possible it’s due to our use of ICS?

events/section.ics

BEGIN:VCALENDAR
CALSCALE:GREGORIAN
METHOD:PUBLISH
VERSION:2.0
{{- $visible := where .Site.RegularPages ".Params.hidden" "ne" true -}}
{{- $events := where .Site.RegularPages "Section" "events" -}}
{{- $filtered := $visible | intersect $events -}}
{{- range $filtered.ByParam "timeslot.start" }}

{{ partial "event.ics" . }}
{{- end }}

END:VCALENDAR

event.ics:

{{- $startTime := time .Params.timeslot.start -}}
{{- $endTime := time .Params.timeslot.end -}}
BEGIN:VEVENT
DTSTAMP:{{.Date.Format "20060102T150405"}}
STATUS:CONFIRMED
UID:{{with .File}}{{.UniqueID}}{{end}}@corp.com
DTSTART:{{$startTime.UTC.Format "20060102T150405Z"}}
DTEND:{{$endTime.UTC.Format "20060102T150405Z"}}
SUMMARY:{{.Title}}
LOCATION:
	{{- if .Params.location.physical.name -}}
		{{- .Params.location.physical.name }}
	{{- end -}}
	{{- if .Params.location.virtual.name }} or {{ .Params.location.virtual.name -}}
	{{- end }}
DESCRIPTION: {{- .Permalink -}} 
	{{- if .Params.location.virtual.link }} \n    \n {{ .Params.location.virtual.link -}} \n
	{{- end }}
END:VEVENT

Hugo outputs files with the ics extension, but does it actually know that they’re ICS and so different from HTML?

I’m not sure how that explains the clash for training/index.html however…

edit: training has only the following _index.md, all of its files are stored elsewhere:

---
title: "Training"
---

events has the following _index.md:

---
hidden: true
title: Events
type: directory
---

is it possible they’re missing something?

See my coment above.

It seems like we might have a duplicate entry after all – I’m not sure why Hugo doesn’t have a more verbose mode but I’m going to be adding --path-warnings to our build process.

Based on https://github.com/gohugoio/hugo/issues/3113 it must have been happening sporadically due to multi-threading, and only happened recently as we added those sections this year.

edit: for any future archeologist – check your title fields in md files’s frontmatter to make sure there are no duplicates, same for slug and url. Since our users aren’t always aware of how hugo works, these changes got in without us realizing the impact.

edit2: I think I’m going to see if it’s even possible to add the debugging I want (maybe that’s not even a thing) and will make a PR request when I make progress. :slight_smile:

1 Like