Skip to content

Commit

Permalink
putting back nojs nav
Browse files Browse the repository at this point in the history
  • Loading branch information
MattReimer committed Dec 5, 2018
1 parent a1f9e7b commit f4c8560
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 35 deletions.
35 changes: 2 additions & 33 deletions docs/nav.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,6 @@
---
title: Test
layout: none
layout: navjs
comment: You need this file so we get the right navigation structure. Just leave the body empty.
---

{% capture html %}

{% assign entries = site.pages | sort: "path" %}

var NAVTitle = "{{site.title}}";
var NAVHome = "{{site.baseurl}}";
var NAVPages = [
{% for entry in entries %}

{% capture slug %}{{ entry.url | split: "/" | last }}{% endcapture %}
{% capture current %}{{ entry.url | remove: slug | remove: "//" | append: "/" }}{% endcapture %}
{% if entry.ignore %}
{% else %}
{
url: "{{entry.url}}",
absurl: "{{ site.baseurl }}{{ entry.url }}",
slug: "{{slug}}",
title: "{{entry.title}}",
weight: "{{entry.weight}}"
},
{% endif %}
{% endfor %}
];
var SiteSettings = {{ site.settings | jsonify }};
var APPREDIRECTS = {
{% for redir in site.AppRedirects %}
{{redir.key}}: "{{redir.url}}",
{% endfor %}
}


{% endcapture %}{{ html | strip_newlines | replace:' ','' | replace:' ','' | replace:' ',' ' }}
2 changes: 0 additions & 2 deletions docs/src/_includes/sidenav.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
</div>
</div>
<div id="sidenav">
{% comment %}
{% capture html %}

{% assign entries = site.pages | sort: "path" %}
Expand All @@ -29,5 +28,4 @@
</ul>

{% endcapture %}{{ html | strip_newlines | replace:' ','' | replace:' ','' | replace:' ',' ' }}
{% endcomment %}
</div>
34 changes: 34 additions & 0 deletions docs/src/_layouts/navjs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{% capture html %}

{% assign entries = site.pages | sort: "path" %}

var NAVTitle = "{{site.title}}";
var NAVHome = "{{site.baseurl}}";
var NAVPages = [
{% for entry in entries %}

{% capture slug %}{{ entry.url | split: "/" | last }}{% endcapture %}
{% capture current %}{{ entry.url | remove: slug | remove: "//" | append: "/" }}{% endcapture %}
{% if entry.ignore %}
{% else %}
{
url: "{{entry.url}}",
absurl: "{{ site.baseurl }}{{ entry.url }}",
slug: "{{slug}}",
title: "{{entry.title}}",
weight: "{{entry.weight}}"
},
{% endif %}
{% endfor %}
];
var SiteSettings = {{ site.settings | jsonify }};
var APPREDIRECTS = {
{% for redir in site.AppRedirects %}
{{redir.key}}: "{{redir.url}}",
{% endfor %}
}


{% endcapture %}{{ html | strip_newlines | replace:' ','' | replace:' ','' | replace:' ',' ' }}

{{content}}

0 comments on commit f4c8560

Please sign in to comment.