You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ad...@apache.org on 2016/11/05 04:51:07 UTC

[22/50] incubator-mynewt-site git commit: a sub page template

a sub page template


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/d20c70ad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/d20c70ad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/d20c70ad

Branch: refs/heads/develop
Commit: d20c70ad60643d6f055d22e2dbd17af68b5d4e2f
Parents: b1c5481
Author: Gavin Jefferies <ga...@runtime.io>
Authored: Tue Oct 18 13:59:37 2016 -0700
Committer: Gavin Jefferies <ga...@runtime.io>
Committed: Tue Oct 18 13:59:37 2016 -0700

----------------------------------------------------------------------
 custom-theme/base.html           |  2 ++
 custom-theme/nav.html            |  4 ++--
 custom-theme/pages/template.html | 25 +++++++++++++++++++++++++
 docs/pages/template.md           |  6 ++++++
 mkdocs.yml                       |  2 ++
 5 files changed, 37 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/d20c70ad/custom-theme/base.html
----------------------------------------------------------------------
diff --git a/custom-theme/base.html b/custom-theme/base.html
index 55b4544..48c6c38 100644
--- a/custom-theme/base.html
+++ b/custom-theme/base.html
@@ -56,6 +56,8 @@
         <div class="container">
             {% if page_title == None %}
                 {% include "landing.html" %}
+            {% elif meta and meta.html %}
+                {% include meta.html[0] %}
             {% elif page_title == 'About' %}
                 {% include "about.html" %}
             {% elif page_title == 'Quick Start' %}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/d20c70ad/custom-theme/nav.html
----------------------------------------------------------------------
diff --git a/custom-theme/nav.html b/custom-theme/nav.html
index f927c6d..9961500 100644
--- a/custom-theme/nav.html
+++ b/custom-theme/nav.html
@@ -2,11 +2,11 @@
 {% set not_doc_page_titles = ['Home', 'Quick Start', 'About', 'Download', 'Community', 'Events'] %}
 
 {% macro active_nav(page, title, classes) %}
-  class="{% if page and page.title == title %}active {% endif %}{{ classes }}"
+  class="{% if (page and page.title == title) or (title == 'Home' and meta and meta.sub_page) %}active {% endif %}{{ classes }}"
 {% endmacro %}
 
 {% macro docs_are_active(page) %}
-  class="{% if not page or not page.title in not_doc_page_titles %}active{% endif %}"
+  class="{% if (not page or not page.title in not_doc_page_titles) and (not meta or not meta.sub_page) %}active{% endif %}"
 {% endmacro %}
 
 <nav id="navbar" class="navbar navbar-inverse navbar-fixed-top" role="navigation">

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/d20c70ad/custom-theme/pages/template.html
----------------------------------------------------------------------
diff --git a/custom-theme/pages/template.html b/custom-theme/pages/template.html
new file mode 100644
index 0000000..dddf974
--- /dev/null
+++ b/custom-theme/pages/template.html
@@ -0,0 +1,25 @@
+{% include 'main-banner.html' %}
+
+<div class="col-xs-12 v2-sub-page">
+
+    <h2>Something about MyNewt that will not fit on the landing page</h2>
+    <p>
+        Non eram nescius, Brute, cum, quae summis ingeniis exquisitaque doctrina philosophi Graeco sermone tractavissent, ea Latinis litteris mandaremus, fore ut hic noster labor in varias reprehensiones incurreret. nam quibusdam, et iis quidem non admodum indoctis,
+        totum hoc displicet philosophari. quidam autem non tam id reprehendunt, si remissius agatur, sed tantum studium tamque multam operam ponendam in eo non arbitrantur. erunt etiam, et ii quidem eruditi Graecis litteris, contemnentes Latinas, qui se dicant
+        in Graecis legendis operam malle consumere. postremo aliquos futuros suspicor, qui me ad alias litteras vocent, genus hoc scribendi, etsi sit elegans, personae tamen et dignitatis esse negent.
+    </p>
+
+    <p>
+        Link to this with <a href="/pages/template/">more detail...</a>
+    </p>
+
+    <h2>Another Chunk</h2>
+    <p>
+        Non eram nescius, Brute, cum, quae summis ingeniis exquisitaque doctrina philosophi Graeco sermone tractavissent, ea Latinis litteris mandaremus, fore ut hic noster labor in varias reprehensiones incurreret. nam quibusdam, et iis quidem non admodum indoctis,
+        totum hoc displicet philosophari. quidam autem non tam id reprehendunt, si remissius agatur, sed tantum studium tamque multam operam ponendam in eo non arbitrantur. erunt etiam, et ii quidem eruditi Graecis litteris, contemnentes Latinas, qui se dicant
+        in Graecis legendis operam malle consumere. postremo aliquos futuros suspicor, qui me ad alias litteras vocent, genus hoc scribendi, etsi sit elegans, personae tamen et dignitatis esse negent.
+    </p>
+
+    {{ content }}
+
+</div>

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/d20c70ad/docs/pages/template.md
----------------------------------------------------------------------
diff --git a/docs/pages/template.md b/docs/pages/template.md
new file mode 100644
index 0000000..7ce124f
--- /dev/null
+++ b/docs/pages/template.md
@@ -0,0 +1,6 @@
+html: pages/template.html
+sub_page: True
+
+## Markdown
+
+You could make a page with markdown but then you will need to add a {{ content }} to your pages/whatever.html.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/d20c70ad/mkdocs.yml
----------------------------------------------------------------------
diff --git a/mkdocs.yml b/mkdocs.yml
index 47cf117..b952e82 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -5,6 +5,8 @@ theme_dir: 'custom-theme'
 
 pages:
 - Home: 'index.md'
+- Pages:
+    - Page Title: 'pages/template.md'
 - Quick Start: 'quick-start.md'
 - About: 'about.md'
 - Download: 'download.md'