programming-pages 0.5.9 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e752d8b47207a58900615d051daa8b1772c624c1880f0f2d335246a83bfc7dc
4
- data.tar.gz: 52204a18698b7b3140505f5d7c2f1ac16f86cbf27b0f6e20974ab259c8b33a84
3
+ metadata.gz: 5f8b6a72ea89a58403a987fcb1f1bf533a398315653ef6d1584348a387cc7dac
4
+ data.tar.gz: d58a72b9f1a89d2623a40171b36a68413d2a4d41c36970d50a870088c280038a
5
5
  SHA512:
6
- metadata.gz: 8bb5d22d7c3e2ae585e71a64a9c2c22944f134324a17988289f25e10e7c19e4a12a8b32f2f3b0a867e07868a7ba8b0f7c5c55206533cfb6d58e5e07f1cda81db
7
- data.tar.gz: 4c414c5d6cee588a1cf4bf3ebbf99cff271bf0f5233e8296f95a1e84cead70ab93815db115576d5201405e31d9af148c428af7feca7eb3726c74304ef6bacb82
6
+ metadata.gz: 8090fe3e5ad1856673d62c91d9049f3c780149a9a47040a6afe47c2b74f2c33f9ee9a4307fd6f17574e9972b7f1d0d548d8095c73d34e7aca9fa2f6f27b4d81c
7
+ data.tar.gz: 80197eecfea2bd9fd38b11c02ab7bbe31f752133223872d98161341ec8c3fffcc07984cc97d8739f0f504f85e154ab896131e72df7a19e26cd1771d9c3fa9446
@@ -20,7 +20,7 @@
20
20
 
21
21
  <tr>
22
22
  <td class="smaller text">
23
- <strong>programming pages</strong> template v{{ layout.theme_version }} (<a href="{{ layout.theme_url }}" title="a documentation template for GitHub Pages">{{ layout.theme_url }}</a>)
23
+ <strong>programming pages</strong> theme v{{ layout.theme_version }} (<a href="{{ layout.theme_url }}" title="a jekyll theme for publishing code documentation to GitHub pages">{{ layout.theme_url }}</a>)
24
24
  </td>
25
25
  </tr>
26
26
 
@@ -38,10 +38,12 @@
38
38
  <h4 class="ui header">{{ collection.title }}</h4>
39
39
  <div class="ui inverted link list">
40
40
  {% assign doc_list = collection.docs %}
41
+
42
+ {% unless collection.ignore-page-order %}
41
43
  {% assign ordered_doc_list = '' | split: '' %}
42
44
 
43
45
  {%- comment %}
44
- for guides, we want to support user-defined ordering, but not require it in every guide.
46
+ for collection pages, we want to support user-defined ordering, but not require it on every page.
45
47
 
46
48
  this means we have to create our own file tree, keeping children with parents as we re-sort
47
49
  the collection list from its default alphabetical order into user order, and for that,
@@ -86,7 +88,7 @@ so our strategy is to:
86
88
  {%- comment %} first, calculate max_depth as deepest level index {% endcomment -%}
87
89
  {% assign max_depth = 0 %}
88
90
  {% for doc in doc_list %}
89
- {% assign depth = doc.path | split:'/' | size | minus:2 %} {%- comment %} minus one to convert from length to index, minus two to ignore root collection directory (_guides/) {% endcomment -%}
91
+ {% assign depth = doc.path | split:'/' | size | minus:2 %} {%- comment %} minus one to convert from length to index, minus two to ignore root collection directory (e.g. _guides/) {% endcomment -%}
90
92
  {% if depth > max_depth %}{% assign max_depth = depth %}{% endif %}
91
93
  {% endfor %}
92
94
 
@@ -199,27 +201,13 @@ so our strategy is to:
199
201
  {%- endfor -%}
200
202
 
201
203
  {% assign doc_list = ordered_doc_list %}
204
+ {% endunless %}
202
205
 
203
- {% for doc in doc_list %}
204
- {% capture link %}{{ doc.title }}{% endcapture %}
205
- {% capture url %}{{ doc.url }}#/{{ collection.label | downcase }}/{% endcapture %}
206
- {% capture item_class %}{% if doc.title == page.title %}active {% endif %}item{% endcapture %}
207
- {% case doc.layout %}
208
- {% when 'package' %}
209
- {% capture link %}{% include icon.liquid id='folder-outline' %} {% include package_shortener.liquid package=doc.module %}{% endcapture %}
210
- {% when 'type' %}
211
- {% capture pkg %}{{ doc.module }}.{{ doc.name }}{% endcapture %}
212
- {% capture link %}{% include package_shortener.liquid package=pkg %}{% endcapture %}
213
- {% when 'page' %}
214
- {% assign path_bits = doc.relative_path | split: '.' | first | split: '/' %}
215
- {% assign n = path_bits.size | minus: 2 %}
216
- {% if n > 3 %}{% assign n = 3 %}{% endif %}
217
- {% capture indent %}{% for i in (1..n) %}&ensp;{% endfor %}{% endcapture %}
218
- {% capture link %}{{ indent }}{{ doc.title }}{% endcapture %}
219
- {% endcase %}
220
- <a class="very tight smaller text {{ item_class }}" href="{{ site.baseurl }}{{ url }}">{{ link }}</a>
221
- {% endfor %}
206
+ {%- comment %} delegate to extension point for actual rendering of link list {% endcomment -%}
207
+ {% include render_indices.liquid doc_list=doc_list collection_label=collection.title page_title=page.title %}
222
208
 
209
+ <br>
210
+ <br>
223
211
  </div>
224
212
  </div>
225
213
  {% endfor %}
@@ -1,7 +1,7 @@
1
1
  {%- comment -%}
2
2
 
3
3
  page_root
4
- extracts first component of page url
4
+ extracts the first component of a page url
5
5
 
6
6
  params:
7
7
  page=<page-object>
@@ -0,0 +1,25 @@
1
+ {%- comment -%}
2
+
3
+ render_indices
4
+ creates the individual links in the sidebar
5
+ - pages, layouts, and guide-indexes are indented when parented
6
+
7
+ params:
8
+ doc_list=<array of document objects to create links for>
9
+ collection_label=<name of collection the docs belong to>
10
+ page_title=<title of the calling page>
11
+
12
+ {%- endcomment -%}
13
+ {% for doc in include.doc_list %}
14
+ {% capture link %}{{ doc.title }}{% endcapture %}
15
+ {% capture url %}{{ doc.url }}#/{{ include.collection_label | downcase }}/{% endcapture %}
16
+ {% capture item_class %}{% if doc.title == include.page_title %}active {% endif %}item{% endcapture %}
17
+ {% if doc.layout == 'page' or doc.layout == 'layout' or doc.layout == 'guide-index' %}
18
+ {% assign path_bits = doc.relative_path | split: '.' | first | split: '/' %}
19
+ {% assign n = path_bits.size | minus: 2 %}
20
+ {% if n > 3 %}{% assign n = 3 %}{% endif %}
21
+ {% capture indent %}{% for i in (1..n) %}&ensp;{% endfor %}{% endcapture %}
22
+ {% capture link %}{{ indent }}{{ doc.title }}{% endcapture %}
23
+ {% endif %}
24
+ <a class="very tight smaller text {{ item_class }}" href="{{ site.baseurl }}{{ url }}">{{ link }}</a>
25
+ {% endfor %}
data/_layouts/page.html CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  layout: base
3
- theme_version: 0.5.9
3
+ theme_version: 0.5.10
4
4
  theme_url: https://github.com/pixeldroid/programming-pages
5
5
  ---
6
6
 
data/screenshot.png CHANGED
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: programming-pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9
4
+ version: 0.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - pixeldroid
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-03 00:00:00.000000000 Z
11
+ date: 2018-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github-pages
@@ -73,6 +73,7 @@ files:
73
73
  - _includes/ordered_child_list.liquid
74
74
  - _includes/package_shortener.liquid
75
75
  - _includes/page_root.liquid
76
+ - _includes/render_indices.liquid
76
77
  - _includes/scripts/example.js
77
78
  - _includes/scripts/help.js
78
79
  - _includes/scripts/indices.js