jekyll-theme-gitbook 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +19 -5
- data/_includes/internal/navbar.html +15 -3
- data/_sass/_content.scss +6 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e54bf31c624dd80ff5882477c5b33725cb661c1d736d90fc56642e5352b4c63
|
4
|
+
data.tar.gz: a81a57f4ba6c9dd99f9825d22f741a23c443f391e51dfc1e9cffa9419f89884c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d97756da95b9bd2d20c854240e82f16a9990024628e9ecde66d879c8bcebc75bcbb661f91d7716f8374a6822e97c42eb0aa0b361a1dae1daca7a84293d45412
|
7
|
+
data.tar.gz: 71dbbf6162164972240a7f048d6270d5a126ffa66bf8273d8d268baff7147d8c3f243dffccbd4e1dd27a21dd3cc4d6a07521ab54ce883b34caa1eb0b3b13cfaa
|
data/README.md
CHANGED
@@ -34,7 +34,7 @@ This theme is designed to be highly configurable, whilst providing sensible defa
|
|
34
34
|
If you are hosting your site on GitHub Pages then add the following line to your site's `_config.yml` file (as per [the documentation](https://docs.github.com/en/github/working-with-github-pages/adding-a-theme-to-your-github-pages-site-using-jekyll)):
|
35
35
|
|
36
36
|
```yaml
|
37
|
-
remote_theme: "adamrehn/jekyll-theme-gitbook@v0.0.
|
37
|
+
remote_theme: "adamrehn/jekyll-theme-gitbook@v0.0.5"
|
38
38
|
```
|
39
39
|
|
40
40
|
### Other hosts (e.g. GitLab Pages)
|
@@ -68,8 +68,17 @@ theme-settings:
|
|
68
68
|
collection: "categories"
|
69
69
|
|
70
70
|
|
71
|
-
#
|
72
|
-
|
71
|
+
# Navigation menu settings (OPTIONAL, only needed if you want to override the defaults)
|
72
|
+
navigation:
|
73
|
+
|
74
|
+
# Specifies whether navigation links should be generated for chapter index files that use the `chapter-index` layout (OPTIONAL, defaults to false)
|
75
|
+
indices: false
|
76
|
+
|
77
|
+
# Specifies whether the navigation links for each chapter should be output as collapsible sections using HTML <detail> tags, with chapter headings as <summary> tags (OPTIONAL, defaults to false)
|
78
|
+
collapsible: false
|
79
|
+
|
80
|
+
# When collapsible sections are enabled, specifies whether sections are collapsed by default (OPTIONAL, defaults to false)
|
81
|
+
collapsed: false
|
73
82
|
|
74
83
|
|
75
84
|
# Copyright settings for the page footer (REQUIRED)
|
@@ -128,7 +137,12 @@ Each key in this structure serves a specific purpose:
|
|
128
137
|
|
129
138
|
- `collection`: the theme uses a book metaphor to describe the structure of content. The site is broken down into a series of "chapters", each containing a series of pages. Of course, this naming convention does not make sense for all sites (for some sites, the "chapters" may in fact be referred to as sections or categories) and so the theme does not force you to adopt the name "chapters" in your filesystem structure. Instead, you can specify any [Jekyll collection](https://jekyllrb.com/docs/collections/) to act as your list of chapters, typically using one subdirectory per chapter to group pages. **You must specify the name of the Jekyll collection as a string value for this key.**
|
130
139
|
|
131
|
-
- `
|
140
|
+
- `navigation`: this key groups settings for overriding the behaviour of the site's navigation links. **This key and all of its subkeys are optional:**
|
141
|
+
|
142
|
+
- Subkey `indices`: by default, the theme only generates navigation links to each of the pages in each chapter, not to the chapter indices themselves. You can set this subkey to `true` if you would like to trigger the generation of chapter index navigation links, although note that links are only generated for chapters whose `index.html` files use the `chapter-index` layout and not for chapters whose index use the `chapter-redirect` layout.
|
143
|
+
|
144
|
+
- Subkeys `collapsible` and `collapsed`: these subkeys allow you to make the sections of the navigation menu for each chapter collapsible, and specify whether they are collapsed or expanded by default, respectively.
|
145
|
+
|
132
146
|
|
133
147
|
- `copyright`: this key groups settings related to the copyright notice that appears in the footer of all pages. **This key and the `author` and `year` subkeys are required,** whilst the `license` subkey is optional.
|
134
148
|
|
@@ -247,7 +261,7 @@ The layout you choose will determine the site's behaviour when navigating to the
|
|
247
261
|
|
248
262
|
If you choose to provide a chapter description then this will be displayed on the chapter's index page when using the `chapter-index` layout, and will also be displayed under the chapter's name if you generate a list of chapters with the `chapter-list.html` include (which is designed to be used on the front page of a site.)
|
249
263
|
|
250
|
-
If you use the `chapter-index` layout for a chapter and the global setting `theme-settings.indices` is set to `true` then a link will be generated for the chapter index in the site's navigation sidebar.
|
264
|
+
If you use the `chapter-index` layout for a chapter and the global setting `theme-settings.navigation.indices` is set to `true` then a link will be generated for the chapter index in the site's navigation sidebar.
|
251
265
|
|
252
266
|
#### Content structure: site root
|
253
267
|
|
@@ -9,17 +9,29 @@
|
|
9
9
|
{% assign pages = documents | where_exp: "page", "page.pagenum != null" | sort: "pagenum" %}
|
10
10
|
{% assign indices = documents | where_exp: "page", "page.pagenum == null" | sort: "chapnum" %}
|
11
11
|
|
12
|
+
{% assign chapter_element = "p" %}
|
13
|
+
{% if site.theme-settings.navigation.collapsible == true %}
|
14
|
+
{% assign chapter_element = "summary" %}
|
15
|
+
{% endif %}
|
16
|
+
|
12
17
|
{% for index in indices %}
|
13
|
-
|
18
|
+
|
19
|
+
{% if site.theme-settings.navigation.collapsible == true %}<details{% if site.theme-settings.navigation.collapsed != true or page.chapter == index.chapter %} open="true"{% endif %}>{% endif %}
|
20
|
+
|
21
|
+
<{{ chapter_element }} class="chapter">{% if index.icon %}{% assign components = index.url | split: "/" %}<span class="icon icon-{{ components[-2] | escape }} {{ index.icon | escape }}"></span> {% endif %}{{ index.chapter | escape }}</{{ chapter_element }}>
|
22
|
+
|
14
23
|
<ul>
|
15
|
-
{% if site.theme-settings.indices == true and index.layout == "chapter-index" %}
|
24
|
+
{% if site.theme-settings.navigation.indices == true and index.layout == "chapter-index" %}
|
16
25
|
<li{% if index.url == page.url %} class="selected"{% endif %}><a href="{{ index.url | replace: "/index", "" | relative_url | uri_escape }}">Index</a></li>
|
17
26
|
{% endif %}
|
18
27
|
{% assign chapter_pages = pages | where: "chapter", index.chapter %}
|
19
28
|
{% for p in chapter_pages %}
|
20
|
-
<li{% if p.url == page.url %} class="selected"{% endif %}><a href="{{ p.url | relative_url | uri_escape }}">{{ p.title | escape
|
29
|
+
<li{% if p.url == page.url %} class="selected"{% endif %}><a href="{{ p.url | relative_url | uri_escape }}">{{ p.title | escape }}</a></li>
|
21
30
|
{% endfor %}
|
22
31
|
</ul>
|
32
|
+
|
33
|
+
{% if site.theme-settings.navigation.collapsible == true %}</details>{% endif %}
|
34
|
+
|
23
35
|
{% endfor %}
|
24
36
|
|
25
37
|
{% include hooks/navbar-posthook.html %}
|
data/_sass/_content.scss
CHANGED
@@ -96,7 +96,11 @@ nav .chapter, .contents .heading, article .chapter, .prev-next a .label, .prev-n
|
|
96
96
|
margin: 0;
|
97
97
|
}
|
98
98
|
|
99
|
-
nav ul
|
99
|
+
nav .chapter, nav ul li {
|
100
|
+
max-width: 100%;
|
101
|
+
}
|
102
|
+
|
103
|
+
nav ul + .chapter, nav details + details {
|
100
104
|
margin-top: 2rem;
|
101
105
|
}
|
102
106
|
|
@@ -124,7 +128,7 @@ footer a, footer a:hover,
|
|
124
128
|
text-decoration: none;
|
125
129
|
}
|
126
130
|
|
127
|
-
nav ul:last-child {
|
131
|
+
nav .inner > ul:last-child, nav .inner > details:last-child {
|
128
132
|
padding-bottom: $header-height / 2;
|
129
133
|
}
|
130
134
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-theme-gitbook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Rehn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
|
-
rubygems_version: 3.3.
|
129
|
+
rubygems_version: 3.3.26
|
130
130
|
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: Gem-based Jekyll theme for documentation sites, inspired by GitBook's visual
|