Repository navigation
fix(tags): write tag pages into tags/ even next to a Tags.md page - #232
Merged
Merged
Conversation
On a case-insensitive file system the redirect Tags/index.html of a vocabulary page Tags.md created the output folder as Tags/, so the tag pages landed in Tags/ while all links point to tags/. mdu check-site reported these links, and a case-sensitive web server would answer 404. The tag folder now gets exactly the name tags, renaming a folder that differs only in case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
mdu check-siteon the rendered Docs reported 17 errors such asTags.html: tags/migration.html: local target does not exist with this casing.The checker was right. On a case-insensitive file system (macOS APFS, Windows), the vocabulary page
Tags.mdgets the alias redirectTags/index.html, and writing it creates the output folder asTags/. The tag pages written afterwards then landed in that folder, while every link points totags/…. On a case-sensitive web server those links would return 404. Sites built on Linux (like the published one) were not affected, because thereTags/andtags/are separate folders.Fix
WriteTagPagesnow creates the tag folder with exactly the nametags. If a folder with different casing already exists, which happens on case-insensitive disks or with leftovers from an earlier render, it is renamed through a temporary name.Checks
TagFolderKeepsItsCasingNextToTheVocabularyPageTags: renders a site withTags.mdand a leftoverTags/folder, then expectstags/and a cleancheck-site. It fails without the fix.Docson macOS: output folder istags/, andmdu check-site sitereports 0 errors on 124 pages.mdu lint(MDU003) does not have the problem:Rule3Validatorlooks up folder segments only among directories and the last segment only among files. It also checks source files, andDocshas notags/source folder.dotnet test Mdu.slnpasses.