jekyll-vitepress-theme 0.9.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 +7 -0
- data/LICENSE +21 -0
- data/README.md +93 -0
- data/_includes/doc_footer.html +184 -0
- data/_includes/head.html +98 -0
- data/_includes/home.html +315 -0
- data/_includes/local_nav.html +23 -0
- data/_includes/nav.html +232 -0
- data/_includes/search.html +14 -0
- data/_includes/sidebar.html +47 -0
- data/_includes/vp_slots/doc_footer.html +0 -0
- data/_includes/vp_slots/head.html +1 -0
- data/_includes/vp_slots/layout_bottom.html +0 -0
- data/_layouts/default.html +127 -0
- data/_layouts/home.html +5 -0
- data/assets/css/vitepress-components.css +1524 -0
- data/assets/css/vitepress-core.css +2149 -0
- data/assets/css/vitepress-overrides.css +1408 -0
- data/assets/css/vp-icons.css +24 -0
- data/assets/images/favicon/apple-touch-icon.png +0 -0
- data/assets/images/favicon/favicon-96x96.png +0 -0
- data/assets/images/favicon/favicon.ico +0 -0
- data/assets/images/favicon/site.webmanifest +21 -0
- data/assets/images/favicon/web-app-manifest-192x192.png +0 -0
- data/assets/images/favicon/web-app-manifest-512x512.png +0 -0
- data/assets/images/file-icons/css.svg +1 -0
- data/assets/images/file-icons/default.svg +1 -0
- data/assets/images/file-icons/docker.svg +1 -0
- data/assets/images/file-icons/env.svg +1 -0
- data/assets/images/file-icons/go.svg +1 -0
- data/assets/images/file-icons/html.svg +1 -0
- data/assets/images/file-icons/java.svg +1 -0
- data/assets/images/file-icons/javascript.svg +1 -0
- data/assets/images/file-icons/json.svg +1 -0
- data/assets/images/file-icons/kotlin.svg +1 -0
- data/assets/images/file-icons/make.svg +1 -0
- data/assets/images/file-icons/markdown.svg +1 -0
- data/assets/images/file-icons/php.svg +1 -0
- data/assets/images/file-icons/python.svg +1 -0
- data/assets/images/file-icons/ruby.svg +1 -0
- data/assets/images/file-icons/rust.svg +1 -0
- data/assets/images/file-icons/shell.svg +1 -0
- data/assets/images/file-icons/sql.svg +1 -0
- data/assets/images/file-icons/text.svg +1 -0
- data/assets/images/file-icons/toml.svg +1 -0
- data/assets/images/file-icons/typescript.svg +1 -0
- data/assets/images/file-icons/vue.svg +1 -0
- data/assets/images/file-icons/xml.svg +1 -0
- data/assets/images/file-icons/yaml-dark.svg +1 -0
- data/assets/images/file-icons/yaml.svg +1 -0
- data/assets/images/logo.svg +337 -0
- data/assets/images/social-icons/bitbucket.svg +1 -0
- data/assets/images/social-icons/bluesky.svg +1 -0
- data/assets/images/social-icons/devdotto.svg +1 -0
- data/assets/images/social-icons/discord.svg +1 -0
- data/assets/images/social-icons/dribbble.svg +1 -0
- data/assets/images/social-icons/facebook.svg +1 -0
- data/assets/images/social-icons/github.svg +1 -0
- data/assets/images/social-icons/gitlab.svg +1 -0
- data/assets/images/social-icons/instagram.svg +1 -0
- data/assets/images/social-icons/linkedin.svg +1 -0
- data/assets/images/social-icons/mastodon.svg +1 -0
- data/assets/images/social-icons/medium.svg +1 -0
- data/assets/images/social-icons/npm.svg +1 -0
- data/assets/images/social-icons/reddit.svg +1 -0
- data/assets/images/social-icons/rss.svg +1 -0
- data/assets/images/social-icons/slack.svg +1 -0
- data/assets/images/social-icons/stackoverflow.svg +1 -0
- data/assets/images/social-icons/telegram.svg +1 -0
- data/assets/images/social-icons/twitch.svg +1 -0
- data/assets/images/social-icons/twitter.svg +1 -0
- data/assets/images/social-icons/x.svg +1 -0
- data/assets/images/social-icons/youtube.svg +1 -0
- data/assets/images/theme/vitepress-logo-large.svg +340 -0
- data/assets/images/theme/vitepress-logo-mini.svg +337 -0
- data/assets/js/vitepress-theme.js +1301 -0
- data/lib/jekyll/vitepress_theme/hooks.rb +111 -0
- data/lib/jekyll/vitepress_theme/version.rb +5 -0
- data/lib/jekyll-vitepress-theme.rb +3 -0
- metadata +143 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
require 'pathname'
|
|
2
|
+
require 'rouge'
|
|
3
|
+
|
|
4
|
+
module Jekyll
|
|
5
|
+
module VitePressTheme
|
|
6
|
+
module LastUpdated
|
|
7
|
+
module_function
|
|
8
|
+
|
|
9
|
+
def source_file_time(site, path)
|
|
10
|
+
return nil unless path
|
|
11
|
+
|
|
12
|
+
source_path = if Pathname.new(path).absolute?
|
|
13
|
+
path
|
|
14
|
+
else
|
|
15
|
+
File.join(site.source, path)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
return nil unless File.file?(source_path)
|
|
19
|
+
|
|
20
|
+
File.mtime(source_path).utc
|
|
21
|
+
rescue StandardError
|
|
22
|
+
nil
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
module RougeStyles
|
|
27
|
+
module_function
|
|
28
|
+
|
|
29
|
+
DEFAULT_LIGHT = 'github'.freeze
|
|
30
|
+
DEFAULT_DARK = 'github.dark'.freeze
|
|
31
|
+
|
|
32
|
+
def apply(site)
|
|
33
|
+
vp_theme = site.config['vp_theme']
|
|
34
|
+
return unless vp_theme.is_a?(Hash)
|
|
35
|
+
|
|
36
|
+
light_name, dark_name = resolved_theme_names(vp_theme)
|
|
37
|
+
light_name = valid_theme_name(light_name, DEFAULT_LIGHT)
|
|
38
|
+
dark_name = valid_theme_name(dark_name, DEFAULT_DARK)
|
|
39
|
+
|
|
40
|
+
vp_theme['rouge_theme'] = {
|
|
41
|
+
'light' => light_name,
|
|
42
|
+
'dark' => dark_name
|
|
43
|
+
}
|
|
44
|
+
vp_theme['_generated_rouge_css'] = generated_css(light_name, dark_name)
|
|
45
|
+
rescue StandardError => e
|
|
46
|
+
Jekyll.logger.warn('jekyll-vitepress-theme', "Rouge theme generation failed: #{e.message}")
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def resolved_theme_names(vp_theme)
|
|
50
|
+
rouge_theme = vp_theme['rouge_theme']
|
|
51
|
+
|
|
52
|
+
light = nil
|
|
53
|
+
dark = nil
|
|
54
|
+
|
|
55
|
+
if rouge_theme.is_a?(String)
|
|
56
|
+
light = normalized_name(rouge_theme)
|
|
57
|
+
elsif rouge_theme.is_a?(Hash)
|
|
58
|
+
light = normalized_name(rouge_theme['light'] || rouge_theme[:light])
|
|
59
|
+
dark = normalized_name(rouge_theme['dark'] || rouge_theme[:dark])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
[light || DEFAULT_LIGHT, dark || DEFAULT_DARK]
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def normalized_name(name)
|
|
66
|
+
return nil unless name
|
|
67
|
+
|
|
68
|
+
value = name.to_s.strip
|
|
69
|
+
return nil if value.empty?
|
|
70
|
+
|
|
71
|
+
value
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def valid_theme_name(name, fallback)
|
|
75
|
+
return name if Rouge::Theme.find(name)
|
|
76
|
+
|
|
77
|
+
Jekyll.logger.warn('jekyll-vitepress-theme', "Unknown Rouge theme '#{name}', falling back to '#{fallback}'.")
|
|
78
|
+
fallback
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def generated_css(light_name, dark_name)
|
|
82
|
+
light_theme = Rouge::Theme.find(light_name)
|
|
83
|
+
dark_theme = Rouge::Theme.find(dark_name)
|
|
84
|
+
return '' unless light_theme && dark_theme
|
|
85
|
+
|
|
86
|
+
[
|
|
87
|
+
light_theme.render(scope: '.vp-doc .highlighter-rouge .highlight'),
|
|
88
|
+
dark_theme.render(scope: '.dark .vp-doc .highlighter-rouge .highlight')
|
|
89
|
+
].join("\n")
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
Jekyll::Hooks.register :site, :after_reset do |site|
|
|
96
|
+
Jekyll::VitePressTheme::RougeStyles.apply(site)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
Jekyll::Hooks.register :documents, :pre_render do |document|
|
|
100
|
+
next if document.data.key?('last_updated_at')
|
|
101
|
+
|
|
102
|
+
updated_at = Jekyll::VitePressTheme::LastUpdated.source_file_time(document.site, document.path)
|
|
103
|
+
document.data['last_updated_at'] = updated_at if updated_at
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
Jekyll::Hooks.register :pages, :pre_render do |page|
|
|
107
|
+
next if page.data.key?('last_updated_at')
|
|
108
|
+
|
|
109
|
+
updated_at = Jekyll::VitePressTheme::LastUpdated.source_file_time(page.site, page.path)
|
|
110
|
+
page.data['last_updated_at'] = updated_at if updated_at
|
|
111
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: jekyll-vitepress-theme
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.9.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Carmine Paolino
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-03-10 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: jekyll
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '4.3'
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: '5.0'
|
|
23
|
+
type: :runtime
|
|
24
|
+
prerelease: false
|
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
+
requirements:
|
|
27
|
+
- - ">="
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: '4.3'
|
|
30
|
+
- - "<"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '5.0'
|
|
33
|
+
description: Jekyll VitePress Theme brings the VitePress default theme look and behavior
|
|
34
|
+
to Jekyll sites.
|
|
35
|
+
email:
|
|
36
|
+
- carmine@paolino.me
|
|
37
|
+
executables: []
|
|
38
|
+
extensions: []
|
|
39
|
+
extra_rdoc_files: []
|
|
40
|
+
files:
|
|
41
|
+
- LICENSE
|
|
42
|
+
- README.md
|
|
43
|
+
- _includes/doc_footer.html
|
|
44
|
+
- _includes/head.html
|
|
45
|
+
- _includes/home.html
|
|
46
|
+
- _includes/local_nav.html
|
|
47
|
+
- _includes/nav.html
|
|
48
|
+
- _includes/search.html
|
|
49
|
+
- _includes/sidebar.html
|
|
50
|
+
- _includes/vp_slots/doc_footer.html
|
|
51
|
+
- _includes/vp_slots/head.html
|
|
52
|
+
- _includes/vp_slots/layout_bottom.html
|
|
53
|
+
- _layouts/default.html
|
|
54
|
+
- _layouts/home.html
|
|
55
|
+
- assets/css/vitepress-components.css
|
|
56
|
+
- assets/css/vitepress-core.css
|
|
57
|
+
- assets/css/vitepress-overrides.css
|
|
58
|
+
- assets/css/vp-icons.css
|
|
59
|
+
- assets/images/favicon/apple-touch-icon.png
|
|
60
|
+
- assets/images/favicon/favicon-96x96.png
|
|
61
|
+
- assets/images/favicon/favicon.ico
|
|
62
|
+
- assets/images/favicon/site.webmanifest
|
|
63
|
+
- assets/images/favicon/web-app-manifest-192x192.png
|
|
64
|
+
- assets/images/favicon/web-app-manifest-512x512.png
|
|
65
|
+
- assets/images/file-icons/css.svg
|
|
66
|
+
- assets/images/file-icons/default.svg
|
|
67
|
+
- assets/images/file-icons/docker.svg
|
|
68
|
+
- assets/images/file-icons/env.svg
|
|
69
|
+
- assets/images/file-icons/go.svg
|
|
70
|
+
- assets/images/file-icons/html.svg
|
|
71
|
+
- assets/images/file-icons/java.svg
|
|
72
|
+
- assets/images/file-icons/javascript.svg
|
|
73
|
+
- assets/images/file-icons/json.svg
|
|
74
|
+
- assets/images/file-icons/kotlin.svg
|
|
75
|
+
- assets/images/file-icons/make.svg
|
|
76
|
+
- assets/images/file-icons/markdown.svg
|
|
77
|
+
- assets/images/file-icons/php.svg
|
|
78
|
+
- assets/images/file-icons/python.svg
|
|
79
|
+
- assets/images/file-icons/ruby.svg
|
|
80
|
+
- assets/images/file-icons/rust.svg
|
|
81
|
+
- assets/images/file-icons/shell.svg
|
|
82
|
+
- assets/images/file-icons/sql.svg
|
|
83
|
+
- assets/images/file-icons/text.svg
|
|
84
|
+
- assets/images/file-icons/toml.svg
|
|
85
|
+
- assets/images/file-icons/typescript.svg
|
|
86
|
+
- assets/images/file-icons/vue.svg
|
|
87
|
+
- assets/images/file-icons/xml.svg
|
|
88
|
+
- assets/images/file-icons/yaml-dark.svg
|
|
89
|
+
- assets/images/file-icons/yaml.svg
|
|
90
|
+
- assets/images/logo.svg
|
|
91
|
+
- assets/images/social-icons/bitbucket.svg
|
|
92
|
+
- assets/images/social-icons/bluesky.svg
|
|
93
|
+
- assets/images/social-icons/devdotto.svg
|
|
94
|
+
- assets/images/social-icons/discord.svg
|
|
95
|
+
- assets/images/social-icons/dribbble.svg
|
|
96
|
+
- assets/images/social-icons/facebook.svg
|
|
97
|
+
- assets/images/social-icons/github.svg
|
|
98
|
+
- assets/images/social-icons/gitlab.svg
|
|
99
|
+
- assets/images/social-icons/instagram.svg
|
|
100
|
+
- assets/images/social-icons/linkedin.svg
|
|
101
|
+
- assets/images/social-icons/mastodon.svg
|
|
102
|
+
- assets/images/social-icons/medium.svg
|
|
103
|
+
- assets/images/social-icons/npm.svg
|
|
104
|
+
- assets/images/social-icons/reddit.svg
|
|
105
|
+
- assets/images/social-icons/rss.svg
|
|
106
|
+
- assets/images/social-icons/slack.svg
|
|
107
|
+
- assets/images/social-icons/stackoverflow.svg
|
|
108
|
+
- assets/images/social-icons/telegram.svg
|
|
109
|
+
- assets/images/social-icons/twitch.svg
|
|
110
|
+
- assets/images/social-icons/twitter.svg
|
|
111
|
+
- assets/images/social-icons/x.svg
|
|
112
|
+
- assets/images/social-icons/youtube.svg
|
|
113
|
+
- assets/images/theme/vitepress-logo-large.svg
|
|
114
|
+
- assets/images/theme/vitepress-logo-mini.svg
|
|
115
|
+
- assets/js/vitepress-theme.js
|
|
116
|
+
- lib/jekyll-vitepress-theme.rb
|
|
117
|
+
- lib/jekyll/vitepress_theme/hooks.rb
|
|
118
|
+
- lib/jekyll/vitepress_theme/version.rb
|
|
119
|
+
homepage: https://github.com/crmne/jekyll-vitepress-theme
|
|
120
|
+
licenses:
|
|
121
|
+
- MIT
|
|
122
|
+
metadata:
|
|
123
|
+
rubygems_mfa_required: 'true'
|
|
124
|
+
post_install_message:
|
|
125
|
+
rdoc_options: []
|
|
126
|
+
require_paths:
|
|
127
|
+
- lib
|
|
128
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
|
+
requirements:
|
|
130
|
+
- - ">="
|
|
131
|
+
- !ruby/object:Gem::Version
|
|
132
|
+
version: '3.1'
|
|
133
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
|
+
requirements:
|
|
135
|
+
- - ">="
|
|
136
|
+
- !ruby/object:Gem::Version
|
|
137
|
+
version: '0'
|
|
138
|
+
requirements: []
|
|
139
|
+
rubygems_version: 3.5.22
|
|
140
|
+
signing_key:
|
|
141
|
+
specification_version: 4
|
|
142
|
+
summary: A VitePress-like docs theme for Jekyll.
|
|
143
|
+
test_files: []
|