jackyzha0 / quartz

🌱 a fast, batteries-included static-site generator that transforms Markdown content into fully functional websites
https://quartz.jzhao.xyz
MIT License
7.11k stars 2.5k forks source link

Ability to specify permalinks (URLs of the notes) #41

Closed yatharth closed 2 years ago

yatharth commented 2 years ago

Problem

When I change the title of a note, the link changes. This makes any URL links to them from outside the garden break.

Proposed solution

Optional permalink: .... field in YAML front-matter, that means the note URL stays the same, despite the title or original filename changing.

Why this matters

I feel wary of linking to my digital garden from anywhere. The links can easily break. Not conducive to a healthy garden!

Workarounds

I could just rename the file to be what I want. This doesn’t work for two reasons.

Firstly, I use Quartz with my Obsidian, like many people do. I don’t want to compromise my Obsidian filenames for this reason. The URLs I want to be quite short and compact.

Second, I might easily consider renaming the files in Obsidian, as this is a first-class move there, and end up breaking all links on the web to the garden. Having a dedicated “permalink” field that makes clear it should not change and is separate from other concerns seems like the best solution.

jackyzha0 commented 2 years ago

I haven't experimented with this but I do believe https://gohugo.io/content-management/urls/#yaml-front-matter might be able to help here?

yatharth commented 2 years ago

Haven't tested it, but I think slug: ... in the front-matter already does what I'm asking for: https://gohugo.io/content-management/front-matter/#predefined

On Sat, Jan 15, 2022, 11:52 PM Jacky Zhao @.***> wrote:

I haven't experimented with this but I do believe https://gohugo.io/content-management/urls/#yaml-front-matter might be able to help here?

— Reply to this email directly, view it on GitHub https://github.com/jackyzha0/quartz/issues/41#issuecomment-1013752371, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALTILCJNLK5LFS62UWQBITUWHNB3ANCNFSM5MBMWPEQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

jackyzha0 commented 2 years ago

Ah perfect! Let me know if that ends up working. Closing for now but feel free to reopen if you run into any more issues