Skip to content

Use a collection instead of pages for the articles#132

Merged
nayafia merged 1 commit intogh-pagesfrom
kytrinyx-collections
Sep 10, 2016
Merged

Use a collection instead of pages for the articles#132
nayafia merged 1 commit intogh-pagesfrom
kytrinyx-collections

Conversation

@kytrinyx
Copy link
Contributor

@kytrinyx kytrinyx commented Sep 10, 2016

This gets the automatic excerpts in the HTML description.

See #125 and #122

@parkr @benbalter @bkeepers Would you mind sanity checking this?

Here's what I ended up doing to get this working (please make sure I didn't miss any steps):

  • add a collection called "articles"
  • move getting-started, marketing, troubleshooting, and sustaining into a new directory called _articles/
  • within _articles/, rename getting-started/index.md to getting-started.md. Same with the other index.md files
  • update the navigation to loop through site.articles instead of site.pages
  • in the front matter, change the paths in contents and next to reference the new paths within _articles
  • rename the next variable in the front matter to following, because page.next is special
  • test: lint on the combination of pages and the collection docs, and test against following instead of next

@kytrinyx kytrinyx mentioned this pull request Sep 10, 2016
4 tasks
@kytrinyx kytrinyx force-pushed the kytrinyx-collections branch from 5dfcc35 to b1bbe99 Compare September 10, 2016 00:26
Copy link

@parkr parkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful!

collections:
articles:
output: true
permalink: /:path/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at http://jekyllrb.com/docs/permalinks/#pages-and-collections, should this be /:path/:basename/ so _articles/getting-started/setting-up-a-repo.md becomes /getting-started/setting-up-a-repo/?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now _articles/getting-started/branding.md goes to http://localhost:4000/getting-started/branding/

@kytrinyx kytrinyx force-pushed the kytrinyx-collections branch from b1bbe99 to 3cd100c Compare September 10, 2016 03:00
@nayafia nayafia merged commit a51bd1a into gh-pages Sep 10, 2016
@nayafia nayafia deleted the kytrinyx-collections branch September 10, 2016 03:03
@bkeepers
Copy link

Nice! I originally had this set up to use a collection (see #12), but changed it pretty early on.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants