From 13ef1a3b311c6857036e65d5dfafc18a242471ea Mon Sep 17 00:00:00 2001 From: Stephane Desneux Date: Fri, 11 Nov 2016 19:30:50 +0100 Subject: webdocs: adjust layouts deps for UML/FLOW support Change-Id: Ia8d366588a1ac75c3698050953bda7973bb87e55 Signed-off-by: Stephane Desneux --- Makefile | 9 +- site/_layouts/README | 2 +- site/_layouts/apis_services-en.html | 2 +- site/_layouts/architecture-en.html | 2 +- site/_layouts/devguides-en.html | 2 +- site/_layouts/doc.html | 271 ++++++++++++++++++++++++++++++++++ site/_layouts/getting_started-en.html | 2 +- site/_layouts/hardware-en.html | 2 +- site/_layouts/umldoc.html | 12 ++ site/_layouts/umlpost.html | 71 +-------- site/_layouts/withindex.html | 271 ---------------------------------- 11 files changed, 297 insertions(+), 349 deletions(-) create mode 100644 site/_layouts/doc.html create mode 100644 site/_layouts/umldoc.html delete mode 100644 site/_layouts/withindex.html diff --git a/Makefile b/Makefile index 9d2b8e0..bd029ff 100644 --- a/Makefile +++ b/Makefile @@ -18,13 +18,16 @@ clean: .PHONY: build build: - $(DOCBUILD) $(VERBOSE) --fetch --force --build + $(DOCBUILD) $(VERBOSE) --fetch --force + $(DOCBUILD) $(VERBOSE) --build .PHONY: push push: - $(DOCBUILD) $(VERBOSE) --fetch --force --build --push + $(DOCBUILD) $(VERBOSE) --fetch --force + $(DOCBUILD) $(VERBOSE) --build --push .PHONY: serve serve: - $(DOCBUILD) $(VERBOSE) ---fetch --force --build --serve + $(DOCBUILD) $(VERBOSE) --fetch --force + $(DOCBUILD) $(VERBOSE) --build --serve diff --git a/site/_layouts/README b/site/_layouts/README index 08bcee8..f910f99 100644 --- a/site/_layouts/README +++ b/site/_layouts/README @@ -3,7 +3,7 @@ Layout hierarchy: base | - `--> withindex --> + `--> doc --> umldoc --> | `--> agl --> page | diff --git a/site/_layouts/apis_services-en.html b/site/_layouts/apis_services-en.html index 1a8a097..1b459f8 100644 --- a/site/_layouts/apis_services-en.html +++ b/site/_layouts/apis_services-en.html @@ -1,5 +1,5 @@ --- -layout: withindex +layout: umldoc 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." diff --git a/site/_layouts/architecture-en.html b/site/_layouts/architecture-en.html index 1a8a097..1b459f8 100644 --- a/site/_layouts/architecture-en.html +++ b/site/_layouts/architecture-en.html @@ -1,5 +1,5 @@ --- -layout: withindex +layout: umldoc 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." diff --git a/site/_layouts/devguides-en.html b/site/_layouts/devguides-en.html index 1a8a097..1b459f8 100644 --- a/site/_layouts/devguides-en.html +++ b/site/_layouts/devguides-en.html @@ -1,5 +1,5 @@ --- -layout: withindex +layout: umldoc 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." diff --git a/site/_layouts/doc.html b/site/_layouts/doc.html new file mode 100644 index 0000000..ed39f8c --- /dev/null +++ b/site/_layouts/doc.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: "/" %} + +
+ + + + + +
+
+
+
+ + + + + {% comment %} + Show a single edit-link if the page has a specific edit-link. + {% endcomment %} + {% if page.edit_link %} + {{ page.edit_text }} + + {% 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 %} + + {{ page.edit_source_text }} + {{ page.edit_translation_text }} + + {% 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 %} + + {{ page.edit_source_text }} + {% endif %} + {% endif %} + + + + + + +
+ + {% 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 %} + + + + {% if page.version == 'dev' %} + + {% endif %} + + + {% if page.version != 'dev' and page.version != site.latest_docs_version %} + + {% endif %} + + +
+ {{ content }} +
+
+
+
+ {% include footer_docs.html %} +
+
+
+ + + diff --git a/site/_layouts/getting_started-en.html b/site/_layouts/getting_started-en.html index 1a8a097..1b459f8 100644 --- a/site/_layouts/getting_started-en.html +++ b/site/_layouts/getting_started-en.html @@ -1,5 +1,5 @@ --- -layout: withindex +layout: umldoc 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." diff --git a/site/_layouts/hardware-en.html b/site/_layouts/hardware-en.html index 1a8a097..1b459f8 100644 --- a/site/_layouts/hardware-en.html +++ b/site/_layouts/hardware-en.html @@ -1,5 +1,5 @@ --- -layout: withindex +layout: umldoc 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." diff --git a/site/_layouts/umldoc.html b/site/_layouts/umldoc.html new file mode 100644 index 0000000..e3bfd10 --- /dev/null +++ b/site/_layouts/umldoc.html @@ -0,0 +1,12 @@ +--- +layout: doc + +scripts: + - lib/raphael-min.js + - lib/underscore-min.js + - lib/sequence-diagram-min.js + - lib/flowchart-latest.js + - process-uml.js +--- + +{{ content }} diff --git a/site/_layouts/umlpost.html b/site/_layouts/umlpost.html index dac8efe..76858a0 100644 --- a/site/_layouts/umlpost.html +++ b/site/_layouts/umlpost.html @@ -1,5 +1,5 @@ --- -layout: blog +layout: post scripts: - lib/raphael-min.js @@ -9,71 +9,4 @@ scripts: - process-uml.js --- -

- Blog - - RSS Feed - -

- -
-
-
{{ page.title }}
-
By: - {% if page.author.url %} - {{ page.author.name }} - {% else %} - {{ page.author.name }} - {% endif %} -
-
{{ page.date | date_to_string }}
-
-
-
- {{ content }} -
-
-
-
-
- {% if page.previous %} - Previous -
-
- {{ page.previous.title }} -
{{ page.previous.date | date_to_string }} - By {{ page.previous.author.name }}
-

- {{ page.previous.excerpt | strip_html | truncatewords:12 }} -

- {% endif %} -
-
- {% if page.next %} - Next -
-
- {{ page.next.title }} -
{{ page.next.date | date_to_string }} - By {{ page.next.author.name}}
-

- - {{ page.next.excerpt | markdownify | strip_html | truncatewords:12 }} -

- {% endif %} -
-
-
-
- {% include disqus.html %} -
-
- +{{ content }} diff --git a/site/_layouts/withindex.html b/site/_layouts/withindex.html deleted file mode 100644 index ed39f8c..0000000 --- a/site/_layouts/withindex.html +++ /dev/null @@ -1,271 +0,0 @@ ---- -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: "/" %} - -
- - - - - -
-
-
-
- - - - - {% comment %} - Show a single edit-link if the page has a specific edit-link. - {% endcomment %} - {% if page.edit_link %} - {{ page.edit_text }} - - {% 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 %} - - {{ page.edit_source_text }} - {{ page.edit_translation_text }} - - {% 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 %} - - {{ page.edit_source_text }} - {% endif %} - {% endif %} - - - - - - -
- - {% 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 %} - - - - {% if page.version == 'dev' %} - - {% endif %} - - - {% if page.version != 'dev' and page.version != site.latest_docs_version %} - - {% endif %} - - -
- {{ content }} -
-
-
-
- {% include footer_docs.html %} -
-
-
- - - -- cgit 1.2.3-korg