Why is the page I added to my "Videos" directory not appearing on the Videos tab?

By “tab”, I’m referring to the horizontal menu in the upper right. If you look through my repo, I added the post to the appropriate directory, yet although it appears as listed content on the home page, when I click the “Videos” tab, it does not show.

Repo.

(Terms defined for me by jmooring.)

As I have mentioned a couple of times in our conversations, you need to think about content modeling, and that requires an understanding of sections vs. pages.

To do what you want.

Step 1 - Change your menu configuration

- name: Videos
  pageRef: /videos
  weight: 5

Step 2 - Make the videos directory a section

mv content/v.md content/videos/_index.md

But now the “sprites” page, which is a regular page (not a section), will appear on your home page because of what you wanted to do yesterday:

{{- if .IsHome }}
  {{- $menuPages := slice }}
  {{- range site.Menus.main }}
    {{- $menuPages = $menuPages | append .Page }}
  {{- end }}
  {{- $pages = site.RegularPages | complement $menuPages }}
  {{- $pages = where $pages "Params.hiddenInHomeList" "!=" "true"  }}
{{- end }}

Model your content/structure, then code, not the other way around.

1 Like

Would it be possible to change the pageRef could be shorter/easier to type? You noticed I’ve been trying /v, instead. How could I implement this?

Not sure anyone types URLs, but…

The pageRef menu property is the path (not URL) to the file or directory, relative to the root of the content directory. If you want to change where a page is published (its URL), see:

https://gohugo.io/content-management/urls/

1 Like

Not sure anyone types URLs, but…

I almost exclusively type URLs, especially on Arkenfox, unless I’m browsing for something specific.

The pageRef menu property is the path (not URL) to the file or directory, relative to the root of the content directory. If you want to change where a page is published (its URL)

Ohhhhhh. Thanks. Will read.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.