jekyll-vitepress-theme 0.9.1 → 0.10.0
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 +26 -11
- data/_includes/doc_footer.html +63 -35
- data/_includes/head.html +27 -21
- data/_includes/home.html +3 -3
- data/_includes/jekyll_vitepress/head_end.html +1 -0
- data/_includes/local_nav.html +4 -3
- data/_includes/nav.html +181 -87
- data/_includes/sidebar.html +4 -3
- data/_layouts/default.html +22 -15
- data/assets/css/vitepress-overrides.css +376 -72
- data/assets/js/vitepress-theme.js +246 -5
- data/lib/jekyll/vitepress_theme/hooks.rb +35 -19
- data/lib/jekyll/vitepress_theme/version.rb +1 -1
- metadata +5 -5
- data/_includes/vp_slots/head.html +0 -1
- /data/_includes/{vp_slots/doc_footer.html → jekyll_vitepress/doc_footer_end.html} +0 -0
- /data/_includes/{vp_slots/layout_bottom.html → jekyll_vitepress/layout_end.html} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c72127aab4edfc3683419977efbdde3e174b7d70970be4253fbccdcb6c32f8ea
|
|
4
|
+
data.tar.gz: 51bf7450c3ab178de305c5d81a1dccefa25fdfc6555a7d2fa2b7a6ecc5ef543a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cf130d94547b75b6ed9cb2b9e42518dbb8fd3294ab5b90f6c8f7901fc3b6b84a4655adb49b04f3051cf09fafb3a338f701d8a9bfddf445ead55b4cf894a3272f
|
|
7
|
+
data.tar.gz: f12ebaec4d69c77e9d6b2d5a6ddfd24f43fd6e86868d7f611d977fac62bce5d159db268f71e2032eeee2d66b85be8bb409635797e903b9cc3ceed1503cf3f486
|
data/README.md
CHANGED
|
@@ -7,10 +7,11 @@ A reusable Jekyll theme gem that reproduces the VitePress default docs experienc
|
|
|
7
7
|
- VitePress-style layout structure (top nav, sidebar, outline, doc footer)
|
|
8
8
|
- Appearance toggle with `auto -> dark -> light`
|
|
9
9
|
- Local search modal (`/`, `Ctrl/Cmd+K`, `Cmd+K`)
|
|
10
|
+
- Optional GitHub star button with live count (`jekyll_vitepress.github_star`)
|
|
10
11
|
- Code block copy button, language labels, file-title bars and icons
|
|
11
|
-
- Rouge-native syntax theme config (`
|
|
12
|
+
- Rouge-native syntax theme config (`jekyll_vitepress.syntax.light_theme/dark_theme`)
|
|
12
13
|
- Last-updated hook via plugin
|
|
13
|
-
-
|
|
14
|
+
- Jekyll-native extension hooks (`_includes/jekyll_vitepress/head_end.html`, `doc_footer_end.html`, `layout_end.html`)
|
|
14
15
|
|
|
15
16
|
## Installation
|
|
16
17
|
|
|
@@ -28,17 +29,30 @@ plugins:
|
|
|
28
29
|
- jekyll-vitepress-theme
|
|
29
30
|
```
|
|
30
31
|
|
|
31
|
-
3. Add `
|
|
32
|
+
3. Add theme behavior config in `_config.yml`:
|
|
32
33
|
|
|
33
34
|
```yaml
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
jekyll_vitepress:
|
|
36
|
+
branding:
|
|
37
|
+
site_title: My Docs
|
|
38
|
+
syntax:
|
|
39
|
+
light_theme: github
|
|
40
|
+
dark_theme: github.dark
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
4. Add navigation and sidebar data files:
|
|
44
|
+
|
|
45
|
+
```yaml
|
|
46
|
+
# _data/navigation.yml
|
|
47
|
+
- title: Guide
|
|
48
|
+
url: /getting-started/
|
|
49
|
+
collections: [introduction, core_features, advanced]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
# _data/sidebar.yml
|
|
54
|
+
- title: Getting Started
|
|
55
|
+
collection: introduction
|
|
42
56
|
```
|
|
43
57
|
|
|
44
58
|
## Local development (this repo)
|
|
@@ -80,6 +94,7 @@ See docs pages:
|
|
|
80
94
|
- [Getting Started](/getting-started/)
|
|
81
95
|
- [Configuration Reference](/configuration-reference/)
|
|
82
96
|
- [Frontmatter Reference](/frontmatter-reference/)
|
|
97
|
+
- [VitePress Parity and Extensions](/vitepress-parity-and-extensions/)
|
|
83
98
|
|
|
84
99
|
## Release a gem
|
|
85
100
|
|
data/_includes/doc_footer.html
CHANGED
|
@@ -1,34 +1,45 @@
|
|
|
1
|
+
{% assign theme = site.jekyll_vitepress %}
|
|
2
|
+
{% assign page_theme = page.jekyll_vitepress %}
|
|
3
|
+
|
|
4
|
+
{% assign edit_link_config = theme.edit_link %}
|
|
1
5
|
{% assign edit_link_enabled = true %}
|
|
2
|
-
{% if
|
|
6
|
+
{% if edit_link_config and edit_link_config.enabled == false %}
|
|
7
|
+
{% assign edit_link_enabled = false %}
|
|
8
|
+
{% endif %}
|
|
9
|
+
{% if page_theme.edit_link == false %}
|
|
3
10
|
{% assign edit_link_enabled = false %}
|
|
4
11
|
{% endif %}
|
|
5
12
|
|
|
6
13
|
{% assign edit_link = nil %}
|
|
7
|
-
{% if edit_link_enabled and
|
|
8
|
-
{% assign edit_link =
|
|
14
|
+
{% if edit_link_enabled and edit_link_config and edit_link_config.pattern and page.path %}
|
|
15
|
+
{% assign edit_link = edit_link_config.pattern | replace: ':path', page.path %}
|
|
9
16
|
{% endif %}
|
|
10
17
|
|
|
11
18
|
{% assign edit_link_text = 'Edit this page on GitHub' %}
|
|
12
|
-
{% if
|
|
13
|
-
{% assign edit_link_text =
|
|
19
|
+
{% if edit_link_config and edit_link_config.text %}
|
|
20
|
+
{% assign edit_link_text = edit_link_config.text %}
|
|
14
21
|
{% endif %}
|
|
15
22
|
|
|
23
|
+
{% assign last_updated_config = theme.last_updated %}
|
|
16
24
|
{% assign last_updated_enabled = true %}
|
|
17
|
-
{% if
|
|
25
|
+
{% if last_updated_config and last_updated_config.enabled == false %}
|
|
26
|
+
{% assign last_updated_enabled = false %}
|
|
27
|
+
{% endif %}
|
|
28
|
+
{% if page_theme.last_updated == false %}
|
|
18
29
|
{% assign last_updated_enabled = false %}
|
|
19
30
|
{% endif %}
|
|
20
31
|
|
|
21
32
|
{% assign last_updated_text = 'Last updated' %}
|
|
22
|
-
{% if
|
|
23
|
-
{% assign last_updated_text =
|
|
33
|
+
{% if last_updated_config and last_updated_config.text %}
|
|
34
|
+
{% assign last_updated_text = last_updated_config.text %}
|
|
24
35
|
{% endif %}
|
|
25
36
|
|
|
26
37
|
{% assign last_updated_format = '%-d %b %Y, %H:%M' %}
|
|
27
|
-
{% if
|
|
28
|
-
{% assign last_updated_format =
|
|
38
|
+
{% if last_updated_config and last_updated_config.format %}
|
|
39
|
+
{% assign last_updated_format = last_updated_config.format %}
|
|
29
40
|
{% endif %}
|
|
30
41
|
|
|
31
|
-
{% assign last_updated_at =
|
|
42
|
+
{% assign last_updated_at = page_theme.last_updated_at | default: nil %}
|
|
32
43
|
{% assign show_last_updated = false %}
|
|
33
44
|
{% if last_updated_enabled and last_updated_at %}
|
|
34
45
|
{% assign show_last_updated = true %}
|
|
@@ -52,8 +63,12 @@
|
|
|
52
63
|
{% endfor %}
|
|
53
64
|
{% endif %}
|
|
54
65
|
|
|
66
|
+
{% assign doc_footer_config = theme.doc_footer %}
|
|
55
67
|
{% assign doc_footer_enabled = true %}
|
|
56
|
-
{% if
|
|
68
|
+
{% if doc_footer_config and doc_footer_config.enabled == false %}
|
|
69
|
+
{% assign doc_footer_enabled = false %}
|
|
70
|
+
{% endif %}
|
|
71
|
+
{% if page_theme.doc_footer == false %}
|
|
57
72
|
{% assign doc_footer_enabled = false %}
|
|
58
73
|
{% endif %}
|
|
59
74
|
|
|
@@ -62,39 +77,39 @@
|
|
|
62
77
|
{% assign prev_desc = 'Previous page' %}
|
|
63
78
|
{% assign next_desc = 'Next page' %}
|
|
64
79
|
|
|
65
|
-
{% if
|
|
66
|
-
{% if
|
|
80
|
+
{% if doc_footer_config %}
|
|
81
|
+
{% if doc_footer_config.previous_label == false %}
|
|
67
82
|
{% assign prev_enabled = false %}
|
|
68
|
-
{% elsif
|
|
69
|
-
{% assign prev_desc =
|
|
83
|
+
{% elsif doc_footer_config.previous_label %}
|
|
84
|
+
{% assign prev_desc = doc_footer_config.previous_label %}
|
|
70
85
|
{% endif %}
|
|
71
86
|
|
|
72
|
-
{% if
|
|
87
|
+
{% if doc_footer_config.next_label == false %}
|
|
73
88
|
{% assign next_enabled = false %}
|
|
74
|
-
{% elsif
|
|
75
|
-
{% assign next_desc =
|
|
89
|
+
{% elsif doc_footer_config.next_label %}
|
|
90
|
+
{% assign next_desc = doc_footer_config.next_label %}
|
|
76
91
|
{% endif %}
|
|
77
92
|
{% endif %}
|
|
78
93
|
|
|
79
|
-
{% if
|
|
80
|
-
{% if
|
|
94
|
+
{% if page_theme.doc_footer and page_theme.doc_footer != false %}
|
|
95
|
+
{% if page_theme.doc_footer.prev == false %}
|
|
81
96
|
{% assign prev_enabled = false %}
|
|
82
|
-
{% elsif
|
|
83
|
-
{% assign prev_desc =
|
|
97
|
+
{% elsif page_theme.doc_footer.prev %}
|
|
98
|
+
{% assign prev_desc = page_theme.doc_footer.prev %}
|
|
84
99
|
{% endif %}
|
|
85
100
|
|
|
86
|
-
{% if
|
|
101
|
+
{% if page_theme.doc_footer.next == false %}
|
|
87
102
|
{% assign next_enabled = false %}
|
|
88
|
-
{% elsif
|
|
89
|
-
{% assign next_desc =
|
|
103
|
+
{% elsif page_theme.doc_footer.next %}
|
|
104
|
+
{% assign next_desc = page_theme.doc_footer.next %}
|
|
90
105
|
{% endif %}
|
|
91
106
|
{% endif %}
|
|
92
107
|
|
|
93
|
-
{% if
|
|
108
|
+
{% if page_theme.prev == false %}
|
|
94
109
|
{% assign prev_enabled = false %}
|
|
95
110
|
{% endif %}
|
|
96
111
|
|
|
97
|
-
{% if
|
|
112
|
+
{% if page_theme.next == false %}
|
|
98
113
|
{% assign next_enabled = false %}
|
|
99
114
|
{% endif %}
|
|
100
115
|
|
|
@@ -104,9 +119,9 @@
|
|
|
104
119
|
{% assign next_title = nil %}
|
|
105
120
|
|
|
106
121
|
{% if prev_enabled %}
|
|
107
|
-
{% if
|
|
108
|
-
{% assign prev_url =
|
|
109
|
-
{% assign prev_title =
|
|
122
|
+
{% if page_theme.prev and page_theme.prev != false and page_theme.prev.link %}
|
|
123
|
+
{% assign prev_url = page_theme.prev.link %}
|
|
124
|
+
{% assign prev_title = page_theme.prev.text | default: page_theme.prev.link %}
|
|
110
125
|
{% elsif prev_doc %}
|
|
111
126
|
{% assign prev_url = prev_doc.url | relative_url %}
|
|
112
127
|
{% assign prev_title = prev_doc.title %}
|
|
@@ -114,9 +129,9 @@
|
|
|
114
129
|
{% endif %}
|
|
115
130
|
|
|
116
131
|
{% if next_enabled %}
|
|
117
|
-
{% if
|
|
118
|
-
{% assign next_url =
|
|
119
|
-
{% assign next_title =
|
|
132
|
+
{% if page_theme.next and page_theme.next != false and page_theme.next.link %}
|
|
133
|
+
{% assign next_url = page_theme.next.link %}
|
|
134
|
+
{% assign next_title = page_theme.next.text | default: page_theme.next.link %}
|
|
120
135
|
{% elsif next_doc %}
|
|
121
136
|
{% assign next_url = next_doc.url | relative_url %}
|
|
122
137
|
{% assign next_title = next_doc.title %}
|
|
@@ -132,8 +147,17 @@
|
|
|
132
147
|
{% assign show_next_link = true %}
|
|
133
148
|
{% endif %}
|
|
134
149
|
|
|
150
|
+
{% capture doc_footer_end_markup %}
|
|
151
|
+
{% include jekyll_vitepress/doc_footer_end.html %}
|
|
152
|
+
{% endcapture %}
|
|
153
|
+
{% assign doc_footer_end_markup = doc_footer_end_markup | strip %}
|
|
154
|
+
{% assign show_doc_footer_end = false %}
|
|
155
|
+
{% if doc_footer_end_markup != '' %}
|
|
156
|
+
{% assign show_doc_footer_end = true %}
|
|
157
|
+
{% endif %}
|
|
158
|
+
|
|
135
159
|
{% assign show_footer = false %}
|
|
136
|
-
{% if edit_link or show_last_updated or show_prev_link or show_next_link %}
|
|
160
|
+
{% if edit_link or show_last_updated or show_prev_link or show_next_link or show_doc_footer_end %}
|
|
137
161
|
{% assign show_footer = true %}
|
|
138
162
|
{% endif %}
|
|
139
163
|
|
|
@@ -180,5 +204,9 @@
|
|
|
180
204
|
</div>
|
|
181
205
|
</nav>
|
|
182
206
|
{% endif %}
|
|
207
|
+
|
|
208
|
+
{% if show_doc_footer_end %}
|
|
209
|
+
{{ doc_footer_end_markup }}
|
|
210
|
+
{% endif %}
|
|
183
211
|
</footer>
|
|
184
212
|
{% endif %}
|
data/_includes/head.html
CHANGED
|
@@ -4,12 +4,18 @@
|
|
|
4
4
|
{% assign page_title = page.title | default: site.title %}
|
|
5
5
|
<title>{% if page_title and page_title != site.title %}{{ page_title }} | {{ site.title }}{% else %}{{ site.title }}{% endif %}</title>
|
|
6
6
|
<meta name="description" content="{{ page.description | default: site.description | escape }}">
|
|
7
|
-
|
|
8
|
-
{% assign
|
|
9
|
-
{%
|
|
7
|
+
|
|
8
|
+
{% assign theme = site.jekyll_vitepress %}
|
|
9
|
+
{% assign branding = theme.branding %}
|
|
10
|
+
{% assign logo = branding.logo %}
|
|
11
|
+
<link rel="icon" href="{{ logo.default | default: logo.light | default: '/vitepress-logo-mini.svg' | relative_url }}">
|
|
12
|
+
|
|
13
|
+
{% assign typography = theme.typography %}
|
|
14
|
+
{% assign google_fonts_url = typography.google_fonts_url | default: 'https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap' %}
|
|
15
|
+
{% if google_fonts_url and google_fonts_url != false and google_fonts_url != '' %}
|
|
10
16
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
11
17
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
12
|
-
<link rel="stylesheet" href="{{
|
|
18
|
+
<link rel="stylesheet" href="{{ google_fonts_url }}">
|
|
13
19
|
{% endif %}
|
|
14
20
|
|
|
15
21
|
<script>
|
|
@@ -41,27 +47,27 @@
|
|
|
41
47
|
<link rel="stylesheet" href="{{ '/assets/css/vp-icons.css' | relative_url }}">
|
|
42
48
|
<link rel="stylesheet" href="{{ '/assets/css/vitepress-overrides.css' | relative_url }}">
|
|
43
49
|
|
|
44
|
-
{% assign
|
|
45
|
-
{% assign
|
|
46
|
-
{% assign
|
|
47
|
-
{% assign
|
|
50
|
+
{% assign body_font_family = typography.body_font_family %}
|
|
51
|
+
{% assign code_font_family = typography.code_font_family %}
|
|
52
|
+
{% assign token_vars_light = theme.tokens.light %}
|
|
53
|
+
{% assign token_vars_dark = theme.tokens.dark %}
|
|
48
54
|
{% assign has_theme_var_overrides = false %}
|
|
49
|
-
{% if
|
|
55
|
+
{% if body_font_family or code_font_family %}
|
|
50
56
|
{% assign has_theme_var_overrides = true %}
|
|
51
57
|
{% endif %}
|
|
52
|
-
{% if
|
|
58
|
+
{% if token_vars_light and token_vars_light.size > 0 %}
|
|
53
59
|
{% assign has_theme_var_overrides = true %}
|
|
54
60
|
{% endif %}
|
|
55
|
-
{% if
|
|
61
|
+
{% if token_vars_dark and token_vars_dark.size > 0 %}
|
|
56
62
|
{% assign has_theme_var_overrides = true %}
|
|
57
63
|
{% endif %}
|
|
58
64
|
{% if has_theme_var_overrides %}
|
|
59
65
|
<style id="vp-theme-vars">
|
|
60
66
|
:root {
|
|
61
|
-
{% if
|
|
62
|
-
{% if
|
|
63
|
-
{% if
|
|
64
|
-
{% for pair in
|
|
67
|
+
{% if body_font_family %}--vp-font-family-base: {{ body_font_family }};{% endif %}
|
|
68
|
+
{% if code_font_family %}--vp-font-family-mono: {{ code_font_family }};{% endif %}
|
|
69
|
+
{% if token_vars_light %}
|
|
70
|
+
{% for pair in token_vars_light %}
|
|
65
71
|
{% assign css_var_name = pair[0] | strip %}
|
|
66
72
|
{% if css_var_name contains '--' %}
|
|
67
73
|
{{ css_var_name }}: {{ pair[1] }};
|
|
@@ -71,9 +77,9 @@
|
|
|
71
77
|
{% endfor %}
|
|
72
78
|
{% endif %}
|
|
73
79
|
}
|
|
74
|
-
{% if
|
|
80
|
+
{% if token_vars_dark and token_vars_dark.size > 0 %}
|
|
75
81
|
.dark {
|
|
76
|
-
{% for pair in
|
|
82
|
+
{% for pair in token_vars_dark %}
|
|
77
83
|
{% assign css_var_name = pair[0] | strip %}
|
|
78
84
|
{% if css_var_name contains '--' %}
|
|
79
85
|
{{ css_var_name }}: {{ pair[1] }};
|
|
@@ -86,13 +92,13 @@
|
|
|
86
92
|
</style>
|
|
87
93
|
{% endif %}
|
|
88
94
|
|
|
89
|
-
{% assign
|
|
90
|
-
{% if
|
|
95
|
+
{% assign rouge_css = theme._generated_rouge_css %}
|
|
96
|
+
{% if rouge_css and rouge_css != '' %}
|
|
91
97
|
<style id="vp-rouge-theme">
|
|
92
|
-
{{
|
|
98
|
+
{{ rouge_css }}
|
|
93
99
|
</style>
|
|
94
100
|
{% endif %}
|
|
95
101
|
|
|
96
|
-
{% include
|
|
102
|
+
{% include jekyll_vitepress/head_end.html %}
|
|
97
103
|
<script src="{{ '/assets/js/vitepress-theme.js' | relative_url }}" defer></script>
|
|
98
104
|
</head>
|
data/_includes/home.html
CHANGED
|
@@ -254,9 +254,9 @@
|
|
|
254
254
|
{% if feature.details %}
|
|
255
255
|
<p class="details">{{ feature.details }}</p>
|
|
256
256
|
{% endif %}
|
|
257
|
-
{% if feature.
|
|
257
|
+
{% if feature.link_text %}
|
|
258
258
|
<div class="link-text">
|
|
259
|
-
<p class="link-text-value">{{ feature.
|
|
259
|
+
<p class="link-text-value">{{ feature.link_text }} <span class="vpi-arrow-right link-text-icon"></span></p>
|
|
260
260
|
</div>
|
|
261
261
|
{% endif %}
|
|
262
262
|
</article>
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
{% endif %}
|
|
303
303
|
|
|
304
304
|
{% if home_body != '' %}
|
|
305
|
-
{% if page.
|
|
305
|
+
{% if page.markdown_styles == false %}
|
|
306
306
|
{{ include.content }}
|
|
307
307
|
{% else %}
|
|
308
308
|
<div class="VPHomeContent">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!-- Optional head hook. Override in your site at _includes/jekyll_vitepress/head_end.html. -->
|
data/_includes/local_nav.html
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
{% assign labels = site.jekyll_vitepress.labels %}
|
|
1
2
|
<div class="VPLocalNav has-sidebar" id="vp-local-nav">
|
|
2
3
|
<div class="container">
|
|
3
4
|
<button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" id="vp-local-menu-button">
|
|
4
5
|
<span class="vpi-align-left menu-icon"></span>
|
|
5
|
-
<span class="menu-text">{{
|
|
6
|
+
<span class="menu-text">{{ labels.sidebar_menu | default: 'Menu' }}</span>
|
|
6
7
|
</button>
|
|
7
8
|
|
|
8
9
|
<div class="VPLocalNavOutlineDropdown" id="vp-local-outline-dropdown">
|
|
9
10
|
<button type="button" id="vp-local-outline-button">
|
|
10
|
-
<span class="menu-text">{{
|
|
11
|
+
<span class="menu-text">{{ labels.outline | default: 'On this page' }}</span>
|
|
11
12
|
<span class="vpi-chevron-right icon"></span>
|
|
12
13
|
</button>
|
|
13
14
|
<div class="items" hidden>
|
|
14
15
|
<div class="header">
|
|
15
|
-
<a class="top-link" href="#top" id="vp-local-top-link">{{
|
|
16
|
+
<a class="top-link" href="#top" id="vp-local-top-link">{{ labels.return_to_top | default: 'Return to top' }}</a>
|
|
16
17
|
</div>
|
|
17
18
|
<div class="outline">
|
|
18
19
|
<ul class="VPDocOutlineItem"></ul>
|