-
Notifications
You must be signed in to change notification settings - Fork 8.1k
hugo: move content files, use filesystem-based navigation #20761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
5f63d38 to
12e85ed
Compare
12e85ed to
33d4392
Compare
aevesdocker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, didn't spot any weird behaviour
33d4392 to
abf2889
Compare
f57dcd9 to
ab784ff
Compare
2406b05 to
09eeab9
Compare
aevesdocker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and noted the follow-up tasks 👍
506ffe1 to
2dfed11
Compare
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2dfed11 to
4e845f2
Compare
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
4e845f2 to
5c22a72
Compare
usha-mandya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR:
data/toc.yamlto a filesystem-based navigationNote
There is very little user-facing impact from this PR.
Description
The move of content files from
./content/*to./content/manuals/*without breaking permalinks is achieved using tokens in theurlfront matter key, stripping out the firstsectionof the url pathURL paths are mostly unchanged
Very few URL paths are changed on the rendered site. This change only affects where the files are placed on the filesystem in the repository, except for a few pages where I had to create sections that were previously missing.
Relative vs absolute links for the manuals section
Relative links and absolute links behave slightly differently after this change; before, relative links could be resolved more or less the same as absolute links (because the internal link to an
.mdfile would be the same as it would be to the rendered.htmlfile (relative to thecontentdirectory). Now, relative links to content in the manuals section are prefixed with/manuals, whereas absolute links to these pages point to the rendered page route, e.g. without the/manualsprefix (because that gets stripped out with the url rewrite that we cascade down from the manuals root page).I don't like this difference much. We currently allow it because we have a very flexible render hook for resolving links. But I think we might want to clean this up at some point, and only use relative paths (/manuals/path/to/file.md) for internal links, not the rendered html link.
Section pages
I have added a number of
_index.mdfiles to represent sections. Our previous site didn't have any content on the "section" level, but we had overview pages inside each section. Usually those overview pages were just the _index.md page for that section, but sometimes they weren't.In some cases, we didn't have an
_index.mdpage for a section. To handle backward compatibility with this content structure, I have added support for "empty" _index.md section pages. This means we get sections without list pages. In this case, the section still appears as an expandable entry in the sidebar, but the seciontitle is not a clickable page/link. Instead, it only lets you expand/collapse. This is achieved using _index.md "stubs" that aren't rendered to disk:Link titles
I have updated titles and added
linkTitles to several pages. Now that we do not have adata/toc.yamlfile we will populate the sidebar using page titles, and breadcrumbs. We can uselinkTitlefront matter key to assign a secondary, usually shorter title, for sidebar and breadcrumbs.Todo
Related PRs
Follow-up work
Some sections did not have sections where they should have to match the sidebar structure. To avoid having to deal with restructured files and broken links too much in this PR, this is something I think we should address in a follow-up.
There are lots of links that point to redirected pages. Again, this is something we allow for in the current, relaxed render hook. But as with the absolute/relative links issue, I think it's something we should address in a follow-up, and not allow any internal links pointing to redirected content.