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

Change how blog post "path" frontmatter works #50

Open
benslv opened this issue Nov 7, 2021 · 0 comments
Open

Change how blog post "path" frontmatter works #50

benslv opened this issue Nov 7, 2021 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@benslv
Copy link
Member

benslv commented Nov 7, 2021

Currently, a blog post's frontmatter looks a little bit like this:

---
path: "/blog/site-welcome"
date: "2020-04-16"
author: "Ben Silverman"
title: "Welcome to our new website!"
tags: ["post"]
---

with path telling Gatsby at what URL to put the blog post once it's been generated.

I don't really like how the /path/ is included in there, because it means people could put posts at any URL they want on the site, rather than as a sub-page of the blog. I think it should be renamed to be the "slug" of the post (i.e. a unique, kebab-case string which identifies the post and will be used in the URL.

TL;DR: Gatsby should still place all blog posts at /path/{slug} but the /path/ part should be moved to gatsby-node.js and handled at build time.

@benslv benslv added enhancement New feature or request good first issue Good for newcomers labels Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant