aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bénier <clement.benier@iot.bzh>2018-11-25 17:08:12 +0100
committerClément Bénier <clement.benier@iot.bzh>2018-12-06 20:16:58 +0100
commitbb4f9bd01b464d16c98c23b4234a5e6dc0b54d9a (patch)
tree8a6383df320ea84d9a9aec94eb2bc49bc6006185
parent85d015213b015ec82d102ccfcbae0c6c4669978e (diff)
handles versions and languages
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
-rw-r--r--.gitignore1
-rw-r--r--site/_includes/header.html26
-rw-r--r--site/_layouts/doc.html24
-rw-r--r--site/docs/docsearch.html10
-rw-r--r--site/index.html4
5 files changed, 43 insertions, 22 deletions
diff --git a/.gitignore b/.gitignore
index 20ea33a..d09a655 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@ build-dev
conf/_release.yml
site/_data/all-pages.yml
site/_data/tocs
+site/_data/docs-versions.yml
.fetch.ts
.LocalFetch.ts
doctools
diff --git a/site/_includes/header.html b/site/_includes/header.html
index 6d69d6e..52ff7a0 100644
--- a/site/_includes/header.html
+++ b/site/_includes/header.html
@@ -1,3 +1,15 @@
+{% if include.language == "" or include.language == nil %}
+ {% assign LANGUAGE = "en" %}
+{% else %}
+ {% assign LANGUAGE = include.language %}
+{% endif %}
+{% if include.version == "" or include.version == nil %}
+ {% assign VERSION = site.default_linked_docs_version %}
+{% else %}
+ {% assign VERSION = include.version %}
+{% endif %}
+<!-- LANGUAGE: {{LANGUAGE}} {{include.language}} -->
+<!-- VERSION: {{VERSION}} {{include.version}}-->
<header>
<a class="scroll-point pt-top" name="top"></a>
<nav class="navbar navbar-inverse navbar-fixed-top">
@@ -15,23 +27,23 @@
<div class="nav_bar_left">
<ul class="nav navbar-nav">
<li {% if page.specs_tab %}class="active"{% endif %}>
- <a href="{{ site.docsurl }}/getting_started/en/{{ site.default_linked_docs_version }}/">Getting Started</a>
+ <a href="{{ site.docsurl }}/{{LANGUAGE}}/{{VERSION}}/getting_started/">Getting Started</a>
</li>
-
+
<li {% if page.specs_tab %}class="active"{% endif %}>
- <a href="{{ site.docsurl }}/architecture/en/{{ site.default_linked_docs_version }}/">Architecture Guides</a>
+ <a href="{{ site.docsurl }}/{{LANGUAGE}}/{{VERSION}}/architecture/">Architecture Guides</a>
</li>
<li {% if page.appfw_tab %}class="active"{% endif %}>
- <a href="{{ site.docsurl }}/hardware/en/{{ site.default_linked_docs_version }}/">Hardware Support</a>
+ <a href="{{ site.docsurl }}/en/{{ site.default_linked_docs_version }}/hardware/">Hardware Support</a>
</li>
<li {% if page.specs_tab %}class="active"{% endif %}>
- <a href="{{ site.docsurl }}/devguides/en/{{ site.default_linked_docs_version }}/">Developer Guides</a>
+ <a href="{{ site.docsurl }}/{{LANGUAGE}}/{{VERSION}}/devguides/">Developer Guides</a>
</li>
-
+
<li {% if page.appfw_tab %}class="active"{% endif %}>
- <a href="{{ site.docsurl }}/apis_services/en/{{ site.default_linked_docs_version }}/">APIs & Services</a>
+ <a href="{{ site.docsurl }}/{{LANGUAGE}}/{{VERSION}}/apis_services/">APIs & Services</a>
</li>
</ul>
</div>
diff --git a/site/_layouts/doc.html b/site/_layouts/doc.html
index 21f54ff..61ffdf0 100644
--- a/site/_layouts/doc.html
+++ b/site/_layouts/doc.html
@@ -11,8 +11,6 @@ scripts:
- process-uml.js
---
-{% include header.html %}
-
{% comment %}
set some constants
{% endcomment %}
@@ -21,11 +19,20 @@ set some constants
{% assign TOCSDIR = site.data.tocs %}
{% assign TOCFILE = TOCSDIR[page.tocdir][page.tocfile] %}
-{% capture VERSION_ROOT %}{{DOCSDIR}}/{{page.tocdir}}/{{ page.language }}/{{ page.version }}/{% endcapture %}
-{% capture LANGUAGE_ROOT %}{{DOCSDIR}}/{{page.tocdir}}/{{ page.language }}/{% endcapture %}
+{% capture VERSION_ROOT %}{{DOCSDIR}}/{{ page.language }}/{{ page.version }}/{{page.tocdir}}/{% endcapture %}
+{% capture VERSION_URL %}{{DOCSDIR}}/{{ page.language }}/{{ page.version }}/{% endcapture %}
+{% capture LANGUAGE_ROOT %}{{DOCSDIR}}/{{ page.language }}/{% endcapture %}
-{% assign MY_ENTRY = page.url | replace: VERSION_ROOT,"" %}
+{% assign MY_ENTRY = page.url | replace: VERSION_ROOT,"" %}
{% assign my_entry_parts = MY_ENTRY | split: "/" %}
+<!--
+ LANGUAGE_ROOT {{ LANGUAGE_ROOT }}
+ VERSION_ROOT {{VERSION_ROOT}}
+ DOCSDIR {{DOCSDIR}}
+ page.language {{page.language}}
+-->
+
+{% include header.html version=page.version language=page.language %}
<div class="docs container">
@@ -196,13 +203,14 @@ set some constants
layouts change from version to version
{% endcomment %}
{% capture other_version_root %}/docs/{{ page.language }}/{{ other_version_string }}/{% endcapture %}
- {% assign other_version_url = page.url | replace:VERSION_ROOT,other_version_root %}
+ {% assign other_version_url = page.url | replace:VERSION_URL,other_version_root %}
+ {% comment %}
{% unless ALL_PAGES contains other_version_url %}
{% assign other_version_url = other_version_root %}
{% endunless %}
-
- <a href="{{ site.docsurl }}{{ other_version_url }}" class="{% unless ALL_PAGES contains other_version_url %}missing-page{% endunless %}">
+ {% endcomment %}
+ <a href="{{ site.baseurl }}{{ other_version_url }}" class="{% unless ALL_PAGES contains other_version_url %}missing-page{% endunless %}">
{% if page.version == other_version %}
<span class="selected">
{{ version_entry_string }}
diff --git a/site/docs/docsearch.html b/site/docs/docsearch.html
index 0e3c7b0..b562d8a 100644
--- a/site/docs/docsearch.html
+++ b/site/docs/docsearch.html
@@ -5,11 +5,11 @@
<html lang="{% if page.language %}{{ page.language }}{% else %}{{ site.language }}{% endif %}">
{% include head.html %}
<body>
- <h3><a href="{{ site.docsurl }}/getting_started/en/{{ site.default_linked_docs_version }}/">Getting started</a></h3>
- <h3><a href="{{ site.docsurl }}/hardware/en/{{ site.default_linked_docs_version }}/">Hardware Support</a></h3>
- <h3><a href="{{ site.docsurl }}/architecture/en/{{ site.default_linked_docs_version }}/">Architecture Guides</a></h3>
- <h3><a href="{{ site.docsurl }}/devguides/en/{{ site.default_linked_docs_version }}/">Developer Guides</a></h3>
- <h3><a href="{{ site.docsurl }}/apis_services/en/{{ site.default_linked_docs_version }}/">APIs & Services</a></h3>
+ <h3><a href="{{ site.docsurl }}/en/{{ site.default_linked_docs_version }}/getting_started/">Getting started</a></h3>
+ <h3><a href="{{ site.docsurl }}/en/{{ site.default_linked_docs_version }}/hardware/">Hardware Support</a></h3>
+ <h3><a href="{{ site.docsurl }}/en/{{ site.default_linked_docs_version }}/architecture/">Architecture Guides</a></h3>
+ <h3><a href="{{ site.docsurl }}/en/{{ site.default_linked_docs_version }}/devguides/">Developer Guides</a></h3>
+ <h3><a href="{{ site.docsurl }}/en/{{ site.default_linked_docs_version }}/apis_services/">APIs & Services</a></h3>
{% include algolia.html %}
</body>
</html>
diff --git a/site/index.html b/site/index.html
index cb4c0a4..efa2d4e 100644
--- a/site/index.html
+++ b/site/index.html
@@ -20,7 +20,7 @@ change_frequency: monthly
<p>Multiple platforms on <em>a common code base</em></p>
<p>Free and <em>open source</em></p>
<div class="hero_buttons">
- <a href="{{ site.baseurl }}/docs/getting_started/en/{{ site.default_linked_docs_version }}" class="col-xs-12 col-sm-5 btn btn-lg btn-primary">
+ <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/getting_started" class="col-xs-12 col-sm-5 btn btn-lg btn-primary">
Get Started
</a>
<a href="{{ site.baseurl }}/contribute" class="col-xs-12 col-sm-5 btn btn-lg btn-primary">
@@ -67,7 +67,7 @@ change_frequency: monthly
<div class="col-md-12 text-center">
<h1>Supported Platforms</h1>
<h2>See a list of
- <a href="{{ site.baseurl }}/docs/hardware/en/{{ site.default_linked_docs_version }}/index.html">features supported</a> in each platform</h2>
+ <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/hardware/index.html">features supported</a> in each platform</h2>
<p>
Automotive Grade Linux (AGL) is a Linux Foundation project dedicated to creating open source software solutions for automotive applications. Although the initial target for AGL is In-Vehicle-Infotainment (IVI) systems, additional use cases such as instrument clusters and telematics systems will eventually be supported. AGL has participants from the Automotive, Communications, and Semiconductor Industries and welcomes contributions from individual developers.
</p>