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

Permalink pattern based on post type #61

Open
MaybeThisIsRu opened this issue Aug 8, 2020 · 3 comments
Open

Permalink pattern based on post type #61

MaybeThisIsRu opened this issue Aug 8, 2020 · 3 comments
Labels
💡 enhancement New feature or request

Comments

@MaybeThisIsRu
Copy link

So at the moment, I'm making use of Indiekit and wanted to try out Postr as it offers native syndication as well as automatic webmentions.

The URL on my static site is modelled like so for notes: /notes/:year/:month/:day/:slug

When I add other post types, I intend to change the URL scheme to something along the lines of /micro/:postType/:year/:month/:day/:slug.

For greater configurability, something like the following would be more preferable:

permalinkPattern: {
  note: '/micro/notes/:year/:month/:day/:slug',
  like: '/micro/likes/:year/:month/:day/:slug'
}

Some may prefer using notes while some may prefer using note for example. This takes care of that by letting them specify it.

Is it already possible to specify the post type to be a part of the permalink? If not, would you consider adding this feature at some point, or alternatively, accept a PR? I don't know if I'll get around to a PR at all, but would be lovely to know what your thoughts are.

@grantcodes grantcodes added the 💡 enhancement New feature or request label Aug 8, 2020
@grantcodes
Copy link
Owner

Yeah that's probably a good idea to be able to have the post type in the urls. But there is a problem that some people may want plural words, some single and some may want to translate them.

But I don't like the idea of having different patterns per post type.

I think maybe a better option would be to be able to give custom functions to the config. I can't quite remember 100% what the pattern is used for but it is definitely used to convert mf2 json to a url and to generate a database search from a url.

@grantcodes
Copy link
Owner

Also definitely happy to accept PRs!

@MaybeThisIsRu
Copy link
Author

MaybeThisIsRu commented Aug 12, 2020

A quick update: I tried Postr out recently and currently do not intend to use it. If anyone else would like to pick this up and open a PR, please feel free!

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

2 participants