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

Projects
None yet
5 participants
@mathbruyen
Contributor

mathbruyen commented May 17, 2014

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

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr May 20, 2014

Member

Awesome! This LGTM.

Member

parkr commented May 20, 2014

Awesome! This LGTM.

@parkr parkr merged commit 5aefaa1 into jekyll:master May 21, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

parkr added a commit that referenced this pull request May 21, 2014

@mathbruyen mathbruyen deleted the mathbruyen:collections_permalink branch May 21, 2014

@troyswanson

This comment has been minimized.

Show comment
Hide comment
@troyswanson

troyswanson Oct 13, 2014

Member

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

Member

troyswanson commented Oct 13, 2014

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

@davebowker

This comment has been minimized.

Show comment
Hide comment
@davebowker

davebowker Jul 18, 2015

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/

davebowker commented Jul 18, 2015

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.