Made an update to tags logic to account for different file prefixes for different projects that are using the same theme.

This commit is contained in:
Tom Johnson
2015-08-20 11:13:24 -07:00
parent d8ce926bc8
commit 57c5f3bee7
4 changed files with 4 additions and 1 deletions

View File

@ -22,7 +22,7 @@ layout: default
{% include custom/conditions.html %} {% include custom/conditions.html %}
{% for tag in page.tags %} {% for tag in page.tags %}
{% if projectTags contains tag %} {% if projectTags contains tag %}
<a href="{{site.project}}_tag-{{tag}}.html"><button type="button" class="btn btn-primary navbar-btn cursorNorm">{{page.tagName}}{{tag}}</button></a>{% unless forloop.last %}{% endunless%} <a href="{{site.project_file_name}}_tag-{{tag}}.html"><button type="button" class="btn btn-primary navbar-btn cursorNorm">{{page.tagName}}{{tag}}</button></a>{% unless forloop.last %}{% endunless%}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}

View File

@ -15,6 +15,7 @@ google_analytics: UA-66296557-1
sidebar_tagline: designers sidebar_tagline: designers
sidebar_version: version 3.0 sidebar_version: version 3.0
project_file_name: doc
port: 4001 port: 4001

View File

@ -16,6 +16,7 @@ google_analytics: UA-66296557-1
sidebar_tagline: writers sidebar_tagline: writers
sidebar_version: version 3.0 sidebar_version: version 3.0
theme_file: theme-green.css theme_file: theme-green.css
project_file_name: doc
port: 4003 port: 4003
exclude: exclude:

View File

@ -31,6 +31,7 @@ Note that you can define arbitrary key-value pairs in the configuration file, an
| **product** | Required | The product for the output. See additional information in audience. | **product** | Required | The product for the output. See additional information in audience.
| **version** | Required | The version for the output. See additional information in audience. | **version** | Required | The version for the output. See additional information in audience.
| **destination** | Required | The folder where the site is built. If you put this into your same folder as your other files, Jekyll may start building and rebuilding in an infinite loop because it detects more files in the project folder. Make sure you specify a folder outside your project folder, by using `../` or by specifying the absolute path, such as /Applications/XAMPP/xamppfiles/htdocs/myfolder. | | **destination** | Required | The folder where the site is built. If you put this into your same folder as your other files, Jekyll may start building and rebuilding in an infinite loop because it detects more files in the project folder. Make sure you specify a folder outside your project folder, by using `../` or by specifying the absolute path, such as /Applications/XAMPP/xamppfiles/htdocs/myfolder. |
| **project_file_name** | Required | The shortname for your project that you preface each file name with (for example, `doc`). This label is used to specify the prefix for the tag archives files (which are named with titles such as `doc_tag-formatting.html`). The raw code in the theme is {% raw %}`<a href="{{site.project_file_name}}_tag-{{tag}}.html">`{% endraw %} The {% raw %}`{{site.project_file_name}}`{% endraw %} field renders as `doc` in the sample theme. The {% raw %}`{{tag}}`{% endraw %} is populated by a "for" loop through the tags property specified in page frontmatter.|
| **sidebar_tagline** | Optional | Appears above the sidebar. Usually you put some term related to the site specific build, such as the audience. In the sample theme files, the taglines are "writers" and "designers."| | **sidebar_tagline** | Optional | Appears above the sidebar. Usually you put some term related to the site specific build, such as the audience. In the sample theme files, the taglines are "writers" and "designers."|
| **sidebar_version** | Optional | Appears below the sidebar_tagline in a smaller font, usually specifying the version of the documentation. In the sample theme files, the version is "3.0."| | **sidebar_version** | Optional | Appears below the sidebar_tagline in a smaller font, usually specifying the version of the documentation. In the sample theme files, the version is "3.0."|
| **topnav_title** | Required | Appears next to the home button in the top nav bar. In the sample theme files, the topnav_title is "Jekyll Documentation Theme." | | **topnav_title** | Required | Appears next to the home button in the top nav bar. In the sample theme files, the topnav_title is "Jekyll Documentation Theme." |