I guess this is something that could be done with the new role and matrix feature. Unfortunately the docs offer no in-depth knowledge about them yet.
My plan: I have a blog with a photo gallery in each post. Now I want that “members” of the blog can see all the photos of a gallery, while “guests” can only see selected ones.
Guests should visit https://example.com to see the limited blog. Members should go to https://example.com/member/ to see the essentially the same website, but with all the photos in the blog articles. (I would then restrict access to the /member/ path via web server, e.g. by basic auth.)
Files in the example blog article:
content/blog/20260412-hikingtrip/index.md
content/blog/20260412-hikingtrip/gallery/01.jpg
content/blog/20260412-hikingtrip/gallery/02.jpg
The restricted images should be in the same path, e.g.
content/blog/20260412-hikingtrip/gallery/03.member.jpg
What I tried so far: In the hugo.yaml, I added:
roles:
guest:
weight: 10
member:
weight: 20
defaultContentRole: guest
Hugo now creates a public/member/ directory, but it contains only an almost empty home page. On the guest part of the blog the restricted images are still visible.
Is it possible to generate such a “member gallery” with Hugo and roles?
I’m testing with hugo 0.159.2.
Thank you for your help!