quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.95k stars 326 forks source link

Add support for slug #6422

Open dragonstyle opened 1 year ago

dragonstyle commented 1 year ago

Discussed in https://github.com/quarto-dev/quarto-cli/discussions/1408

Originally posted by **sciwonder** July 15, 2022 I don't know if this is a feature currently (I searched but couldn't find any info on it), but is there a way to set up preferences for permalinks to things like blog posts in `_metadata.yml` in the posts folder? In my previous blog setup (using Hugo and Wowchemy), I had the following in `config.yaml`, for example: ``` permalinks: event: '/talk/:slug/' authors: '/author/:slug/' tags: '/tag/:slug/' categories: '/category/:slug/' publication_types: '/publication-type/:slug/' post: '/post/:year/:month/:day/:slug' ``` For blog posts, this translated to a hyperlink that started off with the year, followed by month, followed by day, and then the post's slug, which was specified within the post with `slug:` in the YAML header (e.g., //blog-name.netlify.app/post/2022/07/16/slug-for-blog-post/). Others might prefer a smaller hyperlink (e.g., `'/post/:year/:slug'`) or even just the slug. I think setting this up in `_metadata.yml` might provide greater consistency. (Apologies if this feature already exists and I've just missed it in the documentation!)
cscheid commented 1 year ago

Just to clarify. I'd like this work to depend on our execution planner work (which is slated for 1.5), so that when we do add slugs, we have more confidence that we know exactly the names of the aliases, what they're referring to, and where the files might be. Slugs interact in a fragile way with things like output-file and output-dir, so we need to have a good foundation..

danilotpnta commented 1 year ago

I am also looking for an alternative for this. Thanks for raising the issue and thanks @cscheid for the amazing job with Quarto

felipecrp commented 2 months ago

This feature would be awesome for users trying to migrate a previous blog to quarto

cscheid commented 2 months ago

This feature is blocked by https://github.com/quarto-dev/quarto-cli/issues/6518, and so won't happen in the near term.