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 sidebar nav instructions to documentation #476

Closed
bquast opened this Issue Aug 24, 2016 · 8 comments

Comments

Projects
None yet
2 participants
@bquast

bquast commented Aug 24, 2016

  • This is a question about using the theme.
  • I believe this to be a bug with the theme --- not Jekyll, GitHub Pages or one of the bundled plugins.
  • This is a feature request.
  • I have updated all gems with bundle update.
  • I have tested locally with bundle exec jekyll build.

Environment informations

  • Minimal Mistakes version: 3.4.3
  • github-pages

Expected behavior

@mmistakes

This comment has been minimized.

Show comment
Hide comment
@mmistakes

mmistakes Aug 24, 2016

Owner

Currently undocumented because I built it as a "one off" for the theme's documentation section. Wasn't really meant to be something as part of the theme as it's not the most straight forward thing to do.

It involves manually listing out all of the links in a _data file and then referencing that set of navigation links with sidebar.nav.Name in the YAML Front Matter of whatever post/page/collection you want it to appear on.

For example, the menu for the theme's documentation was built by:

_data/navigation.yml

# documentation links
docs:
  - title: Getting Started
    children:
      - title: "Quick-Start Guide"
        url: /docs/quick-start-guide/
      - title: "Structure"
        url: /docs/structure/
      - title: "Installation"
        url: /docs/installation/
      - title: "Upgrading"
        url: /docs/upgrading/

  - title: Customization
    children:
      - title: "Configuration"
        url: /docs/configuration/
      - title: "Navigation"
        url: /docs/navigation/
      - title: "UI Text"
        url: /docs/ui-text/
      - title: "Authors"
        url: /docs/authors/
      - title: "Layouts"
        url: /docs/layouts/

  - title: Content
    children:
      - title: "Working with Posts"
        url: /docs/posts/
      - title: "Working with Pages"
        url: /docs/pages/
      - title: "Working with Collections"
        url: /docs/collections/
      - title: "Helpers"
        url: /docs/helpers/
      - title: "Utility Classes"
        url: /docs/utility-classes/

  - title: Extras
    children:
      - title: "Stylesheets"
        url: /docs/stylesheets/
      - title: "JavaScript"
        url: /docs/javascript/

  - title: Meta
    children:
      - title: "History"
        url: /docs/history/
      - title: "Contributing"
        url: /docs/contributing/
      - title: "Old 2.2 Docs"
        url: /docs/docs-2-2/
      - title: "License"
        url: /docs/license/
      - title: "Terms & Privacy Policy"
        url: /terms/

And then in each _doc collection page the following was added to the YAML Front Matter to pull in the navigation in the sidebar.

sidebar:
  nav: "docs"

The better solution for adding the same YAML to multiple pages is with Front Matter Defaults in _config.yml like so:

defaults:
  # _docs
  - scope:
      path: ""
      type: docs
    values:
      sidebar:
        nav: "docs"
Owner

mmistakes commented Aug 24, 2016

Currently undocumented because I built it as a "one off" for the theme's documentation section. Wasn't really meant to be something as part of the theme as it's not the most straight forward thing to do.

It involves manually listing out all of the links in a _data file and then referencing that set of navigation links with sidebar.nav.Name in the YAML Front Matter of whatever post/page/collection you want it to appear on.

For example, the menu for the theme's documentation was built by:

_data/navigation.yml

# documentation links
docs:
  - title: Getting Started
    children:
      - title: "Quick-Start Guide"
        url: /docs/quick-start-guide/
      - title: "Structure"
        url: /docs/structure/
      - title: "Installation"
        url: /docs/installation/
      - title: "Upgrading"
        url: /docs/upgrading/

  - title: Customization
    children:
      - title: "Configuration"
        url: /docs/configuration/
      - title: "Navigation"
        url: /docs/navigation/
      - title: "UI Text"
        url: /docs/ui-text/
      - title: "Authors"
        url: /docs/authors/
      - title: "Layouts"
        url: /docs/layouts/

  - title: Content
    children:
      - title: "Working with Posts"
        url: /docs/posts/
      - title: "Working with Pages"
        url: /docs/pages/
      - title: "Working with Collections"
        url: /docs/collections/
      - title: "Helpers"
        url: /docs/helpers/
      - title: "Utility Classes"
        url: /docs/utility-classes/

  - title: Extras
    children:
      - title: "Stylesheets"
        url: /docs/stylesheets/
      - title: "JavaScript"
        url: /docs/javascript/

  - title: Meta
    children:
      - title: "History"
        url: /docs/history/
      - title: "Contributing"
        url: /docs/contributing/
      - title: "Old 2.2 Docs"
        url: /docs/docs-2-2/
      - title: "License"
        url: /docs/license/
      - title: "Terms & Privacy Policy"
        url: /terms/

And then in each _doc collection page the following was added to the YAML Front Matter to pull in the navigation in the sidebar.

sidebar:
  nav: "docs"

The better solution for adding the same YAML to multiple pages is with Front Matter Defaults in _config.yml like so:

defaults:
  # _docs
  - scope:
      path: ""
      type: docs
    values:
      sidebar:
        nav: "docs"
@bquast

This comment has been minimized.

Show comment
Hide comment
@bquast

bquast Aug 24, 2016

Thanks a lot. I had figured out the part about _config.yml but for some reason I didn't think to look at navigation.yml, which of course is a logical place.

I am making a minisite to accompany my recurrent neural network package which means adding a lot of documentation so this is perfect.

http://qua.st/rnn/docs/quick-start-guide/

bquast commented Aug 24, 2016

Thanks a lot. I had figured out the part about _config.yml but for some reason I didn't think to look at navigation.yml, which of course is a logical place.

I am making a minisite to accompany my recurrent neural network package which means adding a lot of documentation so this is perfect.

http://qua.st/rnn/docs/quick-start-guide/

@mmistakes mmistakes closed this in 608fa99 Aug 31, 2016

@mmistakes

This comment has been minimized.

Show comment
Hide comment
@bquast

This comment has been minimized.

Show comment
Hide comment
@bquast

bquast Aug 31, 2016

very cool, thanks a lot!

bquast commented Aug 31, 2016

very cool, thanks a lot!

@bquast

This comment has been minimized.

Show comment
Hide comment
@bquast

bquast Sep 20, 2016

I just went through the documentation, I believe the step about making a collection is missing.

bquast commented Sep 20, 2016

I just went through the documentation, I believe the step about making a collection is missing.

@mmistakes

This comment has been minimized.

Show comment
Hide comment
@mmistakes

mmistakes Sep 20, 2016

Owner

@bquast Didn't include that as collection creation is a basic of using Jekyll that can be learned about from the official docs.

Owner

mmistakes commented Sep 20, 2016

@bquast Didn't include that as collection creation is a basic of using Jekyll that can be learned about from the official docs.

@bquast

This comment has been minimized.

Show comment
Hide comment
@bquast

bquast Sep 20, 2016

Ok I agree. I guess I meant to say that people might not realise that the files need to a collection for the sidebar nav to work, maybe in a note or something. Or perhaps this is obvious to people who use jekyll more frequently than I do.

bquast commented Sep 20, 2016

Ok I agree. I guess I meant to say that people might not realise that the files need to a collection for the sidebar nav to work, maybe in a note or something. Or perhaps this is obvious to people who use jekyll more frequently than I do.

@mmistakes

This comment has been minimized.

Show comment
Hide comment
@mmistakes

mmistakes Sep 20, 2016

Owner

Sidebar nav should work with posts and pages, not just collections.

Owner

mmistakes commented Sep 20, 2016

Sidebar nav should work with posts and pages, not just collections.

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