Having issues with displaying markdown content when loading partials in a template

I’m reasonable new at hugo currently trying to display content from individual members, i’ve figured out how to make it so it reconizes when the certain person has the pages so it can use them. BUT the markdown content inside of these pages is not being loaded so. I believe the issue is somewhere in passing the right variable from my staff.html to my partials but I’m having a very hard time figuring this out

The layout field in front matter is not related to partial templates.

should i just use “staff” as layout instead in al of those .md files then?

I have no idea what “all those” markdown files are for. Sorry, but I’m a bit lost.

oh sorry each member has .md files in their folders so members/jdoe/present.md fundedn.md etc… all of the members will have these same pages but they ofcourse need to be displayed in the correct place. Currently the markdown is just not being displayed so i’m clearly doing something wrong there

Your published site with all but one author removed
├── Img/
│   ├── 2931180_about_info_information_chat_service_icon.png
│   ├── 309041_users_group_people_icon.png
│   ├── 3669372_contact_ic_mail_icon.png
│   ├── 5740092_call_communication_connection_contact_phone_icon.png
│   ├── 8103310_office_search_business_technology_research_icon.png
│   ├── 8666585_archive_icon.png
│   ├── 8666693_search_icon.png
│   ├── blank-profile-picture-973460_960_720.png
│   ├── joseC.jpg
│   ├── placeholder.jpg
│   └── single.png
├── about/
│   └── index.html
├── bob/
│   └── index.html
├── contact/
│   └── index.html
├── css/
│   └── banerstyle.css
├── js/
│   └── vanilla-back-to-top.min.js
├── members/
│   ├── bobsmth/
│   │   ├── funded/
│   │   │   └── index.html
│   │   ├── further/
│   │   │   └── index.html
│   │   ├── main/
│   │   │   └── index.html
│   │   ├── present/
│   │   │   └── index.html
│   │   ├── publications/
│   │   │   └── index.html
│   │   ├── supervision/
│   │   │   └── index.html
│   │   └── thesis/
│   │       └── index.html
│   ├── members/
│   │   └── index.html
│   └── index.html
├── research/
│   ├── research/
│   │   └── index.html
│   └── index.html
├── favicon.ico
└── index.html

What’s missing from the above?

Uh i have no idea, why its removing al the members but one. Alot of files are missing

No. I removed the other authors so that we can look at a smaller site tree.

My question is, under the remaining author, what is missing? Are the subpages where you expect them to be?

I believe so unless i’m using hugo wrong again, but the index pages for each map like /funded etc aren’t showing the markdown content as I believe they should

In the image above, do you want the markdown in content/members/bobsmth/present.md to appear within the “Present activities” box, or should the “Present activities” box be a link to a “Present activies” page?

The markdown should appear in these boxes, When i did this initialy with 1 person It worked but then i realised i had to dynamicly change the urls and thats when it started not showing the markdown in the boxes anyore

Should there also be a “Present activities” page?

I don’t think so unless these are the so called headless pages, i thought i could just display the markdown with partials and call the partials in my “staff.html” file and that would do the trick

OK, I understand the intent, but your approach is… unexpected. Give me a few minutes to put together a minimal example. The idiomatic approach is much simpler.

git clone --single-branch -b hugo-forum-topic-49270 https://github.com/jmooring/hugo-testing hugo-forum-topic-49270
cd hugo-forum-topic-49270
hugo server

The above is very simple. Each member is a leaf bundle, not a branch bundle. Each member is rendered with layouts/members/single.html. There are no partials, no calls to os.FileExists, etc.

The published site looks like:

├── members/
│   ├── member-1/
│   │   └── index.html
│   ├── member-2/
│   │   └── index.html
│   └── index.html
├── favicon.ico
└── index.html

yeap alright, this looks 100x easier than i was trying to do. Tyvm

1 Like

As a follow-on, it is cleaner to place the member’s photograph in the leaf bundle. For example:

├── funded.md
├── further.md
├── index.md
├── main.md
├── photo.jpg  <-- the member's photograph
├── present.md
├── publications.md
├── supervision.md
└── thesis.md

That way everything about the member is encapsulated in one place. Then add this to layouts/members/single.html:

{{ with .Resources.GetMatch "photo*" }}
  {{ with .Fill "150x150" }}
    <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
  {{ end }}
{{ end }}

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