.GetPage is literally getting your list page under/project/ the parameters you need for your table are not rendered there.
You need to think of alternative ways to render this table under /meta/.
You cannot use range on a regular page.
You were able to render the table on your index page.
So what does the above tell you?
I think that the least painless way for you to get this working would be to assign a meta taxonomy
e.g. meta= "meta" in your config.toml and assign it to the projects you need to render in this table.
So that this table will be available under /meta/
Then either create a partial with the contents of your project-card-status.html or just place its contents on the meta taxonomy template.
You should be able to get this working with a simple range function in this taxonomy template.
Of course someone else in the forum might have a different solution for your situation.
My brain gets confused whenever I read the word “taxonomy” in relation to websites :-/
(It’s like a mix of taxes and economy, which has no relation whatsoever with websites…)
This is perhaps the problem I mentioned earlier…
Do I understand correctly that if I put meta=“meta” in config.toml and then put “meta” as a tag in each project file, I will be able to access the page variables from their frontmatter in /meta/?
You cannot use range on a regular page.
You were able to render the table on your index page.
So what does the above tell you?
This tells me that the scope of .Data.Pages is only valid at toplevel layouts/index.html
And that the $ to reference the top of the tree (or root of the tree) doesn’t apply to .Data, only to .Site
Or should it be range $.Site.Data.Pages?
(that doesn’t work, though…)
LOL! No it’s nothing like that. Actually it’s a borrowed term from biology. Taxonomy - Wikipedia
Node Pages in Hugo terminology. An index.html for a section or a taxonomy.
Anyway as I said above in config.toml you assign a meta taxonomy like this: meta= "meta"
And then you copy this to the front matter of every project you need. A taxonomy can be called anything in Hugo. The taxonomy name becomes the URL slug under which the taxonomy list page is available. In this case it will be available under /meta/
The template to render this table should be located under /layouts/taxonomy/meta.html
As I said before either make a partial of project-card-status.html or just place its contents in this template (since you can only use .Render on a regular page you cannot use your table template in its existing form).
And finally enclose the above within a simple range function so that you can render your table.
Also you should remove whatever template you have for /meta/ as well as the .md under /content/
This function is only available when applied to a single piece of content within a list context.
Your mention of this error above kind of confused me.
So keep your project-card-status.html as is when you first try to render the table on your taxonomy list page. If you encounter the error then include the table template contents either in a partial or straight in the taxonomy template.
I guess the url is a bit ugly now, but I’m sure that can be fixed later by some more magic. And it’s not that important anyway, as this is mainly for the site sponsors to check who to nag about supplying more meta-data
Once again create /content/meta.md
It’s contents should be what you originally had.
Then under /layouts/completeness/single.html
Place the following
{{ partial "header-nohome.html" . }}
<div class="etalage-header">
<h1>Free and Open Source Educational Software Projects</h1>
</div>
<div class="etalage-body">
<p>
Overview of all important fields for each project. If the field has a value it is shown with an icon in the table below
</p>
</div>
<div class="hugo-blog__list mdl-grid">
<table border=1 bgcolor="#cccccc">
<tr>
<th>project</th>
<th>demosite</th>
<th>repository</th>
<th>website</th>
<th>downloadlink</th>
<th>project contact</th>
<th>author website</th>
<th>author e-mail</th>
</tr>
{{ range ($.Site.GetPage "taxonomy" "meta" "meta").Pages }}
<!-- tables lines for each project -->
{{ .Render "project-card-status" }}
{{ end }}
</table>
</div>
{{ partial "footer.html" . }}
The key to achieve this is the range function used with a nested .GetPage function to fetch the taxonomy list page from /meta/meta
{{ range ($.Site.GetPage "taxonomy" "meta" "meta").Pages }}
Now your table is accessible under /meta/
Of course you will need to fix your Hugo menu and hide the automatic link to /meta/meta/
Revert your repo to what you had at the beginning of our discussion. No meta taxonomy in your config and in your posts.
Only /content/meta.md and /layouts/completeness/single.html
In /layouts/completeness/single.html simply change the range function to this.
{{ range ($.Site.GetPage "section" "project").Pages }} {{ .Render "project-card-status" }} {{ end }}
Turns out that the previous version of .GetPage I used to fetch the project section was incorrect. And .GetPage appears to fetch front matter parameters from the posts section.
Now your table will be rendered under /meta/
Guess, we’re all learning we go! And this solution is much more terse. And I love it!