{{ range (.GetPage "/docs/core-concepts").Pages }}
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }}
You hardcoded docs/core-concepts in your snippet.
I have a weight attached to docs/core concepts and docs/getting started. I will have many more “topics” for my documentation that will get added on from time to time. Ideally I don’t want to touch the hardcoded programming.
How can I programmatically get the sections under “docs” in the order based on the weight. (i.e. via an iteration)?
For each loop above, how can I get the pages in order (based on their weight)?
Read the documentation for build options, specifically the options for list.
If you use list = 'local' the page will be available to local page collections (i.e., the page collection methods on a Page object). The page will not be available to page collections on a Site object.
{{ with site.GetPage "/docs" }}
{{ range .Sections }}
<h2>{{ .Title }}</h2>
{{ range .Pages }}
<h3><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h3>
{{ end }}
{{ end }}
{{ end }}
No, and I have no idea how you reached that conclusion. Is this your first time to build a site with Hugo?
I suggest you pull changes from the repository I provided earlier, or clone it again:
git clone --single-branch -b hugo-github-issue-13185 https://github.com/jmooring/hugo-testing hugo-github-issue-13185
cd hugo-github-issue-13185
rm -rf public/ && hugo && tree public
hugo server