jekyll-vitepress-theme 1.2.3 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a31e9bfb6831ab0c8bbd1376dac09efbf7baaaa592a2da90ddaafe38b2448ee
4
- data.tar.gz: c038fc1ce886d9b3971492d60faac20071bbd979d1450c2691ddf7df3eac537b
3
+ metadata.gz: 647316f68a7edd8f657e980003c6b064bab2c69b0e1f279047cd6bd9199c5102
4
+ data.tar.gz: 3a9e1bed45e86b11d8df502f9f1f2916191965ed377ceedaa7df0f1cec15725e
5
5
  SHA512:
6
- metadata.gz: faa3c8d2d987ce3e5b394d89a3bfa74058738fdd1e937289173204930ceedf3c38c62358fdb3022efdfeda9f947a1343e7515e4562558a41da482d7513029c9a
7
- data.tar.gz: 947b2f003a53fab3fb97b7b53b0daabb9542a43f2c259470a9c218b3afff022acbb4cc96782cf578fa39ab21caf9de449c0eed9ce4bde1ffbd2d4ddd0230a7ed
6
+ metadata.gz: 6539cb54e120f1cfc45506c1f94e844ae35d21048908a46aa9865a05ad35adb12d24db70a5750ebddb41f6278c39bd8c35ae15a39a718685c4905058e2014d48
7
+ data.tar.gz: e4e66dcbb3631ae7cdf5f6751e6ba47e6da64ec3e97f9350c1ef53e6b08e84a13ba78bf9d579376a2142cc1217d93ea94ba831e7c4ed66df1b65a01cb302283c
data/README.md CHANGED
@@ -1,47 +1,44 @@
1
- # Jekyll VitePress Theme
2
-
3
- A reusable Jekyll theme gem that reproduces the VitePress default docs experience.
1
+ <div align="center">
4
2
 
5
- ## What it includes
3
+ <img src="assets/images/theme/vitepress-logo-large.svg" alt="Jekyll VitePress Theme" height="96">
6
4
 
7
- - VitePress-style layout structure (top nav, sidebar, outline, doc footer)
8
- - Appearance toggle with `auto -> dark -> light`
9
- - Local search modal (`/`, `Ctrl/Cmd+K`, `Cmd+K`)
10
- - Automatic `/search.json` generation for the home page and sidebar collections
11
- - Optional GitHub star button with live count (`jekyll_vitepress.github_star`)
12
- - Code block copy button, language labels, file-title bars and icons
13
- - Page-level "Copy page" split button with raw Markdown copy + plain `.md` view (`jekyll_vitepress.copy_page`, enabled by default)
14
- - Rouge-native syntax theme config (`jekyll_vitepress.syntax.light_theme/dark_theme`)
15
- - Last-updated hook via plugin
16
- - Jekyll-native extension hooks (`_includes/jekyll_vitepress/head_end.html`, `doc_footer_end.html`, `layout_end.html`)
5
+ # Jekyll VitePress Theme
17
6
 
18
- ## Screenshots
7
+ <strong>Turbo-fast documentation for Jekyll projects.</strong>
19
8
 
20
- ### Home (Light)
9
+ [![Gem Version](https://img.shields.io/gem/v/jekyll-vitepress-theme.svg)](https://rubygems.org/gems/jekyll-vitepress-theme)
10
+ [![CI](https://github.com/crmne/jekyll-vitepress-theme/actions/workflows/main.yml/badge.svg)](https://github.com/crmne/jekyll-vitepress-theme/actions/workflows/main.yml)
11
+ [![Docs](https://img.shields.io/badge/docs-jekyll--vitepress.dev-blue)](https://jekyll-vitepress.dev)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
21
13
 
22
- ![Home light mode](assets/images/screenshots/home-light.png)
14
+ </div>
23
15
 
24
- ### Home (Dark)
16
+ ---
25
17
 
26
- ![Home dark mode](assets/images/screenshots/home-dark.png)
18
+ Ruby projects should not need a JavaScript app just to get beautiful, fast docs.
27
19
 
28
- ### Getting Started (Light)
20
+ `jekyll-vitepress-theme` brings the VitePress documentation experience to Jekyll: the familiar nav, sidebar, outline, search, code blocks, dark mode, and polished default theme, packaged as a Ruby gem.
29
21
 
30
- ![Getting Started light mode](assets/images/screenshots/getting-started-light.png)
22
+ The unusual part is navigation. Internal docs links use Turbo Frames, so page changes feel close to VitePress while the site remains plain Jekyll output: Markdown, Liquid, YAML, Ruby, and static files.
31
23
 
32
- ### Getting Started (Dark)
24
+ ## Why Use It
33
25
 
34
- ![Getting Started dark mode](assets/images/screenshots/getting-started-dark.png)
26
+ - **VitePress-like UX:** top nav, persistent sidebar, right outline, doc footer pager, search modal, and theme toggle.
27
+ - **Turbo page navigation:** only the docs content frame swaps, so the shell stays in place and page changes feel fast.
28
+ - **Jekyll-native setup:** configure everything with `_config.yml`, `_data/*.yml`, collections, includes, and frontmatter.
29
+ - **Ruby syntax pipeline:** Rouge powers light and dark syntax themes without a separate JavaScript build.
30
+ - **Static deployment:** build once with Jekyll and publish to GitHub Pages, any CDN, or any static host.
31
+ - **Useful extras:** GitHub star count, version selector, last-updated labels, copy buttons, and "Copy page" Markdown export.
35
32
 
36
- ## Installation
33
+ ## Quick Start
37
34
 
38
- 1. Add the gem to your `Gemfile`:
35
+ Add the gem:
39
36
 
40
- ```ruby
37
+ ```rb
41
38
  gem "jekyll-vitepress-theme"
42
39
  ```
43
40
 
44
- 2. Enable it in `_config.yml`:
41
+ Enable the theme and plugin:
45
42
 
46
43
  ```yaml
47
44
  theme: jekyll-vitepress-theme
@@ -49,7 +46,7 @@ plugins:
49
46
  - jekyll-vitepress-theme
50
47
  ```
51
48
 
52
- 3. Add theme behavior config in `_config.yml`:
49
+ Add basic theme config:
53
50
 
54
51
  ```yaml
55
52
  jekyll_vitepress:
@@ -60,67 +57,58 @@ jekyll_vitepress:
60
57
  dark_theme: github.dark
61
58
  ```
62
59
 
63
- 4. Add navigation and sidebar data files:
60
+ Define navigation and sidebar data:
64
61
 
65
62
  ```yaml
66
63
  # _data/navigation.yml
67
64
  - title: Guide
68
65
  url: /getting-started/
69
- collections: [introduction, core_features, advanced]
66
+ collections: [guides]
70
67
  ```
71
68
 
72
69
  ```yaml
73
70
  # _data/sidebar.yml
74
- - title: Getting Started
75
- collection: introduction
71
+ - title: Guide
72
+ collection: guides
76
73
  ```
77
74
 
78
- ## Local development (this repo)
75
+ Run Jekyll:
79
76
 
80
- ```bash
77
+ ```sh
81
78
  bundle install
82
- npm install
83
79
  bundle exec jekyll serve --livereload
84
80
  ```
85
81
 
86
- Open `http://127.0.0.1:4000`.
87
-
88
- ## Local Quality Gates
89
-
90
- ```bash
91
- # one-shot verification
92
- bundle exec rake verify
82
+ ## Screenshots
93
83
 
94
- # regenerate built-in social icon assets after changing icon list
95
- npm run build:social-icons
84
+ | Home | Docs |
85
+ | --- | --- |
86
+ | ![Home page in light mode](assets/images/screenshots/home-light.png) | ![Docs page in light mode](assets/images/screenshots/getting-started-light.png) |
96
87
 
97
- # install and run git hooks
98
- bundle exec overcommit --install
99
- bundle exec overcommit --sign pre-commit
100
- bundle exec overcommit --sign pre-push
101
- bundle exec overcommit --run
102
- ```
88
+ ## Docs
103
89
 
104
- ## Docs deployment (this repo)
90
+ Read the full documentation at **[jekyll-vitepress.dev](https://jekyll-vitepress.dev)**.
105
91
 
106
- - `master` deploys a single docs site at `/`
107
- - No secondary version paths are published in default mode (`/latest/`, `/v/*`, `/next/`)
108
- - Optional multi-version deployment is documented in [_advanced/deployment.md](_advanced/deployment.md)
92
+ Start here:
109
93
 
110
- ## Theme configuration
94
+ - [Getting Started](https://jekyll-vitepress.dev/getting-started/)
95
+ - [Configuration](https://jekyll-vitepress.dev/configuration/)
96
+ - [Navigation and Layout](https://jekyll-vitepress.dev/navigation-layout/)
97
+ - [Search and Outline](https://jekyll-vitepress.dev/search-and-outline/)
98
+ - [Configuration Reference](https://jekyll-vitepress.dev/configuration-reference/)
111
99
 
112
- See docs pages:
100
+ ## Development
113
101
 
114
- - [Getting Started](/getting-started/)
115
- - [Configuration Reference](/configuration-reference/)
116
- - [Frontmatter Reference](/frontmatter-reference/)
117
- - [VitePress Parity and Extensions](/vitepress-parity-and-extensions/)
102
+ ```sh
103
+ bundle install
104
+ npm install
105
+ bundle exec jekyll serve --livereload
106
+ ```
118
107
 
119
- ## Release a gem
108
+ Run the local verification suite:
120
109
 
121
- ```bash
122
- gem build jekyll-vitepress-theme.gemspec
123
- gem push jekyll-vitepress-theme-<version>.gem
110
+ ```sh
111
+ bundle exec rake verify
124
112
  ```
125
113
 
126
114
  ## License
@@ -187,7 +187,7 @@
187
187
 
188
188
  <div class="pager">
189
189
  {% if show_prev_link %}
190
- <a class="VPLink link pager-link prev" href="{{ prev_url }}">
190
+ <a class="VPLink link pager-link prev" href="{{ prev_url }}" data-turbo-frame="vp-content-frame" data-turbo-action="advance">
191
191
  <span class="desc">{{ prev_desc }}</span>
192
192
  <span class="title">{{ prev_title }}</span>
193
193
  </a>
@@ -196,7 +196,7 @@
196
196
 
197
197
  <div class="pager">
198
198
  {% if show_next_link %}
199
- <a class="VPLink link pager-link next" href="{{ next_url }}">
199
+ <a class="VPLink link pager-link next" href="{{ next_url }}" data-turbo-frame="vp-content-frame" data-turbo-action="advance">
200
200
  <span class="desc">{{ next_desc }}</span>
201
201
  <span class="title">{{ next_title }}</span>
202
202
  </a>
data/_includes/head.html CHANGED
@@ -100,5 +100,6 @@
100
100
  {% endif %}
101
101
 
102
102
  {% include jekyll_vitepress/head_end.html %}
103
+ <script src="{{ '/assets/vendor/turbo.js' | relative_url }}" defer></script>
103
104
  <script src="{{ '/assets/js/vitepress-theme.js' | relative_url }}" defer></script>
104
105
  </head>
data/_includes/home.html CHANGED
@@ -252,7 +252,7 @@
252
252
 
253
253
  <h2 class="title">{{ feature.title }}</h2>
254
254
  {% if feature.details %}
255
- <p class="details">{{ feature.details }}</p>
255
+ <p class="details">{{ feature.details | markdownify | remove: '<p>' | remove: '</p>' }}</p>
256
256
  {% endif %}
257
257
  {% if feature.link_text %}
258
258
  <div class="link-text">
data/_includes/nav.html CHANGED
@@ -80,7 +80,7 @@
80
80
  {% elsif page.url == item.url %}
81
81
  {% assign is_active = true %}
82
82
  {% endif %}
83
- <a class="VPLink link VPNavBarMenuLink{% if is_active %} active{% endif %}" href="{{ item.url | relative_url }}">
83
+ <a class="VPLink link VPNavBarMenuLink{% if is_active %} active{% endif %}" href="{{ item.url | relative_url }}" data-vp-nav-link{% if item.collections %} data-collections="{{ item.collections | join: '|' }}"{% endif %}{% if include.has_sidebar and item.collections %} data-turbo="true" data-turbo-frame="vp-content-frame" data-turbo-action="advance"{% endif %}>
84
84
  <span>{{ item.title }}</span>
85
85
  </a>
86
86
  {% endfor %}
@@ -241,7 +241,7 @@
241
241
  {% elsif page.url == item.url %}
242
242
  {% assign is_active = true %}
243
243
  {% endif %}
244
- <a class="VPLink link VPNavScreenMenuLink{% if is_active %} active{% endif %}" href="{{ item.url | relative_url }}">
244
+ <a class="VPLink link VPNavScreenMenuLink{% if is_active %} active{% endif %}" href="{{ item.url | relative_url }}" data-vp-nav-link{% if item.collections %} data-collections="{{ item.collections | join: '|' }}"{% endif %}{% if include.has_sidebar and item.collections %} data-turbo="true" data-turbo-frame="vp-content-frame" data-turbo-action="advance"{% endif %}>
245
245
  <span>{{ item.title }}</span>
246
246
  </a>
247
247
  {% endfor %}
@@ -1,4 +1,4 @@
1
- <div class="VPSearch" id="vp-search" data-search-index-url="{{ '/search.json' | relative_url }}" hidden>
1
+ <div class="VPSearch" id="vp-search" data-search-index-url="{{ '/search.json' | relative_url }}"{% if page.collection %} data-search-frame-target="vp-content-frame"{% endif %} hidden>
2
2
  <div class="VPSearchBackdrop" id="vp-search-backdrop"></div>
3
3
 
4
4
  <div class="VPSearchDialog" role="dialog" aria-modal="true" aria-labelledby="vp-search-label">
@@ -15,7 +15,7 @@
15
15
  {% endfor %}
16
16
 
17
17
  <div class="group no-transition">
18
- <section class="VPSidebarItem level-0 collapsible{% if has_active %} has-active{% endif %}">
18
+ <section class="VPSidebarItem level-0 collapsible{% if has_active %} has-active{% endif %}" data-vp-sidebar-group data-collection="{{ group.collection }}">
19
19
  <div class="item" role="button" tabindex="0">
20
20
  <div class="indicator"></div>
21
21
  <h2 class="text">{{ group.title }}</h2>
@@ -33,7 +33,7 @@
33
33
  <div class="VPSidebarItem level-1 is-link{% if active %} is-active{% endif %}">
34
34
  <div class="item">
35
35
  <div class="indicator"></div>
36
- <a class="VPLink link link" href="{{ doc.url | relative_url }}">
36
+ <a class="VPLink link link" href="{{ doc.url | relative_url }}" data-vp-sidebar-link data-turbo="true" data-turbo-frame="vp-content-frame" data-turbo-action="advance">
37
37
  <p class="text">{{ doc.title }}</p>
38
38
  </a>
39
39
  </div>
@@ -31,62 +31,69 @@
31
31
 
32
32
  <div class="VPContent{% if has_sidebar %} has-sidebar{% endif %}{% if is_home %} is-home{% endif %}" id="VPContent">
33
33
  {% if has_sidebar %}
34
- <div class="VPDoc has-sidebar has-aside">
35
- <div class="container">
36
- <div class="aside">
37
- <div class="aside-curtain"></div>
38
- <div class="aside-container">
39
- <div class="aside-content">
40
- <div class="VPDocAside">
41
- <nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline has-outline" id="vp-doc-outline">
42
- <div class="content">
43
- <div class="outline-marker" id="vp-outline-marker"></div>
44
- <div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading">{{ theme.labels.outline | default: 'On this page' }}</div>
45
- <ul class="VPDocOutlineItem root"></ul>
46
- </div>
47
- </nav>
48
- <div class="spacer"></div>
34
+ {% assign frame_page_title = site.title %}
35
+ {% if page.title and page.title != site.title %}
36
+ {% capture frame_page_title %}{{ page.title }} | {{ site.title }}{% endcapture %}
37
+ {% endif %}
38
+ <turbo-frame id="vp-content-frame" target="_top">
39
+ <div id="vp-page-state" hidden data-title="{{ frame_page_title | strip | escape }}" data-url="{{ page.url | relative_url }}" data-collection="{{ page.collection | default: '' | escape }}"></div>
40
+ <div class="VPDoc has-sidebar has-aside">
41
+ <div class="container">
42
+ <div class="aside">
43
+ <div class="aside-curtain"></div>
44
+ <div class="aside-container">
45
+ <div class="aside-content">
46
+ <div class="VPDocAside">
47
+ <nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline has-outline" id="vp-doc-outline">
48
+ <div class="content">
49
+ <div class="outline-marker" id="vp-outline-marker"></div>
50
+ <div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading">{{ theme.labels.outline | default: 'On this page' }}</div>
51
+ <ul class="VPDocOutlineItem root"></ul>
52
+ </div>
53
+ </nav>
54
+ <div class="spacer"></div>
55
+ </div>
49
56
  </div>
50
57
  </div>
51
58
  </div>
52
- </div>
53
59
 
54
- <div class="content">
55
- <div class="content-container">
56
- <main class="main">
57
- <div class="vp-doc external-link-icon-enabled{% if page.url %} {{ page.url | replace: '/', '_' | replace: '.', '_' }}{% endif %}">
58
- {% assign show_auto_page_title = false %}
59
- {% if page.title and page_theme.auto_title != false %}
60
- {% unless content contains '<h1' %}
61
- {% assign show_auto_page_title = true %}
62
- {% endunless %}
63
- {% endif %}
64
- {% assign copy_page_enabled = true %}
65
- {% if theme.copy_page and theme.copy_page.enabled == false %}
66
- {% assign copy_page_enabled = false %}
67
- {% endif %}
68
- {% if page_theme.copy_page == false %}
69
- {% assign copy_page_enabled = false %}
70
- {% endif %}
71
- <div class="vp-doc-header">
72
- {% if show_auto_page_title %}
73
- <h1>{{ page.title }}</h1>
60
+ <div class="content">
61
+ <div class="content-container">
62
+ <main class="main">
63
+ <div class="vp-doc external-link-icon-enabled{% if page.url %} {{ page.url | replace: '/', '_' | replace: '.', '_' }}{% endif %}">
64
+ {% assign show_auto_page_title = false %}
65
+ {% if page.title and page_theme.auto_title != false %}
66
+ {% unless content contains '<h1' %}
67
+ {% assign show_auto_page_title = true %}
68
+ {% endunless %}
74
69
  {% endif %}
70
+ {% assign copy_page_enabled = true %}
71
+ {% if theme.copy_page and theme.copy_page.enabled == false %}
72
+ {% assign copy_page_enabled = false %}
73
+ {% endif %}
74
+ {% if page_theme.copy_page == false %}
75
+ {% assign copy_page_enabled = false %}
76
+ {% endif %}
77
+ <div class="vp-doc-header">
78
+ {% if show_auto_page_title %}
79
+ <h1>{{ page.title }}</h1>
80
+ {% endif %}
81
+ {% if copy_page_enabled and page._raw_markdown and page._raw_markdown != "" %}
82
+ {% include copy_page_button.html %}
83
+ {% endif %}
84
+ </div>
75
85
  {% if copy_page_enabled and page._raw_markdown and page._raw_markdown != "" %}
76
- {% include copy_page_button.html %}
86
+ <textarea class="vp-raw-markdown" style="display:none" aria-hidden="true">{{ page._raw_markdown | xml_escape }}</textarea>
77
87
  {% endif %}
88
+ {{ content }}
78
89
  </div>
79
- {% if copy_page_enabled and page._raw_markdown and page._raw_markdown != "" %}
80
- <textarea class="vp-raw-markdown" style="display:none" aria-hidden="true">{{ page._raw_markdown | xml_escape }}</textarea>
81
- {% endif %}
82
- {{ content }}
83
- </div>
84
- </main>
85
- {% include doc_footer.html %}
90
+ </main>
91
+ {% include doc_footer.html %}
92
+ </div>
86
93
  </div>
87
94
  </div>
88
95
  </div>
89
- </div>
96
+ </turbo-frame>
90
97
  {% elsif is_home %}
91
98
  {% include home.html content=content %}
92
99
  {% else %}
@@ -1354,7 +1354,7 @@
1354
1354
  }
1355
1355
 
1356
1356
  .VPFooter.has-sidebar {
1357
- display: none;
1357
+ display: block;
1358
1358
  }
1359
1359
 
1360
1360
  .VPFooter a {
@@ -1373,6 +1373,19 @@
1373
1373
  }
1374
1374
  }
1375
1375
 
1376
+ @media (min-width: 960px) {
1377
+ .VPFooter.has-sidebar {
1378
+ margin-left: var(--vp-sidebar-width);
1379
+ }
1380
+ }
1381
+
1382
+ @media (min-width: 1440px) {
1383
+ .VPFooter.has-sidebar {
1384
+ margin-right: calc((100% - var(--vp-layout-max-width)) / 2);
1385
+ margin-left: calc((100% - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width));
1386
+ }
1387
+ }
1388
+
1376
1389
  .VPFooter .container {
1377
1390
  margin: 0 auto;
1378
1391
  max-width: var(--vp-layout-max-width);
@@ -664,6 +664,11 @@ body.vp-search-open {
664
664
  height: 36px;
665
665
  }
666
666
 
667
+ .VPFooter .footer-built-with {
668
+ display: block;
669
+ margin-top: 12px;
670
+ }
671
+
667
672
  .dark .VPFooter .footer-chatwithwork-logo {
668
673
  filter: brightness(0) invert(1);
669
674
  }