Made sidebar configurable based on product, platform, version properties in configuration file. Also added ability to add series that link together pages.

This commit is contained in:
Tom Johnson
2015-05-17 19:01:41 -07:00
parent 4945f23b2d
commit 6d98971517
40 changed files with 808 additions and 519 deletions

View File

@ -0,0 +1,19 @@
<div class="seriesContext">
<div class="btn-group">
<button type="button" data-toggle="dropdown" class="btn btn-primary dropdown-toggle">Acme Process <span class="caret"></span></button>
<ol class="dropdown-menu">
{% assign pages = site.pages | sort:"weight" %}
{% for p in pages %}
{% if p.series == "acme_series" %}
{% if p.url == page.url %}
<li class="active"> → {{p.weight}}. {{p.title}}</li>
{% else %}
<li>
<a href="{{p.url | prepend: site.baseurl | append: site.suffix}}">{{p.weight}}. {{p.title}}</a>
</li>
{% endif %}
{% endif %}
{% endfor %}
</ol>
</div>
</div>

View File

@ -1,15 +1,19 @@
{% if site.audience == "writer" %}
{% assign buildAudience = "writer" %}
{% assign sidebar = site.data.sidebar.entries %}
{% assign topnav = site.data.topnav.topnav %}
{% assign topnav_dropdowns = site.data.topnav.topnav_dropdowns %}
{% assign fileName = "writer_guide" %}
{% elsif site.audience == "designer" %}
{% assign buildAudience = "designer" %}
{% assign sidebar = site.data.sidebar.entries %}
{% assign topnav = site.data.topnav.topnav %}
{% assign topnav_dropdowns = site.data.topnav.topnav_dropdowns %}
{% assign fileName = "designer_guide" %}
{% if site.project == "documentation-theme-jekyll-writer" %}
{% assign audience = "writer" %}
{% assign sidebar = site.data.sidebar.entries %}
{% assign topnav = site.data.topnav.topnav %}
{% assign topnav_dropdowns = site.data.topnav.topnav_dropdowns %}
{% assign version = "all" %}
{% assign product = "all" %}
{% assign platform = "all" %}
{% endif %}
{% if site.project == "documentation-theme-jekyll-designer" %}
{% assign audience = "designer" %}
{% assign sidebar = site.data.sidebar.entries %}
{% assign topnav = site.data.topnav.topnav %}
{% assign topnav_dropdowns = site.data.topnav.topnav_dropdowns %}
{% assign version = "all" %}
{% assign product = "all" %}
{% assign platform = "all" %}
{% endif %}

View File

@ -0,0 +1,33 @@
{% include linkrefs.html %}
This is a Jekyll theme intended for documentation projects. What makes this theme unique is the approach in using Jekyll for single sourcing, that is, producing multiple outputs from the same theme. For example, you might have 3 different help systems that you're generating from the same Jekyll files. More than anything, this Jekyll theme shows you how to use Jekyll for documentation projects from the perspective of a technical writer.
Note that I'm using this theme for my own technical writing projects, so this is an evolving project.
## Intended audience
Although this theme could be used for any website, I'm assuming that my main audience involves technical writers. Very few technical writers are even aware of Jekyll as a platform, let alone how to use it for tech comm scenarios. The instructions for this theme, therefore, are extensive because they discuss a lot of Jekyll basics as well. I'm not going to assume that you're already familiar with Jekyll, or that you're a UX guru, or that you know how to do backflips in Liquid. I'll try to hold your hand as much as possible.
## Supported features
As far as I can tell, Jekyll supports most of the features a technical writer needs to author and publish content. Most importantly, using Jekyll allows you to take full advantage of a modern web development platform.
As a quick overview, this theme specifically provides the following:
* Bootstrap framework with responsive design
* Integrated search
* Navigation sidebar and top navigation
* Font Awesome
* Options for creating multiple builds for different audiences
See {{supported_features}} for an extensive list.
## Getting started
To get started, see {{getting_started}}. It explains how to create a new project.
## Questions
Feel free to ask me a question if there's something I haven't addressed here.
Tom Johnson <br /><a href="mailto:">tomjohnson1492@gmail.com</a>

View File

@ -47,3 +47,14 @@
{% capture navigation %}<a href="{{"/navigation" | prepend: site.baseurl}}">Creating navigation</a>{% endcapture %}
{% capture tags %}<a href="{{"/tags" | prepend: site.baseurl}}">Creating tags</a>{% endcapture %}
{% comment %} <!-- SPECIAL LAYOUTS --> {% endcomment %}
{% capture special_layouts %}<a href="{{"/special_layouts" | prepend: site.baseurl}}">Special layouts</a>{% endcapture %}
{% capture series %}<a href="{{"/series" | prepend: site.baseurl}}">Series widget</a>{% endcapture %}
{% capture shuffle %}<a href="{{"/shuffle" | prepend: site.baseurl}}">Shuffle layout</a>{% endcapture %}
{% capture scroll %}<a href="{{"/scroll" | prepend: site.baseurl}}">Scroll layout</a>{% endcapture %}
{% capture kb-layout %}<a href="{{"/kb-layout" | prepend: site.baseurl}}">Knowledgebase layout</a>{% endcapture %}
{% capture faq %}<a href="{{"/faq" | prepend: site.baseurl}}">FAQ layout</a>{% endcapture %}

View File

@ -1,10 +0,0 @@
<ul class="pagination">
{% assign thisSeries = page.series %}
{% for p in site.pages %}
{% if p.series == thisSeries and p.permalink == page.url %}
<li class="active"><a href="{{p.permalink | prepend: site.baseurl}}index.html">{{p.title}}</a></li>
{% else %}
<li><a href="{{p.permalink | prepend: site.baseurl}}index.html">{{p.title}}</a></li>
{% endif %}
{% endfor %}
</ul>

View File

@ -48,11 +48,11 @@
{% for entry in sidebar %}
{% for subcategory in entry.subcategories %}
{% if subcategory.audience contains buildAudience %}
{% if subcategory.audience contains audience and subcategory.product contains product and subcategory.platform contains platform and subcategory.version contains version and subcategory.web != false %}
<li><a href="#">{{ subcategory.title }}</a>
<ul>
{% for item in subcategory.items %}
{% if item.audience contains buildAudience and item.web != false %}
{% if item.audience contains audience and item.product contains product and item.platform contains platform and item.version contains version and item.web != false %}
{% if item.external_url %}
<li><a href="{{item.external_url}}" target="_blank">{{subcategory.title}}</a></li>
{% elsif page.url contains item.url %}
@ -98,6 +98,5 @@
</p>
{% endif %}
</div>
<!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above.-->
<script>$("li.active").parents('li').toggleClass("active");</script>
<!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above.-->
<script>$("li.active").parents('li').toggleClass("active");</script>

View File

@ -23,7 +23,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="fa fa-home fa-lg navbar-brand" href="{{ "/index.html" | prepend: site.baseurl }}">&nbsp;<span class="projectTitle"> {{site.title}} {{1.0}}</span></a>
<a class="fa fa-home fa-lg navbar-brand" href="{{ "/index.html" | prepend: site.baseurl }}">&nbsp;<span class="projectTitle"> {{site.topnav_title}} {{site.topnav_version}}</span></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
@ -33,12 +33,12 @@
{% for entry in topnav %}
{% for subcategory in entry.subcategories %}
{% if subcategory.audience contains buildAudience %}
{% if subcategory.audience contains audience and subcategory.product contains product and subcategory.platform contains platform and subcategory.version contains version and subcategory.web != false %}
{% if subcategory.external_url %}
<li><a href="{{subcategory.external_url}}" target="_blank">{{subcategory.title}}</a></li>
{% elsif page.url contains subcategory.url %}
<li class="active"><a href="{{subcategory.url | prepend: site.baseurl | append: site.suffix}}">{{subcategory.title}}</a></li>
{% else %}
{% else %}
<li><a href="{{subcategory.url | prepend: site.baseurl | append: site.suffix}}">{{subcategory.title}}</a></li>
{% endif %}
{% endif %}
@ -50,15 +50,15 @@
<!-- entries with drop-downs appear here -->
<!-- conditional logic to control which topnav appears for the audience defined in the configuration file.-->
{% for entry in topnav_dropdowns %}
{% for subcategory in entry.subcategories %}
{% if subcategory.audience contains buildAudience %}
{% if subcategory.audience contains audience and subcategory.product contains product and subcategory.platform contains platform and subcategory.version contains version and subcategory.web != false %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ subcategory.title }}<b class="caret"></b></a>
<ul class="dropdown-menu">
{% for subitem in subcategory.items %}
{% if subitem.audience contains buildAudience %}
{% if subitem.audience contains audience and subitem.product contains product and subitem.platform contains platform and subitem.version contains version and subitem.web != false% %}
{% if subitem.external_url %}
<li><a href="{{subitem.external_url}}" target="_blank">{{subitem.title}}</a></li>
{% elsif page.url contains subitem.url %}