diff options
author | Stephane Desneux <stephane.desneux@iot.bzh> | 2016-11-08 12:39:57 +0100 |
---|---|---|
committer | Stephane Desneux <stephane.desneux@iot.bzh> | 2016-11-10 14:53:01 +0100 |
commit | c530e84843444a40804e0c2b038c2ec53fe411b2 (patch) | |
tree | 1a9eebf49fd85027ba472bad8c178d686bad8d56 /site/_layouts |
webdocs-agl: added developer website template
Change-Id: I4a45ee0ad5dd0c29a6d6876a0e02cd5550c010e9
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'site/_layouts')
-rw-r--r-- | site/_layouts/agl.html | 7 | ||||
-rw-r--r-- | site/_layouts/appfw-en.html | 15 | ||||
-rw-r--r-- | site/_layouts/architecture-en.html | 15 | ||||
-rw-r--r-- | site/_layouts/base.html | 18 | ||||
-rw-r--r-- | site/_layouts/bindings-en.html | 15 | ||||
-rw-r--r-- | site/_layouts/blog.html | 8 | ||||
-rw-r--r-- | site/_layouts/contribute.html | 8 | ||||
-rw-r--r-- | site/_layouts/hardware-en.html | 15 | ||||
-rw-r--r-- | site/_layouts/iotbzh.html | 7 | ||||
-rw-r--r-- | site/_layouts/page.html | 7 | ||||
-rw-r--r-- | site/_layouts/post.html | 71 | ||||
-rw-r--r-- | site/_layouts/quickstart-en.html | 15 | ||||
-rw-r--r-- | site/_layouts/umlflowdoc.html | 18 | ||||
-rw-r--r-- | site/_layouts/umlpost.html | 82 | ||||
-rw-r--r-- | site/_layouts/withindex.html | 271 |
15 files changed, 572 insertions, 0 deletions
diff --git a/site/_layouts/agl.html b/site/_layouts/agl.html new file mode 100644 index 0000000..40aee7a --- /dev/null +++ b/site/_layouts/agl.html @@ -0,0 +1,7 @@ +--- +layout: base +--- + +{% include header.html %} +{{ content }} +{% include footer_site.html %} diff --git a/site/_layouts/appfw-en.html b/site/_layouts/appfw-en.html new file mode 100644 index 0000000..1a8a097 --- /dev/null +++ b/site/_layouts/appfw-en.html @@ -0,0 +1,15 @@ +--- +layout: withindex +outdated_text: "This version of the documentation is outdated!" +in_development_text: "This version of the documentation is under development!" +click_here_text: "Click here for the latest released version." +toc_text: "Table of Contents" +latest_text: "Latest" +visit_github_text: "Other versions are on GitHub." +plugin_version_text: "This documentation describes this plugin at version" +edit_text: "Edit" +edit_source_text: "Edit Source on GitHub" +edit_translation_text: "Edit Translation on Crowdin" +--- + +{{ content }} diff --git a/site/_layouts/architecture-en.html b/site/_layouts/architecture-en.html new file mode 100644 index 0000000..1a8a097 --- /dev/null +++ b/site/_layouts/architecture-en.html @@ -0,0 +1,15 @@ +--- +layout: withindex +outdated_text: "This version of the documentation is outdated!" +in_development_text: "This version of the documentation is under development!" +click_here_text: "Click here for the latest released version." +toc_text: "Table of Contents" +latest_text: "Latest" +visit_github_text: "Other versions are on GitHub." +plugin_version_text: "This documentation describes this plugin at version" +edit_text: "Edit" +edit_source_text: "Edit Source on GitHub" +edit_translation_text: "Edit Translation on Crowdin" +--- + +{{ content }} diff --git a/site/_layouts/base.html b/site/_layouts/base.html new file mode 100644 index 0000000..db0c8c7 --- /dev/null +++ b/site/_layouts/base.html @@ -0,0 +1,18 @@ +--- +analytics_id: {{ site.ganalytics }} +--- + +<!DOCTYPE html> +<html lang="{% if page.language %}{{ page.language }}{% else %}{{ site.language }}{% endif %}"> +{% include head.html %} +<body> + {{ content }} + <script defer type="text/javascript" src="{{ site.baseurl }}/static/js/twitter.js"></script> + {% include algolia.html %} + + {% for script in layout.scripts %} + <script src="{{ site.baseurl }}/static/js/{{script}}"></script> + {% endfor %} + +</body> +</html> diff --git a/site/_layouts/bindings-en.html b/site/_layouts/bindings-en.html new file mode 100644 index 0000000..1a8a097 --- /dev/null +++ b/site/_layouts/bindings-en.html @@ -0,0 +1,15 @@ +--- +layout: withindex +outdated_text: "This version of the documentation is outdated!" +in_development_text: "This version of the documentation is under development!" +click_here_text: "Click here for the latest released version." +toc_text: "Table of Contents" +latest_text: "Latest" +visit_github_text: "Other versions are on GitHub." +plugin_version_text: "This documentation describes this plugin at version" +edit_text: "Edit" +edit_source_text: "Edit Source on GitHub" +edit_translation_text: "Edit Translation on Crowdin" +--- + +{{ content }} diff --git a/site/_layouts/blog.html b/site/_layouts/blog.html new file mode 100644 index 0000000..da93280 --- /dev/null +++ b/site/_layouts/blog.html @@ -0,0 +1,8 @@ +--- +layout: page +blog_tab: true +--- + +<div class="blog"> + {{ content }} +</div> diff --git a/site/_layouts/contribute.html b/site/_layouts/contribute.html new file mode 100644 index 0000000..21e0ea2 --- /dev/null +++ b/site/_layouts/contribute.html @@ -0,0 +1,8 @@ +--- +layout: page +contribute_tab: true +--- + +<div class="contribute-help"> + {{ content }} +</div> diff --git a/site/_layouts/hardware-en.html b/site/_layouts/hardware-en.html new file mode 100644 index 0000000..1a8a097 --- /dev/null +++ b/site/_layouts/hardware-en.html @@ -0,0 +1,15 @@ +--- +layout: withindex +outdated_text: "This version of the documentation is outdated!" +in_development_text: "This version of the documentation is under development!" +click_here_text: "Click here for the latest released version." +toc_text: "Table of Contents" +latest_text: "Latest" +visit_github_text: "Other versions are on GitHub." +plugin_version_text: "This documentation describes this plugin at version" +edit_text: "Edit" +edit_source_text: "Edit Source on GitHub" +edit_translation_text: "Edit Translation on Crowdin" +--- + +{{ content }} diff --git a/site/_layouts/iotbzh.html b/site/_layouts/iotbzh.html new file mode 100644 index 0000000..40aee7a --- /dev/null +++ b/site/_layouts/iotbzh.html @@ -0,0 +1,7 @@ +--- +layout: base +--- + +{% include header.html %} +{{ content }} +{% include footer_site.html %} diff --git a/site/_layouts/page.html b/site/_layouts/page.html new file mode 100644 index 0000000..6bb945c --- /dev/null +++ b/site/_layouts/page.html @@ -0,0 +1,7 @@ +--- +layout: agl +--- + +<div class="page container"> + {{ content }} +</div> diff --git a/site/_layouts/post.html b/site/_layouts/post.html new file mode 100644 index 0000000..083fac0 --- /dev/null +++ b/site/_layouts/post.html @@ -0,0 +1,71 @@ +--- +layout: blog +--- + +<h1 class="blogHeader"> + Blog + <span class="rss"> + <img src="{{ site.baseurl }}/static/img/subscribe.png"><a href="{{ site.baseurl }}{{ site.rss_path }}">RSS Feed</a> + </span> +</h1> + +<div class="post"> + <header> + <div class="title">{{ page.title }}</div> + <div class="author">By: + {% if page.author.url %} + <a href="{{ page.author.url }}">{{ page.author.name }}</a> + {% else %} + {{ page.author.name }} + {% endif %} + </div> + <div class="date">{{ page.date | date_to_string }}</div> + </header> + <section> + <div> + {{ content }} + </div> + </section> + <footer> + <div class="row"> + <div class="col-sm-6"> + {% if page.previous %} + <a href="{{ site.baseurl }}{{ page.previous.url }}">Previous</a> + <br> + <br> + <a class="title" href="{{ site.baseurl }}{{ page.previous.url }}">{{ page.previous.title }}</a> + <div class="date"> {{ page.previous.date | date_to_string }} - By {{ page.previous.author.name }} </div> + <p class="content"> + {{ page.previous.excerpt | strip_html | truncatewords:12 }} + </p> + {% endif %} + </div> + <div class="col-sm-6"> + {% if page.next %} + <a href="{{ site.baseurl }}{{ page.next.url }}">Next</a> + <br> + <br> + <a class="title" href="{{ site.baseurl }}{{ page.next.url }}">{{ page.next.title }}</a> + <div class="date"> {{ page.next.date | date_to_string }} - By {{ page.next.author.name}} </div> + <p class="content"> + <!-- + NOTE: + the markdownify filter is used here + because posts are rendered in sequence; + that is, the next post's content isn't + yet rendered at the time that this post + is being rendered, so page.next.excerpt + is still in Markdown and not HTML + + Reference: https://github.com/jekyll/jekyll/issues/2860 + --> + {{ page.next.excerpt | markdownify | strip_html | truncatewords:12 }} + </p> + {% endif %} + </div> + </div> + </footer> + <div class="disqus"> + {% include disqus.html %} + </div> +</div> diff --git a/site/_layouts/quickstart-en.html b/site/_layouts/quickstart-en.html new file mode 100644 index 0000000..1a8a097 --- /dev/null +++ b/site/_layouts/quickstart-en.html @@ -0,0 +1,15 @@ +--- +layout: withindex +outdated_text: "This version of the documentation is outdated!" +in_development_text: "This version of the documentation is under development!" +click_here_text: "Click here for the latest released version." +toc_text: "Table of Contents" +latest_text: "Latest" +visit_github_text: "Other versions are on GitHub." +plugin_version_text: "This documentation describes this plugin at version" +edit_text: "Edit" +edit_source_text: "Edit Source on GitHub" +edit_translation_text: "Edit Translation on Crowdin" +--- + +{{ content }} diff --git a/site/_layouts/umlflowdoc.html b/site/_layouts/umlflowdoc.html new file mode 100644 index 0000000..ba1c32e --- /dev/null +++ b/site/_layouts/umlflowdoc.html @@ -0,0 +1,18 @@ +--- +layout: base + +scripts: + - lib/raphael-min.js + - lib/underscore-min.js + - lib/sequence-diagram-min.js + - lib/flowchart-latest.js + - process-uml.js +--- + +<div class="techdoc"> + <img class="icone" src="{{site.assets.icone}}"> + <h1>{{ page.title }}</h1> + <div class="technical-doc"> + {{ content }} + </div> +</div> diff --git a/site/_layouts/umlpost.html b/site/_layouts/umlpost.html new file mode 100644 index 0000000..9125136 --- /dev/null +++ b/site/_layouts/umlpost.html @@ -0,0 +1,82 @@ +--- +layout: blog + +scripts: + - lib/raphael-min.js + - lib/underscore-min.js + - lib/sequence-diagram-min.js + - lib/flowchart-latest.js + - process-uml.js +--- + +<h1 class="blogHeader"> + Blog + <span class="rss"> + <img src="{{ site.baseurl }}/static/img/subscribe.png"><a href="{{ site.baseurl }}{{ site.rss_path }}">RSS Feed</a> + </span> +</h1> + +<div class="post"> + <header> + <div class="title">{{ page.title }}</div> + <div class="author">By: + {% if page.author.url %} + <a href="{{ page.author.url }}">{{ page.author.name }}</a> + {% else %} + {{ page.author.name }} + {% endif %} + </div> + <div class="date">{{ page.date | date_to_string }}</div> + </header> + <section> + <div> + {{ content }} + </div> + </section> + <footer> + <div class="row"> + <div class="col-sm-6"> + {% if page.previous %} + <a href="{{ site.baseurl }}{{ page.previous.url }}">Previous</a> + <br> + <br> + <a class="title" href="{{ site.baseurl }}{{ page.previous.url }}">{{ page.previous.title }}</a> + <div class="date"> {{ page.previous.date | date_to_string }} - By {{ page.previous.author.name }} </div> + <p class="content"> + {{ page.previous.excerpt | strip_html | truncatewords:12 }} + </p> + {% endif %} + </div> + <div class="col-sm-6"> + {% if page.next %} + <a href="{{ site.baseurl }}{{ page.next.url }}">Next</a> + <br> + <br> + <a class="title" href="{{ site.baseurl }}{{ page.next.url }}">{{ page.next.title }}</a> + <div class="date"> {{ page.next.date | date_to_string }} - By {{ page.next.author.name}} </div> + <p class="content"> + <!-- + NOTE: + the markdownify filter is used here + because posts are rendered in sequence; + that is, the next post's content isn't + yet rendered at the time that this post + is being rendered, so page.next.excerpt + is still in Markdown and not HTML + + Reference: https://github.com/jekyll/jekyll/issues/2860 + --> + {{ page.next.excerpt | markdownify | strip_html | truncatewords:12 }} + </p> + {% endif %} + </div> + </div> + </footer> + <div class="disqus"> + {% include disqus.html %} + </div> +</div> + +{% for script in layout.scripts %} + <script src="{{ site.baseurl }}/static/js/{{script}}"></script> +{% endfor %} diff --git a/site/_layouts/withindex.html b/site/_layouts/withindex.html new file mode 100644 index 0000000..ed39f8c --- /dev/null +++ b/site/_layouts/withindex.html @@ -0,0 +1,271 @@ +--- +layout: base +docs_tab: true +analytics_id: {{site.ganalytics}} + +scripts: + - lib/raphael-min.js + - lib/underscore-min.js + - lib/sequence-diagram-min.js + - lib/flowchart-latest.js + - process-uml.js +--- + +{% include header.html %} + +{% comment %} +set some constants +{% endcomment %} +{% assign ALL_PAGES = site.data.all-pages %} +{% assign DOCSDIR = site.docsurl %} +{% 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 %} + +{% assign MY_ENTRY = page.url | replace: VERSION_ROOT,"" %} +{% assign my_entry_parts = MY_ENTRY | split: "/" %} + +<div class="docs container"> + + <!-- Table of Contents --> + <div class="hidden-xs hidden-sm col-md-4 col-lg-3 site-toc-container"> + {% include toc_recursive_main.html entries=TOCFILE my_entry=MY_ENTRY version_root=VERSION_ROOT %} + </div> + + <!-- Page content --> + <div class="col-md-8 col-md-offset-4 col-lg-9 col-lg-offset-3 page-content-container container"> + <div class="page-content row"> + <div class="col-md-offset-1 col-md-10"> + <div class="content-header"> + + <!-- ToC Dropdown (for XS and SM sizes only) --> + <div class="toc-dropdown dropdown visible-xs-block visible-sm-block"> + <button class="btn btn-default dropdown-toggle" type="button" id="tocDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> + {{ page.toc_text }} + <span class="caret"></span> + </button> + <ul class="dropdown-menu"> + {% include toc_recursive_dropdown.html entries=TOCFILE my_entry=MY_ENTRY version_root=VERSION_ROOT %} + </ul> + </div> + + {% comment %} + Show a single edit-link if the page has a specific edit-link. + {% endcomment %} + {% if page.edit_link %} + <a class="edit" href="{{ page.edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_text }}</a> + + {% comment %} + Otherwise, show editing and translating options. + + Edit-links obey the following rules: + + if page in /dev/ or /latest/: + show edit link for /dev/ page in source language + if page not in source language: + show translation link for /dev/ page + else: + show edit link for the page in its version and language + + {% endcomment %} + {% else %} + + {% capture base_edit_link %}{{ site.urls.edit_git }}{{ page.path }}{% endcapture %} + {% capture base_version %}/{{ page.version }}/{% endcapture %} + {% capture base_language %}/{{ page.language }}/{% endcapture %} + {% capture dev_version %}/dev/{% endcapture %} + {% capture src_language %}/{{ site.src_language }}/{% endcapture %} + + {% comment %} + Edit-links for current pages in non-source languages + NOTE: + Pages that are under /dev/ or /latest/ (i.e. site.latest_docs_version) have page.current set to "true". + {% endcomment %} + {% if page.language != site.src_language and page.current %} + + {% comment %} + Compute crowdin link + {% endcomment %} + {% capture page_path_prefix %}docs/{{ page.language }}/{{ page.version }}{% endcapture %} + {% assign page_path_end = page.path | split:"/" | last %} + {% assign crowdin_path = page.path | replace:page_path_prefix,"docs/en/dev" | replace:page_path_end,"" %} + {% capture crowdin_link %}https://crowdin.com/project/cordova/{{ page.language }}#/cordova-docs/{{ crowdin_path }}{% endcapture %} + + {% assign edit_link = base_edit_link | replace:base_language,src_language | replace:base_version,dev_version %} + + <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a> + <a class="edit" href="{{ crowdin_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_translation_text }}</a> + + {% comment %} + Edit-links for all other pages + {% endcomment %} + {% else %} + + {% comment %} + Edit-link for latest version points to dev instead + {% endcomment %} + {% if page.version == site.latest_docs_version %} + {% assign edit_link = base_edit_link | replace:base_version,dev_version %} + {% else %} + {% assign edit_link = base_edit_link %} + {% endif %} + + <a class="edit" href="{{ edit_link }}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> {{ page.edit_source_text }}</a> + {% endif %} + {% endif %} + + <!-- Language dropdown --> + <div class="dropdown"> + <button class="btn btn-default dropdown-toggle" type="button" id="languageDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> + {{ site.data.docs-versions[page.language].name }} + <span class="caret"></span> + </button> + + <!-- List all languages --> + <ul class="dropdown-menu" aria-labelledby="languageDropdown"> + {% for other_language_entry in site.data.docs-versions %} + + {% assign other_language_id = other_language_entry[0] %} + {% assign other_language = other_language_entry[1] %} + {% assign other_language_versions = other_language.versions %} + {% assign other_language_name = other_language.name %} + + {% capture other_language_root %}/docs/{{ other_language_id }}/{% endcapture %} + + {% comment %} + Replace only the language part of the URI, thereby redirecting to the same page + in the other language. The page will exist because translations are clones of each other. + {% endcomment %} + {% assign other_language_url = page.url | replace:LANGUAGE_ROOT,other_language_root %} + + <li> + <a href="{{ site.baseurl }}{{ other_language_url }}" class="{% unless other_language_versions contains page.version %}missing-page{% endunless %}"> + {% if page.language == other_language_id %} + <span class="selected"> + {{ other_language_name }} + </span> + {% else %} + {{ other_language_name }} + {% endif %} + </a> + </li> + {% endfor %} + </ul> + </div> + + <!-- Version dropdown --> + <div class="dropdown"> + <button class="btn btn-default dropdown-toggle" type="button" id="versionDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> + {{ page.version }} + {% if page.version == site.latest_docs_version %} + ({{ page.latest_text }}) + {% endif %} + <span class="caret"></span> + </button> + <ul class="dropdown-menu" aria-labelledby="versionDropdown"> + + <!-- List versions available in this language --> + {% for other_version in site.data.docs-versions[page.language].versions reversed %} + <li> + {% comment %} + Name the latest version as "latest" to take advantage of redirects for "/latest/". + {% endcomment %} + {% if other_version == site.latest_docs_version %} + {% assign other_version_string = "latest" %} + {% else %} + {% assign other_version_string = other_version %} + {% endif %} + + {% capture version_entry_string %} + {{ other_version }} + {% if other_version == site.latest_docs_version %} + ({{ page.latest_text }}) + {% endif %} + {% endcapture %} + + {% comment %} + Replace only the version part of the URI, thereby redirecting to + the same page in the other version. + + NOTE: + This page might not exist in the target version because page + 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 %} + + {% 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 %}"> + {% if page.version == other_version %} + <span class="selected"> + {{ version_entry_string }} + </span> + {% else %} + {{ version_entry_string }} + {% endif %} + </a> + </li> + {% endfor %} + </ul> + </div> + </div> + + {% comment %} + Get URL for this page in the latest version + {% endcomment %} + {% capture latest_root %}/docs/{{ page.language }}/latest/{% endcapture %} + {% assign latest_url = page.url | replace:VERSION_ROOT,latest_root %} + + {% comment %} + If this page doesn't exist, just use root + {% endcomment %} + {% unless ALL_PAGES contains latest_url %} + {% assign latest_url = latest_root %} + {% endunless %} + + <!-- Show warnings for special versions --> + <!-- dev warning --> + {% if page.version == 'dev' %} + <div class="alert docs-alert alert-info" role="alert"> + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + {{ site.message.indev }} + <a href="{{ site.baseurl }}{{ latest_url }}"> + {{ page.click_here_text }} + </a> + </div> + {% endif %} + + <!-- outdated warning --> + {% if page.version != 'dev' and page.version != site.latest_docs_version %} + <div class="alert docs-alert alert-danger" role="alert"> + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + {{ page.outdated_text }} + <a href="{{ site.baseurl }}{{ latest_url }}"> + {{ page.click_here_text }} + </a> + </div> + {% endif %} + + + <div id="page-toc-source"> + {{ content }} + </div> + </div> + </div> + <div class="row"> + {% include footer_docs.html %} + </div> + </div> +</div> + +<script defer type="text/javascript" src="{{ site.baseurl }}/static/js/lib/toc.min.js"></script> +<script defer type="text/javascript" src="{{ site.baseurl }}/static/js/docs.js"></script> |