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

Override collection url template #2418

Merged
merged 1 commit into from
May 21, 2014

Conversation

mathbruyen
Copy link
Contributor

Adds the permalink metadata to collections in _config.yml. See #2407 (and #2293). The option is used as URL template for documents inside the collection, as opposed to the previously hardcoded value.

I only used currently allowed placeholders (collection, basename and output_ext) but others could be easily added. I wonder whether it would make sense to allow front-matter properties there, but since it would mostly require treatment (like spaces-to-dashes) it may not be as simple as saying it.

Shortnames like pretty cannot be used.

@parkr
Copy link
Member

parkr commented May 20, 2014

Awesome! This LGTM.

@parkr parkr merged commit 5aefaa1 into jekyll:master May 21, 2014
parkr added a commit that referenced this pull request May 21, 2014
@mathbruyen mathbruyen deleted the collections_permalink branch May 21, 2014 06:48
@troyswanson
Copy link
Member

This saved my bacon just a second ago. Thanks again for this!

@davebowker
Copy link

So, my collection is for example style-guide. Currently the URL generated for this is www.site.com/style-guide -- I'd like it to be www.site.com/s

In the _config.yml I have:

collections:
  style_guide:
    output: true
    permalink: /s

Which actually generates the single HTML file, however it's unstyled. If in the _config.yml file I put:

collections:
  style_guide:
    output: true
    permalink: /s.html

This actually creates the file fully styled.

Basically, I want to be able to go to site.com/s and have everything there styled, as opposed to going to site.com/s.html

Any pointers? Is this a bug in how it works?

Thanks

SOLUTION FOUND!

I was being an idiot. It was quite simple for anyone else who would like to do similar, jsut put a forward slash after the permalink.

collections:
  style-guide:
    output: true
    permalink: /s/

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants