Open DingJunyao opened 10 months ago
I agree something like this would be an excellent feature to add. Maybe it would be possible to overwrite FileNode.file.slug with FileNode.file.frontmatter.slug? (or permalink)
In the meantime, would using aliases solve your current issue?
aliases solves a different issue, could be a current workaround for now. But I think there might be some merit to this. @jackyzha0 any thoughts on this?
However, I'm a bit hesitant since we already inflated the frontmatter a lot.
This unfortunately is really difficult to do in Quartz because each note is processed in parallel so other notes won't have a way to look up the frontmatter of the notes they are linking to until much later in the process. Quartz relies on being able to convert links -> href in a pure manner that doesn't rely on parsing the target note and this invalidates that assumption
I'm also hesitant to integrate this as it will require an entire link rewrite step after all the parsing
I wanted this feature, but then I realized I value the speed and the reasons that @jackyzha0 mentioned are valid. Also this was an opportunity for me to clean up or shorten by note names. I also realized urls are generated from note names but still I can use frontmatter title which can be different. This wasn't clear until now (so adding this point to the documentation could make it easier for some)
Finally, is there an easy way to generate links to files (for example from index) where the link text is actually from the frontmatter title field, but it links to the file? (other than manually typing it of course)
Is your feature request related to a problem? Please describe.
I found this and want to generate a site with it. But I found that the URLs is generated from filename, which is not good for displaying, SEO, etc. when the directories and filenames are not ASCII-only, such as
/Linux/入门/连接 Linux 服务器.md
to/Linux/%E5%85%A5%E9%97%A8/%E8%BF%9E%E6%8E%A5-Linux-%E6%9C%8D%E5%8A%A1%E5%99%A8
.Describe the solution you'd like
Add a feature that can generate URL Path from an argument (the name of it can be
permanent
abbrlink
link
or others) in frontmatter in md file.If there is an
index.md
in a directory and the frontmatter in it has the argument, the directories and files in the directory also use the argument name as the parent path.eg:
/Linux/入门/连接 Linux 服务器.md
to/linux/starter-guide/connect
if:permanent: linux
in/Linux/index.md
(Here usepermanent
as the argument name)permanent: starter-guide
in/Linux/入门/index.md
permanent: connect
in/Linux/入门/连接 Linux 服务器.md
If the argument is not set in one file, the corresponding path is still generated as current.
Grammar of wikilinks has no changes, still input filename, but only modify the link: For the example above, if set
markdownLinkResolution: "shortest"
,[[连接 Linux 服务器]]
will be linked to/linux/starter-guide/connect
if there's only one file matches the name.