changed folder naming scheme in sidebar

This commit is contained in:
tomjohnson1492
2016-03-25 20:59:13 -07:00
parent 7f8a03d876
commit 93c21ab2c3
14 changed files with 118 additions and 96 deletions

View File

@ -1,16 +1,16 @@
entries: entries:
- title: Sidebar - title: Sidebar
subcategories: folders:
- title: Food - title: Food
items: folderitems:
- title: Bananas - title: Bananas
url: bananas.html url: bananas.html
thirdlevel: subfolder:
- title: Apples - title: Apples
thirdlevelitems: subfolderitems:
- title: Fuji apples - title: Fuji apples
url: fuji_apples.html url: fuji_apples.html
@ -30,24 +30,24 @@ bikes:
salesteams: salesteams:
- title: Regions - title: Regions
subitems: subfolderitems:
- location: US - location: US
- location: Spain - location: Spain
- location: France - location: France
toc: toc:
- title: Group 1 - title: Group 1
subitems: subfolderitems:
- page: Thing 1 - page: Thing 1
- page: Thing 2 - page: Thing 2
- page: Thing 3 - page: Thing 3
- title: Group 2 - title: Group 2
subitems: subfolderitems:
- page: Piece 1 - page: Piece 1
- page: Piece 2 - page: Piece 2
- page: Piece 3 - page: Piece 3
- title: Group 3 - title: Group 3
subitems: subfolderitems:
- page: Widget 1 - page: Widget 1
- page: Widget 2 - page: Widget 2
- page: Widget 3 - page: Widget 3

View File

@ -3,11 +3,11 @@
entries: entries:
- title: Sidebar - title: Sidebar
levels: one levels: one
subcategories: folders:
- title: Products - title: Products
output: web output: web
items: folderitems:
- title: Home - title: Home
url: / url: /
output: web output: web

View File

@ -4,12 +4,12 @@ entries:
- title: sidebar - title: sidebar
product: Jekyll Doc Theme product: Jekyll Doc Theme
version: 5.0 version: 5.0
subcategories: folders:
- title: - title:
output: pdf output: pdf
type: frontmatter type: frontmatter
items: folderitems:
- title: - title:
url: /titlepage/ url: /titlepage/
output: pdf output: pdf
@ -21,7 +21,7 @@ entries:
- title: Overview - title: Overview
output: web, pdf output: web, pdf
items: folderitems:
- title: Get started - title: Get started
url: / url: /
@ -50,7 +50,7 @@ entries:
- title: Installation - title: Installation
output: web, pdf output: web, pdf
items: folderitems:
- title: About Ruby, Gems, Bundler, etc. - title: About Ruby, Gems, Bundler, etc.
url: /mydoc_about_ruby_gems_etc/ url: /mydoc_about_ruby_gems_etc/
@ -67,7 +67,7 @@ entries:
- title: Authoring - title: Authoring
output: web, pdf output: web, pdf
items: folderitems:
- title: Pages - title: Pages
url: /mydoc_pages/ url: /mydoc_pages/
output: web, pdf output: web, pdf
@ -95,7 +95,7 @@ entries:
- title: Navigation - title: Navigation
output: web, pdf output: web, pdf
items: folderitems:
- title: Sidebar navigation - title: Sidebar navigation
url: /mydoc_sidebar_navigation/ url: /mydoc_sidebar_navigation/
output: web, pdf output: web, pdf
@ -115,7 +115,7 @@ entries:
- title: Formatting - title: Formatting
output: web, pdf output: web, pdf
items: folderitems:
- title: Tooltips - title: Tooltips
url: /mydoc_adding_tooltips/ url: /mydoc_adding_tooltips/
output: web, pdf output: web, pdf
@ -155,7 +155,7 @@ entries:
- title: Handling reviews - title: Handling reviews
output: web, pdf output: web, pdf
items: folderitems:
- title: Commenting on files - title: Commenting on files
url: /mydoc_commenting_on_files/ url: /mydoc_commenting_on_files/
output: web, pdf output: web, pdf
@ -167,7 +167,7 @@ entries:
- title: Publishing - title: Publishing
output: web, pdf output: web, pdf
items: folderitems:
- title: Build arguments - title: Build arguments
url: /mydoc_build_arguments/ url: /mydoc_build_arguments/
output: web, pdf output: web, pdf
@ -211,7 +211,7 @@ entries:
- title: Special layouts - title: Special layouts
output: web, pdf output: web, pdf
items: folderitems:
- title: Knowledge-base layout - title: Knowledge-base layout
url: /mydoc_kb_layout/ url: /mydoc_kb_layout/
output: web, pdf output: web, pdf
@ -227,7 +227,7 @@ entries:
- title: Troubleshooting - title: Troubleshooting
output: web, pdf output: web, pdf
items: folderitems:
- title: Troubleshooting - title: Troubleshooting
url: /mydoc_troubleshooting/ url: /mydoc_troubleshooting/
@ -235,16 +235,16 @@ entries:
- title: Tag archives - title: Tag archives
output: web output: web
items: folderitems:
- title: Tag archives overview - title: Tag archives overview
url: /mydoc_tag_archives_overview/ url: /mydoc_tag_archives_overview/
output: web output: web
thirdlevel: subfolders:
- title: Tag archive pages - title: Tag archive pages
output: web output: web
thirdlevelitems: subfolderitems:
- title: Formatting pages - title: Formatting pages
url: /tag_formatting/ url: /tag_formatting/

View File

@ -5,12 +5,12 @@ entries:
- title: Sidebar - title: Sidebar
product: Product1 product: Product1
version: 1.0 version: 1.0
subcategories: folders:
- title: - title:
output: pdf output: pdf
type: frontmatter type: frontmatter
items: folderitems:
- title: - title:
url: /titlepage/ url: /titlepage/
output: pdf output: pdf
@ -22,7 +22,7 @@ entries:
- title: Getting Started - title: Getting Started
output: web, pdf output: web, pdf
items: folderitems:
- title: Product 1 home - title: Product 1 home
url: /p1_landing_page/ url: /p1_landing_page/
output: web output: web
@ -42,7 +42,7 @@ entries:
- title: Another heading - title: Another heading
output: web, pdf output: web, pdf
items: folderitems:
- title: Sample 4 - title: Sample 4
url: /p1_sample4/ url: /p1_sample4/
output: web, pdf output: web, pdf

View File

@ -4,13 +4,13 @@ entries:
- title: Product2 - title: Product2
product: Product2 product: Product2
version: 1.0 version: 1.0
subcategories: folders:
- title: - title:
output: pdf output: pdf
type: frontmatter type: frontmatter
items: folderitems:
- title: - title:
url: /titlepage/ url: /titlepage/
output: pdf output: pdf
@ -22,7 +22,7 @@ entries:
- title: Getting Started - title: Getting Started
output: web, pdf output: web, pdf
items: folderitems:
- title: Product 2 home - title: Product 2 home
url: /p2_landing_page/ url: /p2_landing_page/
@ -38,7 +38,7 @@ entries:
- title: Another heading - title: Another heading
output: web, pdf output: web, pdf
items: folderitems:
- title: Sample 3 - title: Sample 3
url: /p2_sample3/ url: /p2_sample3/
@ -50,7 +50,7 @@ entries:
- title: Another heading - title: Another heading
output: web, pdf output: web, pdf
items: folderitems:
- title: Sample 5 - title: Sample 5
url: /p2_sample5/ url: /p2_sample5/

View File

@ -5,11 +5,11 @@ entries:
version: all products version: all products
levels: one levels: one
output: web output: web
subcategories: folders:
- title: News - title: News
output: web output: web
items: folderitems:
- title: News - title: News
url: /news/ url: /news/
output: web output: web
@ -18,7 +18,7 @@ entries:
output: web output: web
- title: Tags - title: Tags
output: web output: web
items: folderitems:
- title: Collaboration - title: Collaboration
url: /tag_collaboration/ url: /tag_collaboration/
output: web output: web

View File

@ -2,16 +2,16 @@
## if you want to list an external url, use external_url instead of url. the theme will apply a different link base. ## if you want to list an external url, use external_url instead of url. the theme will apply a different link base.
topnav: topnav:
- title: Topnav - title: Topnav
subcategories: items:
- title: News - title: News
url: /news/ url: /news/
#Topnav dropdowns #Topnav dropdowns
topnav_dropdowns: topnav_dropdowns:
- title: Topnav dropdowns - title: Topnav dropdowns
subcategories: folders:
- title: Jekyll Resources - title: Jekyll Resources
items: folderitems:
- title: Github Repo - title: Github Repo
external_url: https://github.com/tomjohnson1492/documentation-theme-jekyll external_url: https://github.com/tomjohnson1492/documentation-theme-jekyll
- title: Jekyll Talk - title: Jekyll Talk
@ -23,7 +23,7 @@ topnav_dropdowns:
- title: Jekyll on my blog - title: Jekyll on my blog
external_url: http://idratherbewriting.com/category-jekyll/ external_url: http://idratherbewriting.com/category-jekyll/
- title: Products - title: Products
items: folderitems:
- title: Jekyll Documentation Theme - title: Jekyll Documentation Theme
url: /mydoc_introduction/ url: /mydoc_introduction/
- title: Product 1 - title: Product 1

View File

@ -1,36 +1,40 @@
{% include custom/sidebarconfigs.html %} {% include custom/sidebarconfigs.html %}
<ul id="mysidebar" class="nav"> <ul id="mysidebar" class="nav">
<li class="sidebarTitle">{{sidebar[0].product}} {{sidebar[0].version}}</li> <li class="sidebarTitle">{{sidebar[0].product}} {{sidebar[0].version}}</li>
{% for entry in sidebar %} {% for entry in sidebar %}
{% for subcategory in entry.subcategories %} {% for folder in entry.folders %}
{% if subcategory.output contains "web" %} {% if folder.output contains "web" %}
<li> <li>
<a href="#">{{ subcategory.title }}</a> <a href="#">{{ folder.title }}</a>
<ul> <ul>
{% for item in subcategory.items %} {% for folderitem in folder.folderitems %}
{% if item.output contains "web" %} {% if folderitem.output contains "web" %}
{% if item.external_url %} {% if folderitem.external_url %}
<li><a href="{{item.external_url}}" target="_blank">{{item.title}}</a></li> <li><a href="{{item.external_url}}" target="_blank">{{folderitem.title}}</a></li>
{% elsif page.url == item.url %} {% elsif page.url == folderitem.url %}
<li class="active"><a href="{{item.url | prepend: site.baseurl}}">{{item.title}}</a></li> <li class="active"><a href="{{item.url | prepend: site.baseurl}}">{{folderitem.title}}</a></li>
{% else %} {% else %}
<li><a href="{{item.url | prepend: site.baseurl}}">{{item.title}}</a></li> <li><a href="{{folderitem.url | prepend: site.baseurl}}">{{folderitem.title}}</a></li>
{% endif %} {% endif %}
{% for thirdlevel in item.thirdlevel %} {% for subfolders in folderitem.subfolders %}
{% if thirdlevel.output contains "web" %} {% if subfolders.output contains "web" %}
<li class="thirdlevel"> <li class="subfolders">
<a href="#">{{ thirdlevel.title }}</a> <a href="#">{{ subfolders.title }}</a>
<ul> <ul>
{% for deeplevel in thirdlevel.thirdlevelitems %} {% for subfolderitem in subfolders.subfolderitems %}
{% if deeplevel.output contains "web" %} {% if subfolderitem.output contains "web" %}
{% if deeplevel.external_url %} {% if subfolderitem.external_url %}
<li><a href="{{deeplevel.external_url}}" target="_blank">{{deeplevel.title}}</a></li> <li><a href="{{subfolderitem.external_url}}" target="_blank">{{deeplevel.title}}</a></li>
{% elsif page.url == deeplevel.url %} {% elsif page.url == subfolderitem.url %}
<li class="active"><a href="{{deeplevel.url | prepend: site.baseurl}}">{{deeplevel.title}}</a></li> <li class="active"><a href="{{subfolderitem.url | prepend: site.baseurl}}">{{subfolderitem.title}}</a></li>
{% else %} {% else %}
<li><a href="{{deeplevel.url | prepend: site.baseurl}}">{{deeplevel.title}}</a></li> <li><a href="{{subfolderitem.url | prepend: site.baseurl}}">{{subfolderitem.title}}</a></li>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@ -14,30 +14,30 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<!-- entries without drop-downs appear here --> <!-- entries without drop-downs appear here -->
{% for entry in site.data.topnav.topnav %} {% for entry in site.data.topnav.topnav %}
{% for subcategory in entry.subcategories %} {% for item in entry.items %}
{% if subcategory.external_url %} {% if item.external_url %}
<li><a href="{{subcategory.external_url}}" target="_blank">{{subcategory.title}}</a></li> <li><a href="{{item.external_url}}" target="_blank">{{item.title}}</a></li>
{% elsif page.url contains subcategory.url %} {% elsif page.url contains item.url %}
<li class="active"><a href="{{subcategory.url | prepend: site.baseurl}}">{{subcategory.title}}</a></li> <li class="active"><a href="{{item.url | prepend: site.baseurl}}">{{item.title}}</a></li>
{% else %} {% else %}
<li><a href="{{subcategory.url | prepend: site.baseurl }}">{{subcategory.title}}</a></li> <li><a href="{{item.url | prepend: site.baseurl }}">{{item.title}}</a></li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
<!-- entries with drop-downs appear here --> <!-- entries with drop-downs appear here -->
<!-- conditional logic to control which topnav appears for the audience defined in the configuration file.--> <!-- conditional logic to control which topnav appears for the audience defined in the configuration file.-->
{% for entry in site.data.topnav.topnav_dropdowns %} {% for entry in site.data.topnav.topnav_dropdowns %}
{% for subcategory in entry.subcategories %} {% for folder in entry.folders %}
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ subcategory.title }}<b class="caret"></b></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ folder.title }}<b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{% for subitem in subcategory.items %} {% for folderitem in folder.folderitems %}
{% if subitem.external_url %} {% if folderitem.external_url %}
<li><a href="{{subitem.external_url}}" target="_blank">{{subitem.title}}</a></li> <li><a href="{{folderitem.external_url}}" target="_blank">{{folderitem.title}}</a></li>
{% elsif page.url contains subitem.url %} {% elsif page.url contains folderitem.url %}
<li class="dropdownActive"><a href="{{subitem.url | prepend: site.baseurl}}">{{subitem.title}}</a></li> <li class="dropdownActive"><a href="{{folderitem.url | prepend: site.baseurl}}">{{folderitem.title}}</a></li>
{% else %} {% else %}
<li><a href="{{subitem.url | prepend: site.baseurl}}">{{subitem.title}}</a></li> <li><a href="{{folderitem.url | prepend: site.baseurl}}">{{folderitem.title}}</a></li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</ul> </ul>

View File

@ -76,15 +76,37 @@ For more detail on the sidebar, see {{site.data.urls.mydoc_sidebar_navigation.li
The sidebar data file uses a specific YAML syntax that you must follow. Follow the sample pattern shown. For example: The sidebar data file uses a specific YAML syntax that you must follow. Follow the sample pattern shown. For example:
```yaml ```yaml
- title: Overview entries:
- title: sidebar
product: Jekyll Doc Theme
version: 5.0
folders:
- title: Overview
output: web, pdf output: web, pdf
items: folderitems:
- title: Get started - title: Some page
url: /mydoc_getting_started.md url: /some-doc-page/
output: web, pdf output: web, pdf
- title: Another page
url: /another-doc-page/
output: web, pdf
- title: Configuration
output: web
folderitems:
- title: How to configure the system
url: /configure-system/
output: web, pdf
subfolders:
- title: Config process
output: web, pdf
subfolderitems:
- title: Creating the config file
url: /config-file-how-to/
output: web, pdf
``` ```
Each heading must contain a title and output property. Each item must contain a title, url, and output property. Each folder or subfolder must contain a title and output property. Each folderitem or subfolderitem must contain a title, url, and output property.
The two outputs available are web and pdf. (Even if you aren't publishing PDF, you still need to specify `output: web`). The two outputs available are web and pdf. (Even if you aren't publishing PDF, you still need to specify `output: web`).
@ -96,7 +118,7 @@ To accommodate the title page and table of contents in PDF outputs, each product
- title: - title:
output: pdf output: pdf
type: frontmatter type: frontmatter
items: folderitems:
- title: - title:
url: /titlepage/ url: /titlepage/
output: pdf output: pdf

View File

@ -1,5 +1,5 @@
--- ---
title: About Ruby, Gems, Bundler, and other Prerequisites title: About Ruby, Gems, Bundler, and other prerequisites
tags: [getting_started, troubleshooting] tags: [getting_started, troubleshooting]
keywords: keywords:
summary: "Ruby is a programming language you must have on your computer in order to build Jekyll locally. Ruby has various gems (or plugins) that provide various functionality. Each Jekyll project usually requires certain gems." summary: "Ruby is a programming language you must have on your computer in order to build Jekyll locally. Ruby has various gems (or plugins) that provide various functionality. Each Jekyll project usually requires certain gems."

View File

@ -76,7 +76,7 @@ These pages should appear in your sidebar YML file (in this product, mydoc_sideb
- title: - title:
output: pdf output: pdf
type: frontmatter type: frontmatter
items: folderitems:
- title: - title:
url: /titlepage/ url: /titlepage/
output: pdf output: pdf

View File

@ -44,9 +44,8 @@ For example, the sidebar.html file contains the following code:
{% raw %} {% raw %}
```liquid ```liquid
{% if item.external_url %} {% if subfolderitem.external_url %}
<li><a href="{{item.external_url}}" target="_blank">{{subcategory.title}}</a></li> <li><a href="{{subfolderitem.external_url}}" target="_blank">{{deeplevel.title}}</a></li>
{% elsif page.url == item.url %}
``` ```
{% endraw %} {% endraw %}
@ -60,15 +59,12 @@ For example, the sidebar.html file contains the following code:
{% raw %} {% raw %}
```liquid ```liquid
{% elsif page.url == item.url %} {% elsif page.url == subfolderitem.url %}
<li class="active"><a href="{{item.url | prepend: ".."}}">{{item.title}}</a></li> <li class="active"><a href="{{subfolderitem.url | prepend: site.baseurl}}">{{subfolderitem.title}}</a></li>
{% else %}
<li><a href="{{item.url | prepend: ".."}}">{{item.title}}</a></li>
{% endif %}
``` ```
{% endraw %} {% endraw %}
If the `page.url` matches the `item.url`, then an `active` class gets applied. If not, the `active` class does not get applied. If the `page.url` matches the `subfolderitem.url`, then an `active` class gets applied. If not, the `active` class does not get applied.
The `page.url` in Jekyll is a site-wide variable. If you insert {% raw %}`{{page.url}}`{% endraw %} on a page, it will render as follows: {{page.url}}. The `url` attribute in the sidebar item must match the page URL in order to get the `active` class applied. The `page.url` in Jekyll is a site-wide variable. If you insert {% raw %}`{{page.url}}`{% endraw %} on a page, it will render as follows: {{page.url}}. The `url` attribute in the sidebar item must match the page URL in order to get the `active` class applied.

View File

@ -142,7 +142,7 @@ Here we use a "for" loop to get each item in the bikes list. By using `.title` w
```yaml ```yaml
salesteams: salesteams:
- title: Regions - title: Regions
subitems: subfolderitems:
- location: US - location: US
- location: Spain - location: Spain
- location: France - location: France
@ -184,17 +184,17 @@ Each list item starts with the hyphen ``. You cannot directly access the lis
```yaml ```yaml
toc: toc:
- title: Group 1 - title: Group 1
subitems: subfolderitems:
- page: Thing 1 - page: Thing 1
- page: Thing 2 - page: Thing 2
- page: Thing 3 - page: Thing 3
- title: Group 2 - title: Group 2
subitems: subfolderitems:
- page: Piece 1 - page: Piece 1
- page: Piece 2 - page: Piece 2
- page: Piece 3 - page: Piece 3
- title: Group 3 - title: Group 3
subitems: subfolderitems:
- page: Widget 1 - page: Widget 1
- page: Widget 2 it's - page: Widget 2 it's
- page: Widget 3 - page: Widget 3