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

Ensure permalinks always include the date #12

Open
carpodaster opened this issue Feb 14, 2015 · 12 comments
Open

Ensure permalinks always include the date #12

carpodaster opened this issue Feb 14, 2015 · 12 comments

Comments

@carpodaster
Copy link
Member

Many of our permalinks/slugs are not scoped by a date or even a year. We can change the permalink format easy enough, but are we ok with breaking all potential links to our site?

Unfortunately, there is no way for gh-pages to return 301 redirects.

@lislis
Copy link
Contributor

lislis commented Feb 21, 2015

So do you want /blog/2014/foobar or /blog/2014-foobar?

@carpodaster
Copy link
Member Author

I don't have a preference 😄

@lislis
Copy link
Contributor

lislis commented Feb 21, 2015

Because for the second option we can just use the custom permalink setting per page/post. Then old links would be preserved and we can start using the new permalink naming now.
But maybe just sticking to one or the other is better than trying to do both? 😕

@carpodaster
Copy link
Member Author

If there is a way that preserves old permalinks, I would definitely opt for that route.

@sareg0
Copy link
Contributor

sareg0 commented Mar 16, 2015

@lislis what's the state on this one? Is there a preferred format we should be using?

@sareg0
Copy link
Contributor

sareg0 commented Apr 27, 2015

@carpodaster @lislis is there much work to be done on this one?
Will we do all future permalinks as having a date in the URL? If we name a preferred format now, we can make sure we use it for all future blog posts, before things get ramped up on the blog for 2015.

@carpodaster
Copy link
Member Author

I'm not familiar with all the permalink options jekyll has to offer. I see the most recent blog post isn't scoped by date / year.

I think the 'cuprit' is the fully qualified path in the liquid header:

---
permalink: blog/my-awesome-article
---

I think we should just have permalink: awesome-mix-tape-vol-1 and have jekyll works its magic. Ideally we even call it slug or something.

@alicetragedy
Copy link
Member

@carpodaster I'm not sure if that's what you meant, but I just tried changing the permalink to what you said (removing blog/) locally, and clicking on the single blog post shows the url localhost:4000/my-awesome-blog-post, with no date/year.
I feel like the only way to add the year/date would be to add it manually in the permalink in the liquid header. If we remove it completely, it would probably use what's in the _config.yml file, which is currently /:title. If we change that to pretty (date and title) it would probably break the old posts :'(

@carpodaster
Copy link
Member Author

@alicetragedy I remember having read something about a default permalink scheme defined in _config.yml but I have to read up on that.

@alicetragedy
Copy link
Member

I'd love to have a final solution for this – right now, we are using dates in the permalink (specified in each post's header) directly.
Is that good enough?

@carpodaster
Copy link
Member Author

I think it's perfectly fine. The only thing that bothers me is that we have to manually edit the permalink. But unless we want to bust the permalinks of all existing blog posts that didn't include the date, I see no other way 😿

@alicetragedy
Copy link
Member

Since the upgrade to jekyll 3.0, permalinks are even more broken than they used to be (3.0 has removed the automatic trailing slash, meaning that all old links, with trailing slashes, are broken on the interwebz, see this post).
Because we never settled for a single permalink structure, we now have a problem, and I'm wondering how to best fix it. I'd like to suggest the following:

If using a permalink in a single post overrides the permalink in _config.yml, we can set up the new configuration for permalinks we want in the future and the one we've been using for 2016 (:year-:month-:day-:title) in config.yml (with trailing slash), remove the permalink: from single blog posts which already have this permalink structure, and manually add a trailing slash to each permalink in old posts (e.g. permalink: code_padawans-2014/). All new posts would NOT include the permalink in frontmatter and we'd pull it by default from the config.yml file. Using the config file for the permalinks is anyway better, as it ensures that every link from now on really has the same structure. Any thoughts?

This sounds super complicated but I don’t really see a good way to not break any more old links unless I’ve missed something super obvious...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants