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

Support slug field in Markdown front matter #22

Closed
3 tasks done
Tracked by #21
oliver-pham opened this issue Oct 27, 2021 · 1 comment
Closed
3 tasks done
Tracked by #21

Support slug field in Markdown front matter #22

oliver-pham opened this issue Oct 27, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@oliver-pham
Copy link
Owner

oliver-pham commented Oct 27, 2021

Requirements

  • The folder structure of the generated HTML file should follow slug in the front matter
  • slug is set to the file name by default
  • Validate slug to make sure it is unique

Examples

If the content of example-lyrics.md is:

---
slug: lyrics/rickroll-1
---

We're no strangers to love
You know the rules and so do I

The following file structure should be produced:

dist
│
└─── lyrics
     |                
     └───rickroll-1.html

If the "lyrics/rickroll-1" is already used as a slug by another document, Silkie should display an error message:

warn: Duplicate routes found!
/rickroll-1 is already taken by another document
@oliver-pham oliver-pham changed the title id: a unique document id, default to its file path Support id field in when parsing Markdown front matter Oct 27, 2021
@oliver-pham oliver-pham changed the title Support id field in when parsing Markdown front matter Support slug field in when parsing Markdown front matter Oct 27, 2021
@oliver-pham oliver-pham changed the title Support slug field in when parsing Markdown front matter Support slug field in Markdown front matter Oct 27, 2021
@oliver-pham oliver-pham added the enhancement New feature or request label Oct 27, 2021
@oliver-pham
Copy link
Owner Author

Resolved by b37f663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant