jekyll-docs-theme 1.0.0.pre.beta.1 → 1.0.0.pre.beta.2

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: 735e7eb3a1c0aaad66ab888846e1fbc0d075bde327236a25f08fb09ef1ed4201
4
- data.tar.gz: 2921a56d61b4ef0eb601206f15fba9c3aaee9c194d57fc947dd0760c0f9a9178
3
+ metadata.gz: 29d77e21bd07c17cc7121c8cbe221f773f93d89047adf95193f0f4e1d9a279c6
4
+ data.tar.gz: aae4b27e89dbcf194b7afbf774c8c8bd025828b049732c59839db14630c9e7d8
5
5
  SHA512:
6
- metadata.gz: 7d5599be5e985d2b095e37ac218e8d3da11e2c3907b3d2df1c5b081308d0124b2df79a6e0a9710234e530a633a42d42cf4aab96bdcfacd7b985c5941a7ae2926
7
- data.tar.gz: 02f64ec5948d018a8b7065201403c2fa009542c2f598ecff89202433c5a9c7e7e7a87f0a9920afd7ef0984b20f4bc652a30e540eb3b9dfb310c3df007d0e0f5f
6
+ metadata.gz: 6662d176d68b765dc0e1512bfa2d84571ebe51d5d7816b80aa31363d0930be6a8896ef87ee1554b37b5343818d21da702fb74aced2dcf39a415e9eae6c357d5c
7
+ data.tar.gz: f64f25c1865136a862ddfc2b0beedaf33ab8c79432c50a98824bb2431c7af2fcd6f9acb8aa6d59f2837fe8afa5f3a149da54d32ecf2fe8a33ac85d69ab82cf21
data/README.md CHANGED
@@ -10,7 +10,7 @@ This theme is designed for writing documentation websites instead of having larg
10
10
 
11
11
  ![Theme Screenshot](./screenshot.png)
12
12
 
13
- **DarkMode**
13
+ **Dark Mode**
14
14
 
15
15
  ![Theme Screenshot](./screenshot-dark.png)
16
16
 
@@ -4,8 +4,8 @@
4
4
  integrity="sha256-BTlTdQO9/fascB1drekrDVkaKd9PkwBymMlHOiG+qLI=" crossorigin="anonymous"
5
5
  ></script>
6
6
  <script
7
- src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/popper.min.js"
8
- integrity="sha256-O17BxFKtTt1tzzlkcYwgONw4K59H+r1iI8mSQXvSf5k=" crossorigin="anonymous"
7
+ src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js"
8
+ integrity="sha256-/ijcOLwFf26xEYAjW75FizKVo5tnTYiQddPZoLUHHZ8=" crossorigin="anonymous"
9
9
  ></script>
10
10
  <script
11
11
  src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/js/bootstrap.min.js"
@@ -1,6 +1,6 @@
1
1
  {% capture tocWorkspace %}
2
2
  {% comment %}
3
- Version 1.0.6
3
+ Version 1.0.11
4
4
  https://github.com/allejo/jekyll-toc
5
5
 
6
6
  "...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
@@ -21,6 +21,7 @@
21
21
  * item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level
22
22
  * baseurl (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content
23
23
  * anchor_class (string) : '' - add custom class(es) for each anchor element
24
+ * skipNoIDs (bool) : false - skip headers that do not have an `id` attribute
24
25
 
25
26
  Output:
26
27
  An ordered or unordered list representing the table of contents of a markdown block. This snippet will only
@@ -29,6 +30,7 @@
29
30
 
30
31
  {% capture my_toc %}{% endcapture %}
31
32
  {% assign orderedList = include.ordered | default: false %}
33
+ {% assign skipNoIDs = include.skipNoIDs | default: false %}
32
34
  {% assign minHeader = include.h_min | default: 1 %}
33
35
  {% assign maxHeader = include.h_max | default: 6 %}
34
36
  {% assign nodes = include.html | split: '<h' %}
@@ -41,6 +43,12 @@
41
43
  {% continue %}
42
44
  {% endif %}
43
45
 
46
+ {% if skipNoIDs == true %}
47
+ {% unless node contains "id=" %}
48
+ {% continue %}
49
+ {% endunless %}
50
+ {% endif %}
51
+
44
52
  {% assign headerLevel = node | replace: '"', '' | slice: 0, 1 | times: 1 %}
45
53
 
46
54
  {% if headerLevel < minHeader or headerLevel > maxHeader %}
@@ -52,13 +60,21 @@
52
60
  {% assign minHeader = headerLevel %}
53
61
  {% endif %}
54
62
 
55
- {% assign indentAmount = headerLevel | minus: minHeader | add: 1 %}
63
+ {% assign indentAmount = headerLevel | minus: minHeader %}
56
64
  {% assign _workspace = node | split: '</h' %}
57
65
 
58
66
  {% assign _idWorkspace = _workspace[0] | split: 'id="' %}
59
67
  {% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
60
68
  {% assign html_id = _idWorkspace[0] %}
61
69
 
70
+ {% assign _classWorkspace = _workspace[0] | split: 'class="' %}
71
+ {% assign _classWorkspace = _classWorkspace[1] | split: '"' %}
72
+ {% assign html_class = _classWorkspace[0] %}
73
+
74
+ {% if html_class contains "no_toc" %}
75
+ {% continue %}
76
+ {% endif %}
77
+
62
78
  {% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
63
79
  {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
64
80
 
@@ -67,15 +83,24 @@
67
83
  {% assign space = space | prepend: ' ' %}
68
84
  {% endfor %}
69
85
 
70
- {% unless include.item_class == blank %}
86
+ {% if include.item_class and include.item_class != blank %}
71
87
  {% capture listItemClass %}{:.{{ include.item_class | replace: '%level%', headerLevel }}}{% endcapture %}
72
- {% endunless %}
88
+ {% endif %}
89
+
90
+ {% capture anchor_body %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %}
91
+ {% capture anchor_body %}{{ anchor_body | replace: "|", "\|" }}{% endcapture %}
92
+
93
+ {% if html_id %}
94
+ {% capture list_item %}[{{ anchor_body }}]({% if include.baseurl %}{{ include.baseurl }}{% endif %}#{{ html_id }}){% endcapture %}
95
+ {% else %}
96
+ {% capture list_item %}{{ anchor_body }}{% endcapture %}
97
+ {% endif %}
73
98
 
74
99
  {% capture my_toc %}{{ my_toc }}
75
- {{ space }}{{ listModifier }} {{ listItemClass }} [{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}]({% if include.baseurl %}{{ include.baseurl }}{% endif %}#{{ html_id }}){% if include.anchor_class %}{:.{{ include.anchor_class }}}{% endif %}{% endcapture %}
100
+ {{ space }}{{ listModifier }} {{ listItemClass }} {{ list_item }}{% if include.anchor_class %}{:.{{ include.anchor_class }}}{% endif %}{% endcapture %}
76
101
  {% endfor %}
77
102
 
78
- {% if include.class %}
103
+ {% if include.class and include.class != blank %}
79
104
  {% capture my_toc %}{:.{{ include.class }}}
80
105
  {{ my_toc | lstrip }}{% endcapture %}
81
106
  {% endif %}
@@ -84,4 +109,4 @@
84
109
  {% capture my_toc %}{: #{{ include.id }}}
85
110
  {{ my_toc | lstrip }}{% endcapture %}
86
111
  {% endif %}
87
- {% endcapture %}{% assign tocWorkspace = '' %}{{ my_toc | markdownify | strip }}
112
+ {% endcapture %}{% assign tocWorkspace = '' %}{{ my_toc | markdownify | strip }}
@@ -18,9 +18,21 @@
18
18
 
19
19
  <nav class="navbar-collapse collapse" role="navigation" id="navbarSupportedContent">
20
20
  <ul class="navbar-nav">
21
- {% assign sorted_pages = site.pages | sort: "name" %}
21
+ {% assign sorted_pages = site.pages | sort: "title" %}
22
22
  {% for p in sorted_pages %}
23
- {% if p.isHome != true and p.hide != true and p.title %}
23
+ {% assign is_homepage = false %}
24
+ {% if p.homepage == true or p.isHome == true %}
25
+ {% assign is_homepage = true %}
26
+ {% endif %}
27
+
28
+ {% assign show_in_menu = true %}
29
+ {% if p.show_in_menu != nil and p.show_in_menu == false %}
30
+ {% assign show_in_menu = false %}
31
+ {% elsif p.hide != nil and p.hide == true %}
32
+ {% assign show_in_menu = false %}
33
+ {% endif %}
34
+
35
+ {% if is_homepage != true and show_in_menu == true and p.title %}
24
36
  <li class="nav-item {% if page.title == p.title %}active{% endif %}">
25
37
  <a
26
38
  class="nav-link"
@@ -4,7 +4,7 @@
4
4
  {% include head/full.html %}
5
5
  </head>
6
6
 
7
- <body data-spy="scroll" data-target="#page-toc" data-offset="0">
7
+ <body class="layout-{{ page.layout }}" data-spy="scroll" data-target="#page-toc" data-offset="0">
8
8
  {% include navigation.html %}
9
9
  {% include masthead.html %}
10
10
 
data/_layouts/full.html CHANGED
@@ -3,9 +3,17 @@ layout: default
3
3
  ---
4
4
 
5
5
  <div class="container">
6
- <div class="scope-markdown" role="main">
7
- {% include anchor_headings.html html=content anchorBody="#" anchorClass="heading-anchor" %}
8
- </div>
6
+ <main class="layout-full__main scope-markdown">
7
+ {% unless page.disable_anchors %}
8
+ {% include jekyll-docs-theme/vendor/anchor_headings.html
9
+ html=content
10
+ anchorBody="#"
11
+ anchorClass="heading-anchor"
12
+ %}
13
+ {% else %}
14
+ {{ content }}
15
+ {% endunless %}
16
+ </main>
9
17
 
10
18
  {% include disqus.html %}
11
19
  </div>
data/_layouts/page.html CHANGED
@@ -4,7 +4,7 @@ layout: default
4
4
 
5
5
  <div class="container">
6
6
  <div class="row">
7
- <main class="col-md-9">
7
+ <main class="col-md-9 layout-page__main">
8
8
  <section class="mobile-toc border mb-3 p-3 d-md-none">
9
9
  <div class="d-flex align-items-center">
10
10
  <h2 class="mb-0">Table of Contents</h2>
@@ -19,7 +19,7 @@ layout: default
19
19
  </button>
20
20
  </div>
21
21
 
22
- {% include toc.html
22
+ {% include jekyll-docs-theme/vendor/toc.html
23
23
  html=content
24
24
  class="js-toc.mb-0.mt-2"
25
25
  id="mobileTOC"
@@ -28,17 +28,21 @@ layout: default
28
28
  </section>
29
29
 
30
30
  <section class="scope-markdown">
31
- {% include anchor_headings.html
32
- html=content
33
- anchorBody="#"
34
- anchorClass="heading-anchor"
35
- %}
31
+ {% unless page.disable_anchors %}
32
+ {% include jekyll-docs-theme/vendor/anchor_headings.html
33
+ html=content
34
+ anchorBody="#"
35
+ anchorClass="heading-anchor"
36
+ %}
37
+ {% else %}
38
+ {{ content }}
39
+ {% endunless %}
36
40
  </section>
37
41
  </main>
38
42
 
39
- <aside class="col-md-3 d-none d-md-block hidden-print">
43
+ <aside class="col-md-3 layout-page__sidebar d-none d-md-block hidden-print">
40
44
  <nav id="page-toc" class="page-sidebar">
41
- {% include toc.html
45
+ {% include jekyll-docs-theme/vendor/toc.html
42
46
  html=content
43
47
  class="list-unstyled.pl-0"
44
48
  anchor_class="nav-link.px-3.py-1"
@@ -6,8 +6,10 @@
6
6
  }
7
7
 
8
8
  .page-sidebar {
9
+ max-height: 100vh;
9
10
  position: -webkit-sticky;
10
11
  position: sticky;
12
+ overflow: auto;
11
13
  top: 20px;
12
14
 
13
15
  a {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-docs-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.beta.1
4
+ version: 1.0.0.pre.beta.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir 'allejo' Jimenez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-23 00:00:00.000000000 Z
11
+ date: 2020-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -47,7 +47,6 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - LICENSE.md
49
49
  - README.md
50
- - _includes/anchor_headings.html
51
50
  - _includes/disqus.html
52
51
  - _includes/fa-icon.html
53
52
  - _includes/facebook.html
@@ -68,12 +67,13 @@ files:
68
67
  - _includes/head/stylesheets-pre.html
69
68
  - _includes/head/stylesheets.html
70
69
  - _includes/internal/variables.html
70
+ - _includes/jekyll-docs-theme/vendor/anchor_headings.html
71
+ - _includes/jekyll-docs-theme/vendor/toc.html
71
72
  - _includes/masthead.html
72
73
  - _includes/masthead/button.html
73
74
  - _includes/masthead/buttons.html
74
75
  - _includes/masthead/title.html
75
76
  - _includes/navigation.html
76
- - _includes/toc.html
77
77
  - _includes/twitter.html
78
78
  - _layouts/default.html
79
79
  - _layouts/full.html