Skip to content

Commit

Permalink
Update base and root front matter usage
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Dietrich <Thomas.Dietrich@tu-ilmenau.de>
  • Loading branch information
Thomas Dietrich authored and Thomas Dietrich committed Nov 11, 2017
1 parent c8e9bf6 commit cba5d32
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 29 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Yekyll site settings
title: openHAB 2
description: Empowering the Smart Home
baseurl: "" # the subpath of your site, e.g. /blog/
baseurl: "" # the subpath of your site, e.g. /blog
url: "http://docs.openhab.org" # the base hostname & protocol for your site
twitter_username: openhab
github_username: openhab
Expand Down
3 changes: 2 additions & 1 deletion _includes/base.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% assign base = '' %}
{% assign root = '' %}
{% assign base = site.baseurl %}
{% comment %} <!--Disabled since the base in docs.openhab.org can only be '/'-->
{% assign depth = page.url | split: '/' | size | minus: 1 %}
{% if depth == 0 %}{% assign base = '.' %}
Expand Down
3 changes: 2 additions & 1 deletion _includes/dev-menu.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% include base.html %} {% assign docu = base | append: "/developers" %}
{% include base.html %}
{% assign docu = base | append: "/developers" %}

<ul class="nav">
<li><a href="{{docu}}">Overview</a></li>
Expand Down
4 changes: 2 additions & 2 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</div>
<div class="col s12 m5">
<ul class="list-inline right-align">
<li><a href="/imprint.html">Imprint</a></li>
<li><a href="/privacy.html">Privacy Policy</a></li>
<li><a href="{{root}}/imprint.html">Imprint</a></li>
<li><a href="{{root}}/privacy.html">Privacy Policy</a></li>
<li><a href="http://www.openhab.org">openHAB Website</a></li>
<li><a href=# onclick="printPage()">Print This Page</a></li>
</ul>
Expand Down
8 changes: 4 additions & 4 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
<a href="{{base}}/index.html"><img id="logo" src="/images/logo.png" /></a>
<a href="#" data-activates="nav-mobile" class="button-collapse"><i class="material-icons">menu</i></a>
<ul class="right hide-on-med-and-down">
<li><a href="{{base}}/tutorials">Tutorials</a></li>
<li><a href="{{root}}/tutorials/index.html">Tutorials</a></li>
<li><a href="{{base}}/introduction.html">User Manual</a></li>
<li><a href="{{docu}}/developers">Developer Guide</a></li>
<li><a href="{{root}}/developers/index.html">Developer Guide</a></li>
<li><a target="_blank" href="https://community.openhab.org">Community Forum</a></li>
<li><a target="_blank" href="https://github.com/openhab">GitHub</a></li>
<li class="search"><i class="material-icons">search</i></li>
Expand All @@ -54,9 +54,9 @@
</ul>
<ul id="nav-mobile" class="side-nav">
<li><a href="{{base}}/index.html">Home</a></li>
<li><a href="{{base}}/tutorials">Tutorials</a></li>
<li><a href="{{root}}/tutorials/index.html">Tutorials</a></li>
<li><a href="{{base}}/introduction.html">User Manual</a></li>
<li><a href="{{docu}}/developers">Developer Guide</a></li>
<li><a href="{{root}}/developers/index.html">Developer Guide</a></li>
<li><a target="_blank" href="https://community.openhab.org">Community Forum</a></li>
<li><a target="_blank" href="https://github.com/openhab">GitHub</a></li>
<li class="search">
Expand Down
5 changes: 3 additions & 2 deletions _includes/nav-main-bar.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% include base.html %}

<div class="row center targets">
<div class="col s12 m4 l4">
<a href="{{base}}/tutorials/">
<a href="{{root}}/tutorials/index.html">
<div class="target target-beginner card">
<i class="material-icons icon-large md-48">explore</i>
<div class="footer">
Expand All @@ -25,7 +26,7 @@ <h2 class="valign">User Manual</h2>
</a>
</div>
<div class="col s12 m4 l4">
<a href="{{base}}/developers/">
<a href="{{root}}/developers/index.html">
<div class="target target-migration card">
<i class="material-icons icon-large">developer_mode</i>
<div class="footer">
Expand Down
3 changes: 2 additions & 1 deletion _includes/tutorial-advanced-menu.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% include base.html %} {% assign docu = base | append: "/tutorials/advanced" %}
{% include base.html %}
{% assign docu = base | append: "/tutorials/advanced" %}

<ul class="nav">
<li>Tutorial (Advanced)</li>
Expand Down
3 changes: 2 additions & 1 deletion _includes/tutorial-beginner-menu.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% include base.html %} {% assign docu = base | append: "/tutorials/beginner" %}
{% include base.html %}
{% assign docu = base | append: "/tutorials/beginner" %}

<ul class="nav">
<li>Tutorial (Beginner)</li>
Expand Down
23 changes: 12 additions & 11 deletions _includes/user-menu.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% include base.html %} {% assign docu = base %}
{% include base.html %}
{% assign docu = base %}

<ul class="nav">
<li><a href="{{docu}}/introduction.html">Introduction</a></li>
Expand Down Expand Up @@ -72,9 +73,9 @@
<hr />
{% for binding in site.addons_bindings %}
{% if binding.install == "auto" %}
<li><a href="{{ binding.url }}">{{ binding.label }}</a></li>
<li><a href="{{docu}}{{ binding.url }}">{{ binding.label }}</a></li>
{% elsif binding.id == page.id and page.install == "manual" or page.install == "legacy" %}
<li><a href="{{ binding.url }}">{{ binding.label }} <small>(legacy/manual)</small></a></li>
<li><a href="{{docu}}{{ binding.url }}">{{ binding.label }} <small>(legacy/manual)</small></a></li>
{% endif %}
{% endfor %}
</ul>
Expand All @@ -84,7 +85,7 @@
<li><a href="{{docu}}/addons/uis.html">Overview</a></li>
<hr />
{% for ui in site.addons_uis %}
<li><a href="{{ ui.url }}">{{ ui.label }}</a></li>
<li><a href="{{docu}}{{ ui.url }}">{{ ui.label }}</a></li>
{% endfor %}
<hr />
<li><a href="{{docu}}/addons/uis/apps/android.html">Android App</a></li>
Expand All @@ -100,7 +101,7 @@
<hr />
{% for persistence in site.addons_persistences %}
{% if persistence.install == "auto" or persistence.id == page.id and page.install == "manual" %}
<li><a href="{{ persistence.url }}">{{ persistence.label }}</a></li>
<li><a href="{{docu}}{{ persistence.url }}">{{ persistence.label }}</a></li>
{% endif %}
{% endfor %}
</ul>
Expand All @@ -111,7 +112,7 @@
<hr />
{% for action in site.addons_actions %}
{% if action.install == "auto" or action.id == page.id and page.install == "manual" %}
<li><a href="{{ action.url }}">{{ action.label }}</a></li>
<li><a href="{{docu}}{{ action.url }}">{{ action.label }}</a></li>
{% endif %}
{% endfor %}
</ul>
Expand All @@ -121,7 +122,7 @@
<li><a href="{{docu}}/addons/transformations.html">Overview</a></li>
<hr />
{% for transformation in site.addons_transformations %}
<li><a href="{{ transformation.url }}">{{ transformation.label }}</a></li>
<li><a href="{{docu}}{{ transformation.url }}">{{ transformation.label }}</a></li>
{% endfor %}
</ul>
</li>
Expand All @@ -130,7 +131,7 @@
<li><a href="{{docu}}/addons/voices.html">Overview</a></li>
<hr />
{% for voice in site.addons_voices %}
<li><a href="{{ voice.url }}">{{ voice.label }}</a></li>
<li><a href="{{docu}}{{ voice.url }}">{{ voice.label }}</a></li>
{% endfor %}
</ul>
</li>
Expand All @@ -140,11 +141,11 @@
<li><a href="{{docu}}/addons/io.html">Overview</a></li>
<hr />
{% for io in site.addons_ios %}
<li><a href="{{ io.url }}">{{ io.label }}</a></li>
<li><a href="{{docu}}{{ io.url }}">{{ io.label }}</a></li>
{% endfor %}
<hr />
<li><a href="{{base}}/configuration/restdocs.html">REST API</a></li>
<li><a href="{{base}}/configuration/eclipseiotmarket.html">Eclipse IoT Marketplace</a></li>
<li><a href="{{docu}}/configuration/restdocs.html">REST API</a></li>
<li><a href="{{docu}}/configuration/eclipseiotmarket.html">Eclipse IoT Marketplace</a></li>
<li><a href="http://www.myopenhab.org/" target="_blank">IFTTT</a></li>
</ul>
</li>
Expand Down
10 changes: 8 additions & 2 deletions _includes/versioning.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{% include base.html %}

<div id="versioning" class="row valign-wrapper">
<div class="col s12 right-align">
<a class="waves-effect waves-light btn light-blue lighten-3" href="{{base}}/2.1.0{{page.url}}" title="You are currently browsing the latest 2.2.0-SNASHOT version of the openHAB documentation.">
Show v2.1.0 stable version<i class="material-icons right">chevron_right</i>
<ul id="dropdown-versioning" class="dropdown-content">
<li><a href="{{base}}{{page.url}}">v2.2.0-SNAPSHOT<i class="tiny material-icons right">lens</i></a></li>
<li><a href="{{base}}/2.1.0{{page.url}}">v2.1.0</a></li>
</ul>
<a class="waves-effect waves-light btn dropdown-button light-blue lighten-2" href="#!" data-activates="dropdown-versioning" title="Select which version of this openHAB documentation article you want to read.">
Switch Article Version<i class="material-icons right">arrow_drop_down</i>
</a>
</div>
</div>
2 changes: 1 addition & 1 deletion _layouts/addon.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<div class="side-nav-wrapper">
{% include user-menu.html %}
</div>
{% include versioning.html %}
<div class="content">
{% include versioning.html %}
{{ content }}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion _layouts/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<div class="side-nav-wrapper">
{% include user-menu.html %}
</div>
{% include versioning.html %}
<div class="content">
{% include versioning.html %}
{{ content }}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="container target">
<h1>Welcome to the openHAB 2 Documentation!</h1>
<p>The <strong>open H</strong>ome <strong>A</strong>utomation <strong>B</strong>us (openHAB, <em>pronounced ˈəʊpənˈhæb</em>) is an open source, technology agnostic home automation platform which runs as the center of your smart home!</p>
<p>This documentation contains three different categories. If you are new to openHAB 2, you might want to start with one of the <a href="tutorials">Tutorials</a>. Otherwise, for specific information on how to use or install openHAB, see the <a href="overview.html">User Manual</a>. If you would like to contribute to the development of openHAB, please refer to our <a href="developers">Developer Guide</a>.</p>
<p>This documentation contains three different categories. If you are new to openHAB 2, you might want to start with one of the <a href="{{root}}/tutorials/index.html">Tutorials</a>. Otherwise, for specific information on how to use or install openHAB, see the <a href="{{base}}/introduction.html">User Manual</a>. If you would like to contribute to the development of openHAB, please refer to our <a href="{{root}}/developers/index.html">Developer Guide</a>.</p>
<p><strong>Note:</strong> This documentation is currently heavily worked on, so expect regular changes. If you feel that something important is missing, please <a href="https://github.com/openhab/openhab-docs/blob/gh-pages/README.md#contributing-to-the-documentation">help us improve the documentation</a>!
{% include nav-main-bar.html %}
</div>

0 comments on commit cba5d32

Please sign in to comment.