Skip to content
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

Use title in blog post URLs again #121

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Use title in blog post URLs again #121

wants to merge 3 commits into from

Conversation

k-nut
Copy link
Member

@k-nut k-nut commented Nov 18, 2024

It seems that with the unpinning of the hugo version in 2732566 and the updating of the dates in 627e1dd, something in hugo changed with regards to how it generates slugs.

The hugo documentation says regarding slugs:

The slug as defined in front matter, else the title as defined in front matter, else the automatic title. Hugo generates titles automatically for section, taxonomy, and term pages that are not backed by a file.

It seems like something in our setup made it not take into account the title from the frontmatter anymore though. I have hence changed the configuration to explicitly use the title instead. This now causes problems because hugo doesn't escape hashes and creates filenames which won't render to valid URLs (see this issue) So I had add some url fields manually to force escaped URLs for blog posts hat have hashes in their titles.

All in all, this should hopefully restore the old structure that everything was rendered in before the upgrade.

Copy link

netlify bot commented Nov 18, 2024

Deploy Preview for silver-smakager-d8f15e ready!

Name Link
🔨 Latest commit 58fbd73
🔍 Latest deploy log https://app.netlify.com/sites/silver-smakager-d8f15e/deploys/673b1dcaf7b09c000828c617
😎 Deploy Preview https://deploy-preview-121--silver-smakager-d8f15e.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

The hashes don't seem to get escaped anymore when used
as part of `:title` in a slug configuration. Since there
aren't that many pages that are affected, we set the
URL manually for those.
Should no longer be necessary with the new setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant