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

Add auto-generated index to knowledge base #212

Merged
merged 3 commits into from
Oct 20, 2015

Conversation

Qard
Copy link
Member

@Qard Qard commented Oct 7, 2015

This a quick pass at auto-generating a list of links to the knowledge base pages supplied in #211. I might also try grouping links into sections based on the tags data. Thoughts?

@fhemberger
Copy link
Contributor

You can use collections for that:

.use(collections({
      knowledge: {
        pattern: 'knowledge/**/*.md',
        refer: false
      },

In a template you can then iterate over the collection:

{{#each collections.knowledge}}
<li><a href="/{{../../site.locale}}/{{ path }}/">{{ title }}</a></li>
{{/each}}

We already do the same for blog posts, TSC minutes, etc.

@Qard
Copy link
Member Author

Qard commented Oct 7, 2015

Oh, cool. Good to know. Sorry, I'm a bit of a noob to metalsmith.

What about the tag grouping idea? Is there collection nesting? It'd be nice to have a more automated way to group and sort the knowledge base docs.

I'll take another pass at it in the morning. 😸

@fhemberger
Copy link
Contributor

We created different sub-collections for the blog as well: https://github.com/nodejs/new.nodejs.org/blob/master/build.js#L68

I haven't checked all the new docs yet, so I can't tell you what grouping makes sense. Will try to have a first look later.

@Qard
Copy link
Member Author

Qard commented Oct 7, 2015

The knowledge base md files have both folder structure arrangements and tags. Both of which will probably change a bunch over time, so manually defining each collection like what has been done with the blog is somewhat un-ideal. I'll do some digging to see if there's a better way.

@mikeal
Copy link
Contributor

mikeal commented Oct 7, 2015

+1 this is the existing structure from the nodejitsu docs. Even if we want to alter the structure it would be less work to shift a few things around and maintain the folder structure.

@Qard
Copy link
Member Author

Qard commented Oct 7, 2015

The "knowledge base" thing overlaps with the docs wg plan of having "guides" type docs. My thought was that those would probably get merged eventually.

@mikeal
Copy link
Contributor

mikeal commented Oct 7, 2015

Ya, should probably merge the guides in at some point. Not sure if there are any format differences.

@Qard
Copy link
Member Author

Qard commented Oct 7, 2015

The docs wg has less stuff currently, so it might make the most sense to make it conform to the knowledge base format. I've opened some PRs to port the docs commits over here. The tracking issue for that is here: nodejs/docs#44

@Qard
Copy link
Member Author

Qard commented Oct 7, 2015

I tried the layout approach. Not too sure about the sidebar code duplication though.

@fhemberger fhemberger added the content Issues/pr concerning content label Oct 9, 2015
@fhemberger
Copy link
Contributor

Related to #211 (waiting for ok for copyright transfer), thus flagged as 'do not merge' for now.

@mikeal
Copy link
Contributor

mikeal commented Oct 16, 2015

actually, we can merge this because it's against the knowledge-base branch and not master.

@Qard
Copy link
Member Author

Qard commented Oct 16, 2015

Yep, if you are satisfied with it, feel free to merge. Otherwise, let me know if you want any further changes. :)

fhemberger added a commit that referenced this pull request Oct 20, 2015
Add auto-generated index to knowledge base
@fhemberger fhemberger merged commit b415dee into nodejs:knowledge-base Oct 20, 2015
@fhemberger
Copy link
Contributor

Merged into knowledge-base branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Issues/pr concerning content on hold
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants