jekyll-vitepress-theme 1.14.0 → 1.15.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/_includes/github_sponsor_button.html +19 -4
- data/_includes/github_star_button.html +6 -1
- data/_includes/hero_badges.html +31 -0
- data/_includes/hero_download.html +68 -0
- data/_includes/hero_highlight.html +18 -0
- data/_includes/hero_install_command.html +23 -0
- data/_includes/home.html +123 -7
- data/_includes/nav.html +2 -0
- data/_includes/nav_cta.html +18 -0
- data/_includes/nav_social_links.html +2 -4
- data/_includes/seo.html +3 -2
- data/_includes/sponsor_heart.html +1 -0
- data/assets/css/vitepress-overrides.css +487 -0
- data/assets/js/vitepress-theme.js +98 -4
- data/lib/jekyll/vitepress_theme/github_meta.rb +167 -0
- data/lib/jekyll/vitepress_theme/hooks.rb +25 -2
- data/lib/jekyll/vitepress_theme/seo.rb +136 -6
- data/lib/jekyll/vitepress_theme/version.rb +1 -1
- data/lib/jekyll/vitepress_theme/versioned_build.rb +3 -2
- data/lib/jekyll-vitepress-theme.rb +1 -0
- metadata +8 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b40f2d7b40daf986f3c447995be776ce4d2c925ec8897bed8ef7f9daea9b5042
|
|
4
|
+
data.tar.gz: adb488bb001141ed0ac102fc9fb6576676f42932a300aae04e912862fb88af82
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 34e9a5ec67c1c5c93c9b73e9fbbd3056c5286a93777bc79580efc84f133adadbf6cc417ce2be02a964a35285fec6ee06aaaee1e0b79b55da4cbb97070d75ff33
|
|
7
|
+
data.tar.gz: ce8cb227d5456835f039b585b4b13b91a001858311a4d73339496da23c7a1014381fa867abceee54c87f7297ccae227fde704291ecd754631e903706e336c44d
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
{% comment %}
|
|
2
|
+
The link is include.user or include.url, then jekyll_vitepress.github_sponsor,
|
|
3
|
+
then the first `github:` account in the repository's .github/FUNDING.yml.
|
|
4
|
+
{% endcomment %}
|
|
1
5
|
{% assign theme = site.jekyll_vitepress %}
|
|
2
6
|
{% assign config = theme.github_sponsor %}
|
|
3
7
|
{% assign explicit_sponsor_user = include.user | default: include.username | default: include.account %}
|
|
@@ -28,17 +32,28 @@
|
|
|
28
32
|
{% endif %}
|
|
29
33
|
{% assign button_text = button_text | default: 'Sponsor' %}
|
|
30
34
|
{% assign button_label = button_label | default: 'Sponsor on GitHub' %}
|
|
35
|
+
{% unless sponsor_user or config == false %}
|
|
36
|
+
{% assign sponsor_user = site.jekyll_vitepress_funding_github %}
|
|
37
|
+
{% endunless %}
|
|
31
38
|
{% unless button_url %}
|
|
32
39
|
{% if sponsor_user %}
|
|
33
40
|
{% assign button_url = 'https://github.com/sponsors/' | append: sponsor_user %}
|
|
34
41
|
{% endif %}
|
|
35
42
|
{% endunless %}
|
|
43
|
+
{% if config == false %}
|
|
44
|
+
{% unless explicit_sponsor_user or explicit_button_url %}
|
|
45
|
+
{% assign button_enabled = false %}
|
|
46
|
+
{% endunless %}
|
|
47
|
+
{% endif %}
|
|
48
|
+
{% if include.variant == 'hero' %}
|
|
49
|
+
{% assign button_class = 'VPButton medium alt VPMetricButton VPMetricButtonSponsor VPHeroSponsor' %}
|
|
50
|
+
{% else %}
|
|
51
|
+
{% assign button_class = 'VPMetricButton VPMetricButtonSponsor no-icon' %}
|
|
52
|
+
{% endif %}
|
|
36
53
|
{% if button_enabled and button_url %}
|
|
37
|
-
<a class="
|
|
54
|
+
<a class="{{ button_class }}" href="{{ button_url }}" aria-label="{{ button_label | escape }}" target="_blank" rel="noreferrer noopener">
|
|
38
55
|
<span class="VPMetricButtonIcon VPMetricButtonSponsorIcon" aria-hidden="true">
|
|
39
|
-
|
|
40
|
-
<path d="M7.655 14.916v-.001h-.002l-.006-.003-.018-.01a22.066 22.066 0 0 1-3.744-2.584C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.044 5.231-3.886 6.818a22.094 22.094 0 0 1-3.433 2.414 7.152 7.152 0 0 1-.31.17l-.018.01-.008.004a.75.75 0 0 1-.69 0Z"></path>
|
|
41
|
-
</svg>
|
|
56
|
+
{% include sponsor_heart.html %}
|
|
42
57
|
</span>
|
|
43
58
|
<span class="VPMetricButtonText">{{ button_text }}</span>
|
|
44
59
|
</a>
|
|
@@ -32,6 +32,11 @@
|
|
|
32
32
|
{% assign button_url = 'https://github.com/' | append: repository %}
|
|
33
33
|
{% endif %}
|
|
34
34
|
{% endunless %}
|
|
35
|
+
{% assign baked_count = nil %}
|
|
36
|
+
{% assign config_repository = config.repository | default: config.repo %}
|
|
37
|
+
{% if show_count and repository == config_repository %}
|
|
38
|
+
{% assign baked_count = site.jekyll_vitepress_github_star_count.exact %}
|
|
39
|
+
{% endif %}
|
|
35
40
|
{% if button_enabled and repository and button_url %}
|
|
36
41
|
{% if include.variant == 'hero' %}
|
|
37
42
|
{% assign button_class = 'VPButton medium alt VPMetricButton VPMetricButtonGithub VPHeroStar' %}
|
|
@@ -41,6 +46,6 @@
|
|
|
41
46
|
<a class="{{ button_class }}" href="{{ button_url }}" aria-label="Star {{ repository }} on GitHub" target="_blank" rel="noreferrer noopener" data-github-star-repo="{{ repository | escape }}" data-github-star-show-count="{{ show_count }}">
|
|
42
47
|
<span class="VPMetricButtonIcon vpi-social-github" aria-hidden="true"></span>
|
|
43
48
|
<span class="VPMetricButtonText">{{ button_text }}</span>
|
|
44
|
-
<span class="VPMetricButtonCount" data-vp-github-star-count aria-hidden="true"{% unless
|
|
49
|
+
<span class="VPMetricButtonCount" data-vp-github-star-count aria-hidden="true"{% unless baked_count %} hidden{% endunless %}>{{ baked_count }}</span>
|
|
45
50
|
</a>
|
|
46
51
|
{% endif %}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{%- comment -%}
|
|
2
|
+
hero.badges: one quiet line of small links under the hero's Star and
|
|
3
|
+
Sponsor row (and its note), separated by dots. Each is gem_downloads (the
|
|
4
|
+
jekyll_vitepress.gem_downloads link, with its live count), a text badge
|
|
5
|
+
{ text, value, link, label }, or an image badge { image, link, alt,
|
|
6
|
+
height }.
|
|
7
|
+
{%- endcomment -%}
|
|
8
|
+
{%- assign hb_badges = include.badges -%}
|
|
9
|
+
<div class="VPHeroBadges" aria-label="Project badges">
|
|
10
|
+
{%- for badge in hb_badges -%}
|
|
11
|
+
{%- unless forloop.first %}
|
|
12
|
+
<span class="VPHeroBadgesDot" aria-hidden="true">·</span>
|
|
13
|
+
{%- endunless -%}
|
|
14
|
+
{%- if badge == 'gem_downloads' %}
|
|
15
|
+
{% include rubygems_downloads_button.html %}
|
|
16
|
+
{%- else -%}
|
|
17
|
+
{%- assign hb_link = badge.link | default: badge.url -%}
|
|
18
|
+
{%- assign hb_external = false -%}
|
|
19
|
+
{%- if hb_link contains '://' -%}{%- assign hb_external = true -%}{%- endif -%}
|
|
20
|
+
{%- capture hb_attrs -%}{% if hb_link %} href="{% if hb_external %}{{ hb_link | escape }}{% else %}{{ hb_link | relative_url }}{% endif %}"{% if hb_external %} target="_blank" rel="noreferrer noopener"{% endif %}{% endif %}{%- endcapture -%}
|
|
21
|
+
{%- assign hb_tag = 'span' -%}{%- if hb_link -%}{%- assign hb_tag = 'a' -%}{%- endif -%}
|
|
22
|
+
{%- if badge.image -%}
|
|
23
|
+
{%- assign hb_src = badge.image -%}
|
|
24
|
+
{%- unless hb_src contains '://' or hb_src contains 'data:' -%}{%- assign hb_src = hb_src | relative_url -%}{%- endunless %}
|
|
25
|
+
<{{ hb_tag }} class="VPHeroBadge VPHeroBadgeImage"{{ hb_attrs }}><img src="{{ hb_src | escape }}" alt="{{ badge.alt | escape }}" height="{{ badge.height | default: 20 }}"></{{ hb_tag }}>
|
|
26
|
+
{%- else %}
|
|
27
|
+
<{{ hb_tag }} class="VPHeroBadge"{{ hb_attrs }}{% if badge.label %} aria-label="{{ badge.label | escape }}{% if badge.value %}: {{ badge.value | escape }}{% endif %}"{% endif %}>{{ badge.text }}{% if badge.value %} <strong class="VPHeroBadgeValue">{{ badge.value }}</strong>{% endif %}</{{ hb_tag }}>
|
|
28
|
+
{%- endif -%}
|
|
29
|
+
{%- endif -%}
|
|
30
|
+
{%- endfor %}
|
|
31
|
+
</div>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{%- comment -%}
|
|
2
|
+
An app's install block: tabs for Linux, macOS and Windows, one for each
|
|
3
|
+
system configured, with the visitor's own system selected and the others a
|
|
4
|
+
click away. Linux shows its command with Copy; macOS and Windows show a
|
|
5
|
+
download button and, if set, a Homebrew or winget line with Copy.
|
|
6
|
+
|
|
7
|
+
download.linux_command, download.macos (URL), download.macos_command,
|
|
8
|
+
download.macos_label, download.windows (URL), download.windows_arm (URL),
|
|
9
|
+
download.windows_command, download.windows_label. "{version}" in any of
|
|
10
|
+
them becomes download.version, or else the site's own version
|
|
11
|
+
(jekyll_vitepress.version, or the version menu's current label), without
|
|
12
|
+
a leading "v". The tabs are radio buttons, so they work without
|
|
13
|
+
JavaScript; the script only picks the visitor's system.
|
|
14
|
+
|
|
15
|
+
Outside the hero, include hero_download.html with download= (for
|
|
16
|
+
example page.download) and id=, a different id for each block on a page.
|
|
17
|
+
{%- endcomment -%}
|
|
18
|
+
{%- assign dl = include.download -%}
|
|
19
|
+
{%- assign dl_id = 'vp-dl-' | append: page.url | slugify -%}
|
|
20
|
+
{%- if include.id -%}{%- assign dl_id = include.id -%}{%- endif -%}
|
|
21
|
+
{%- assign dl_version = dl.version | default: site.jekyll_vitepress_site_version | append: '' -%}
|
|
22
|
+
{%- assign dl_v = dl_version | slice: 0 -%}
|
|
23
|
+
{%- if dl_v == 'v' or dl_v == 'V' -%}{%- assign dl_version = dl_version | slice: 1, dl_version.size -%}{%- endif -%}
|
|
24
|
+
{%- assign dl_linux_command = dl.linux_command | replace: '{version}', dl_version -%}
|
|
25
|
+
{%- assign dl_systems = '' | split: '' -%}
|
|
26
|
+
{%- if dl.linux_command -%}{%- assign dl_systems = dl_systems | push: 'linux' -%}{%- endif -%}
|
|
27
|
+
{%- if dl.macos or dl.macos_command -%}{%- assign dl_systems = dl_systems | push: 'macos' -%}{%- endif -%}
|
|
28
|
+
{%- if dl.windows or dl.windows_command -%}{%- assign dl_systems = dl_systems | push: 'windows' -%}{%- endif -%}
|
|
29
|
+
{%- if dl_systems.size > 0 -%}
|
|
30
|
+
<div class="VPHeroInstall VPHeroDownloadTabs" data-vp-download>
|
|
31
|
+
<div class="VPHeroDownloadTabList" role="radiogroup" aria-label="Your system">
|
|
32
|
+
{%- for os in dl_systems %}
|
|
33
|
+
{%- case os -%}{%- when 'linux' -%}{%- assign os_name = 'Linux' -%}{%- when 'macos' -%}{%- assign os_name = 'macOS' -%}{%- else -%}{%- assign os_name = 'Windows' -%}{%- endcase %}
|
|
34
|
+
<input class="VPHeroDownloadTabInput" type="radio" name="{{ dl_id }}" id="{{ dl_id }}-{{ os }}" value="{{ os }}"{% if forloop.first %} checked{% endif %}>
|
|
35
|
+
<label class="VPHeroDownloadTab" for="{{ dl_id }}-{{ os }}">{{ os_name }}</label>
|
|
36
|
+
{%- endfor %}
|
|
37
|
+
</div>
|
|
38
|
+
{%- for os in dl_systems %}
|
|
39
|
+
<div class="VPHeroDownloadPanel" data-os="{{ os }}">
|
|
40
|
+
{%- if os == 'linux' %}
|
|
41
|
+
<div class="VPHeroInstallLine">
|
|
42
|
+
<code class="VPHeroInstallCommand"><span class="VPHeroInstallPrompt" aria-hidden="true">$</span>{% include hero_install_command.html command=dl_linux_command %}</code>
|
|
43
|
+
<button type="button" class="VPHeroInstallCopy" data-vp-hero-copy aria-label="Copy the Linux install command">Copy</button>
|
|
44
|
+
</div>
|
|
45
|
+
{%- else %}
|
|
46
|
+
{%- if os == 'macos' -%}
|
|
47
|
+
{%- assign os_url = dl.macos -%}{%- assign os_command = dl.macos_command -%}{%- assign os_text = dl.macos_label | default: 'Download for Mac' -%}
|
|
48
|
+
{%- else -%}
|
|
49
|
+
{%- assign os_url = dl.windows -%}{%- assign os_command = dl.windows_command -%}{%- assign os_text = dl.windows_label | default: 'Download for Windows' -%}
|
|
50
|
+
{%- endif -%}
|
|
51
|
+
{%- if os_url -%}{%- assign os_url = os_url | replace: '{version}', dl_version -%}{%- endif -%}
|
|
52
|
+
{%- if os_command -%}{%- assign os_command = os_command | replace: '{version}', dl_version -%}{%- endif -%}
|
|
53
|
+
{%- assign os_text = os_text | replace: '{version}', dl_version -%}
|
|
54
|
+
{%- assign os_arm = dl.windows_arm | replace: '{version}', dl_version -%}
|
|
55
|
+
{%- if os_url %}
|
|
56
|
+
<a class="VPButton medium brand VPHeroDownloadButton" href="{{ os_url | escape }}"{% if os == 'windows' and dl.windows_arm %} data-arm-href="{{ os_arm | escape }}"{% endif %}>{{ os_text }}</a>
|
|
57
|
+
{%- endif %}
|
|
58
|
+
{%- if os_command %}
|
|
59
|
+
<div class="VPHeroInstallLine">
|
|
60
|
+
<code class="VPHeroInstallCommand"><span class="VPHeroInstallPrompt" aria-hidden="true">$</span>{% include hero_install_command.html command=os_command %}</code>
|
|
61
|
+
<button type="button" class="VPHeroInstallCopy" data-vp-hero-copy aria-label="Copy the {% if os == 'macos' %}macOS{% else %}Windows{% endif %} install command">Copy</button>
|
|
62
|
+
</div>
|
|
63
|
+
{%- endif %}
|
|
64
|
+
{%- endif %}
|
|
65
|
+
</div>
|
|
66
|
+
{%- endfor %}
|
|
67
|
+
</div>
|
|
68
|
+
{%- endif -%}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{%- comment -%}
|
|
2
|
+
Hero text with highlighted parts: each ==part== becomes a
|
|
3
|
+
<mark class="VPHeroHighlight">. Text without a matched pair of == marks is
|
|
4
|
+
printed as given.
|
|
5
|
+
{%- endcomment -%}
|
|
6
|
+
{%- assign hl_text = include.text | append: '' -%}
|
|
7
|
+
{%- assign hl_plain = hl_text | remove: '==' -%}
|
|
8
|
+
{%- assign hl_marks = hl_text.size | minus: hl_plain.size | divided_by: 2 -%}
|
|
9
|
+
{%- assign hl_odd = hl_marks | modulo: 2 -%}
|
|
10
|
+
{%- if hl_marks == 0 or hl_odd == 1 -%}
|
|
11
|
+
{{ include.text }}
|
|
12
|
+
{%- else -%}
|
|
13
|
+
{%- assign hl_parts = hl_text | split: '==' -%}
|
|
14
|
+
{%- for hl_part in hl_parts -%}
|
|
15
|
+
{%- assign hl_i = forloop.index0 | modulo: 2 -%}
|
|
16
|
+
{%- if hl_i == 1 -%}<mark class="VPHeroHighlight">{{ hl_part }}</mark>{%- else -%}{{ hl_part }}{%- endif -%}
|
|
17
|
+
{%- endfor -%}
|
|
18
|
+
{%- endif -%}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{%- comment -%}
|
|
2
|
+
One install command for the hero: words stay whole and wrap only at
|
|
3
|
+
spaces; a word wider than the box (a URL) can also break after a "/".
|
|
4
|
+
The text copies exactly as written.
|
|
5
|
+
{%- endcomment -%}
|
|
6
|
+
{%- assign hic_words = include.command | strip | split: ' ' -%}
|
|
7
|
+
<span data-vp-hero-copy-text>
|
|
8
|
+
{%- for hic_word in hic_words -%}
|
|
9
|
+
<span class="VPHeroInstallWord">
|
|
10
|
+
{%- assign hic_parts = hic_word | split: '/' -%}
|
|
11
|
+
{%- assign hic_last = hic_parts.size | minus: 1 -%}
|
|
12
|
+
{%- if hic_word contains '/' -%}
|
|
13
|
+
{%- for hic_part in hic_parts -%}
|
|
14
|
+
<span class="VPHeroInstallSegment">{{ hic_part | escape }}{% if forloop.index0 < hic_last %}/{% endif %}</span>{% if forloop.index0 < hic_last %}<wbr>{% endif %}
|
|
15
|
+
{%- endfor -%}
|
|
16
|
+
{%- assign hic_tail = hic_word | slice: -1 -%}
|
|
17
|
+
{%- if hic_tail == '/' and hic_parts.size > 0 %}<span class="VPHeroInstallSegment">/</span>{% endif -%}
|
|
18
|
+
{%- else -%}
|
|
19
|
+
<span class="VPHeroInstallSegment">{{ hic_word | escape }}</span>
|
|
20
|
+
{%- endif -%}
|
|
21
|
+
</span>{% unless forloop.last %} {% endunless %}
|
|
22
|
+
{%- endfor -%}
|
|
23
|
+
</span>
|
data/_includes/home.html
CHANGED
|
@@ -14,11 +14,50 @@
|
|
|
14
14
|
{% if home_hero %}
|
|
15
15
|
{% assign hero_image = home_hero.image %}
|
|
16
16
|
{% assign hero_fallback_alt = home_hero.name | default: site.title %}
|
|
17
|
-
|
|
17
|
+
{%- comment -%}
|
|
18
|
+
With hero.install or hero.download, the hero ends on that one call
|
|
19
|
+
to action and a quiet row with Star and Sponsor. Star and Sponsor
|
|
20
|
+
actions are then dropped from hero.actions, so neither shows twice.
|
|
21
|
+
{%- endcomment -%}
|
|
22
|
+
{% assign hero_install = home_hero.install %}{% if home_hero.install_next and site.vitepress_version.kind == 'next' %}{% assign hero_install = home_hero.install_next %}{% endif %}
|
|
23
|
+
{% assign hero_download = home_hero.download %}
|
|
24
|
+
{% assign hero_has_cta = false %}
|
|
25
|
+
{% if hero_install or hero_download %}
|
|
26
|
+
{% assign hero_has_cta = true %}
|
|
27
|
+
{% endif %}
|
|
28
|
+
{% assign hero_social_wanted = false %}
|
|
29
|
+
{% if home_hero.social == true %}
|
|
30
|
+
{% assign hero_social_wanted = true %}
|
|
31
|
+
{% elsif hero_has_cta %}
|
|
32
|
+
{% unless home_hero.social == false %}
|
|
33
|
+
{% assign hero_social_wanted = true %}
|
|
34
|
+
{% endunless %}
|
|
35
|
+
{% endif %}
|
|
36
|
+
|
|
37
|
+
{%- comment -%}
|
|
38
|
+
The install/download hero is centred unless hero.align says left; any
|
|
39
|
+
hero can ask for align: center. hero.logo.size sets the logo's height.
|
|
40
|
+
{%- endcomment -%}
|
|
41
|
+
{% assign hero_centered = false %}
|
|
42
|
+
{% if home_hero.align == 'center' %}
|
|
43
|
+
{% assign hero_centered = true %}
|
|
44
|
+
{% elsif hero_has_cta and hero_image == nil and home_hero.align != 'left' %}
|
|
45
|
+
{% assign hero_centered = true %}
|
|
46
|
+
{% endif %}
|
|
47
|
+
{%- comment -%}
|
|
48
|
+
Liquid answers logo.size with the hash's key count or the string's
|
|
49
|
+
length when no size key is set, so read it only when it is there.
|
|
50
|
+
{%- endcomment -%}
|
|
51
|
+
{% assign hero_logo_size = nil %}
|
|
52
|
+
{% assign hero_logo_json = home_hero.logo | jsonify %}
|
|
53
|
+
{% if hero_logo_json contains '"size":' %}
|
|
54
|
+
{% assign hero_logo_size = home_hero.logo.size %}
|
|
55
|
+
{% endif %}
|
|
56
|
+
<div class="VPHero{% if hero_image %} has-image{% endif %}{% if hero_centered %} is-centered{% endif %}{% if hero_has_cta %} has-cta{% endif %}">
|
|
18
57
|
<div class="container">
|
|
19
58
|
<div class="main">
|
|
20
59
|
{% if home_hero.logo %}
|
|
21
|
-
<div class="hero-logo">
|
|
60
|
+
<div class="hero-logo"{% if hero_logo_size %} style="--vp-hero-logo-size: {{ hero_logo_size | plus: 0 }}px"{% endif %}>
|
|
22
61
|
{% include vp_image.html image=home_hero.logo class='hero-logo-image' default_alt=hero_fallback_alt default_width="560" default_height="160" %}
|
|
23
62
|
</div>
|
|
24
63
|
{% endif %}
|
|
@@ -26,25 +65,35 @@
|
|
|
26
65
|
{% if home_hero.name or home_hero.text %}
|
|
27
66
|
<h1 class="heading">
|
|
28
67
|
{% if home_hero.name %}
|
|
29
|
-
<span class="name clip">{
|
|
68
|
+
<span class="name clip">{% include hero_highlight.html text=home_hero.name %}</span>
|
|
30
69
|
{% endif %}
|
|
31
70
|
{% if home_hero.text %}
|
|
32
|
-
<span class="text">{
|
|
71
|
+
<span class="text">{% include hero_highlight.html text=home_hero.text %}</span>
|
|
33
72
|
{% endif %}
|
|
34
73
|
</h1>
|
|
35
74
|
{% endif %}
|
|
36
75
|
|
|
37
76
|
{% if home_hero.tagline %}
|
|
38
|
-
<p class="tagline">{
|
|
77
|
+
<p class="tagline">{% include hero_highlight.html text=home_hero.tagline %}</p>
|
|
39
78
|
{% endif %}
|
|
40
79
|
|
|
41
80
|
{% if home_hero.actions and home_hero.actions.size > 0 %}
|
|
42
|
-
|
|
81
|
+
{% capture hero_actions_html %}
|
|
43
82
|
{% for action in home_hero.actions %}
|
|
44
|
-
{% if action.star == true
|
|
83
|
+
{% if hero_social_wanted and action.star == true %}
|
|
84
|
+
{% elsif hero_social_wanted and action.sponsor == true %}
|
|
85
|
+
{% elsif action.star == true and hero_star_available %}
|
|
45
86
|
<div class="action">
|
|
46
87
|
{% include github_star_button.html variant='hero' %}
|
|
47
88
|
</div>
|
|
89
|
+
{% elsif action.sponsor == true %}
|
|
90
|
+
{% capture hero_sponsor_button %}{% include github_sponsor_button.html variant='hero' url=action.link text=action.text %}{% endcapture %}
|
|
91
|
+
{% assign hero_sponsor_button = hero_sponsor_button | strip %}
|
|
92
|
+
{% if hero_sponsor_button != '' %}
|
|
93
|
+
<div class="action">
|
|
94
|
+
{{ hero_sponsor_button }}
|
|
95
|
+
</div>
|
|
96
|
+
{% endif %}
|
|
48
97
|
{% elsif action.star != true or action.link %}
|
|
49
98
|
<div class="action">
|
|
50
99
|
<a class="VPButton medium {{ action.theme | default: 'brand' }}" {% include link_attrs.html href=action.link target=action.target rel=action.rel %}>
|
|
@@ -53,8 +102,75 @@
|
|
|
53
102
|
</div>
|
|
54
103
|
{% endif %}
|
|
55
104
|
{% endfor %}
|
|
105
|
+
{% endcapture %}
|
|
106
|
+
{% assign hero_actions_html = hero_actions_html | strip %}
|
|
107
|
+
{% if hero_actions_html != '' %}
|
|
108
|
+
<div class="actions">
|
|
109
|
+
{{ hero_actions_html }}
|
|
110
|
+
</div>
|
|
111
|
+
{% endif %}
|
|
112
|
+
{% endif %}
|
|
113
|
+
|
|
114
|
+
{% if hero_has_cta %}
|
|
115
|
+
<div class="VPHeroCta">
|
|
116
|
+
{% if hero_install %}
|
|
117
|
+
{%- comment -%}
|
|
118
|
+
hero.install is a command, { command:, label: }, or a list of
|
|
119
|
+
either: each line gets its own Copy button. Words are kept
|
|
120
|
+
whole, so a phone wraps the command only at its spaces.
|
|
121
|
+
{%- endcomment -%}
|
|
122
|
+
{% assign hero_install_kind = hero_install | jsonify | slice: 0 %}
|
|
123
|
+
{% if hero_install_kind == '[' %}
|
|
124
|
+
{% assign hero_install_lines = hero_install %}
|
|
125
|
+
{% else %}
|
|
126
|
+
{% assign hero_install_lines = '' | split: '' | push: hero_install %}
|
|
127
|
+
{% endif %}
|
|
128
|
+
{%- comment -%}
|
|
129
|
+
Every line sits in one box with one Copy button, which copies
|
|
130
|
+
all the lines, one per line.
|
|
131
|
+
{%- endcomment -%}
|
|
132
|
+
{% assign hero_install_label = nil %}
|
|
133
|
+
<div class="VPHeroInstall">
|
|
134
|
+
<div class="VPHeroInstallLine">
|
|
135
|
+
<div class="VPHeroInstallCommands">
|
|
136
|
+
{% for hero_install_line in hero_install_lines %}
|
|
137
|
+
{% assign hero_install_line_kind = hero_install_line | jsonify | slice: 0 %}
|
|
138
|
+
{% if hero_install_line_kind == '{' %}
|
|
139
|
+
{% assign hero_install_command = hero_install_line.command %}
|
|
140
|
+
{% assign hero_install_label = hero_install_label | default: hero_install_line.label %}
|
|
141
|
+
{% else %}
|
|
142
|
+
{% assign hero_install_command = hero_install_line %}
|
|
143
|
+
{% endif %}
|
|
144
|
+
<code class="VPHeroInstallCommand"><span class="VPHeroInstallPrompt" aria-hidden="true">$</span>{% include hero_install_command.html command=hero_install_command %}</code>
|
|
145
|
+
{% endfor %}
|
|
146
|
+
</div>
|
|
147
|
+
{% if hero_install_lines.size > 1 %}
|
|
148
|
+
{% assign hero_install_label = hero_install_label | default: 'Copy the commands' %}
|
|
149
|
+
{% else %}
|
|
150
|
+
{% assign hero_install_label = hero_install_label | default: 'Copy the command' %}
|
|
151
|
+
{% endif %}
|
|
152
|
+
<button type="button" class="VPHeroInstallCopy" data-vp-hero-copy aria-label="{{ hero_install_label | escape }}">Copy</button>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
{% else %}
|
|
156
|
+
{% include hero_download.html download=hero_download %}
|
|
157
|
+
{% endif %}
|
|
56
158
|
</div>
|
|
57
159
|
{% endif %}
|
|
160
|
+
|
|
161
|
+
{% if hero_social_wanted %}
|
|
162
|
+
{% capture hero_social_buttons %}{% if hero_star_available %}{% include github_star_button.html %}{% endif %}{% include github_sponsor_button.html text=home_hero.sponsor_text %}{% endcapture %}
|
|
163
|
+
{% assign hero_social_buttons = hero_social_buttons | strip %}
|
|
164
|
+
{% if hero_social_buttons != '' %}
|
|
165
|
+
<div class="VPHeroSocial">{{ hero_social_buttons }}</div>
|
|
166
|
+
{% endif %}
|
|
167
|
+
{% endif %}
|
|
168
|
+
|
|
169
|
+
{% if home_hero.note %}
|
|
170
|
+
<p class="VPHeroNote">{{ home_hero.note | markdownify | remove: '<p>' | remove: '</p>' | strip }}</p>
|
|
171
|
+
{% endif %}{% if home_hero.badges and home_hero.badges.size > 0 %}
|
|
172
|
+
{% include hero_badges.html badges=home_hero.badges %}
|
|
173
|
+
{% endif %}
|
|
58
174
|
</div>
|
|
59
175
|
|
|
60
176
|
{% if hero_image %}
|
data/_includes/nav.html
CHANGED
|
@@ -99,6 +99,7 @@
|
|
|
99
99
|
{% for item in nav_items %}
|
|
100
100
|
{% include nav_menu_link.html item=item link_class='VPNavBarMenuLink' has_sidebar=include.has_sidebar %}
|
|
101
101
|
{% endfor %}
|
|
102
|
+
{% include nav_cta.html variant='Bar' %}
|
|
102
103
|
|
|
103
104
|
{% if versions and versions.items and versions.items.size > 0 %}
|
|
104
105
|
<div class="VPVersionSelector" id="vp-version-selector">
|
|
@@ -196,6 +197,7 @@
|
|
|
196
197
|
{% for item in nav_items %}
|
|
197
198
|
{% include nav_menu_link.html item=item link_class='VPNavScreenMenuLink' has_sidebar=include.has_sidebar %}
|
|
198
199
|
{% endfor %}
|
|
200
|
+
{% include nav_cta.html variant='Screen' %}
|
|
199
201
|
</nav>
|
|
200
202
|
|
|
201
203
|
{% if versions and versions.items and versions.items.size > 0 %}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{%- comment -%}
|
|
2
|
+
The header call to action: one button in the top bar (and at the top of
|
|
3
|
+
the mobile menu), configured with jekyll_vitepress.nav_cta. Its colour
|
|
4
|
+
defaults to the brand colour.
|
|
5
|
+
{%- endcomment -%}
|
|
6
|
+
{%- assign cta = site.jekyll_vitepress.nav_cta -%}
|
|
7
|
+
{%- if cta and cta != false and cta.enabled != false -%}
|
|
8
|
+
{%- assign cta_text = cta.text | default: cta.label -%}
|
|
9
|
+
{%- assign cta_url = cta.url | default: cta.link -%}
|
|
10
|
+
{%- if cta_text and cta_url -%}
|
|
11
|
+
{%- capture cta_style -%}
|
|
12
|
+
{%- if cta.color %}--vp-nav-cta-bg: {{ cta.color | escape }};{% endif -%}
|
|
13
|
+
{%- if cta.text_color %} --vp-nav-cta-text: {{ cta.text_color | escape }};{% endif -%}
|
|
14
|
+
{%- endcapture -%}
|
|
15
|
+
{%- assign cta_style = cta_style | strip -%}
|
|
16
|
+
<a class="VPNavCta VPNavCta{{ include.variant | default: 'Bar' }}" {% include link_attrs.html href=cta_url target=cta.target rel=cta.rel %}{% if cta_style != '' %} style="{{ cta_style }}"{% endif %}>{{ cta_text | escape }}</a>
|
|
17
|
+
{%- endif -%}
|
|
18
|
+
{%- endif -%}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<a class="{{ social_star_link_class }}" href="{{ github_star_url }}" aria-label="Star {{ github_star_repository }} on GitHub" target="_blank" rel="noreferrer noopener" data-github-star-repo="{{ github_star_repository | escape }}" data-github-star-show-count="{{ github_star_show_count }}">
|
|
18
18
|
<span class="VPNavBarStarIcon vpi-social-github" aria-hidden="true"></span>
|
|
19
19
|
<span class="VPNavBarStarText">{{ github_star_text }}</span>
|
|
20
|
-
<span class="VPNavBarStarCount" aria-hidden="true"{% unless
|
|
20
|
+
{% assign github_star_baked_count = nil %}{% if github_star_show_count %}{% assign github_star_baked_count = site.jekyll_vitepress_github_star_count.compact %}{% endif %}<span class="VPNavBarStarCount" aria-hidden="true"{% unless github_star_baked_count %} hidden{% endunless %}>{{ github_star_baked_count }}</span>
|
|
21
21
|
</a>
|
|
22
22
|
</div>
|
|
23
23
|
{% endif %}
|
|
@@ -25,9 +25,7 @@
|
|
|
25
25
|
<div class="{{ social_star_class }} VPNavBarSponsor"{% if include.variant == 'navbar' %} id="vp-nav-sponsor"{% endif %}>
|
|
26
26
|
<a class="{{ social_star_link_class }} VPNavBarSponsorLink" href="{{ github_sponsor_url }}" aria-label="{{ github_sponsor_label | escape }}" target="_blank" rel="noreferrer noopener">
|
|
27
27
|
<span class="VPNavBarStarIcon VPNavBarSponsorIcon" aria-hidden="true">
|
|
28
|
-
|
|
29
|
-
<path d="M7.655 14.916v-.001h-.002l-.006-.003-.018-.01a22.066 22.066 0 0 1-3.744-2.584C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.044 5.231-3.886 6.818a22.094 22.094 0 0 1-3.433 2.414 7.152 7.152 0 0 1-.31.17l-.018.01-.008.004a.75.75 0 0 1-.69 0Z"></path>
|
|
30
|
-
</svg>
|
|
28
|
+
{% include sponsor_heart.html %}
|
|
31
29
|
</span>
|
|
32
30
|
<span class="VPNavBarStarText">{{ github_sponsor_text }}</span>
|
|
33
31
|
</a>
|
data/_includes/seo.html
CHANGED
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
<meta property="og:site_name" content="{{ site.title | default: site.jekyll_vitepress.branding.site_title | escape }}">
|
|
18
18
|
<meta property="og:title" content="{{ seo.share_title | default: seo.page_title | escape }}">
|
|
19
|
-
{%
|
|
19
|
+
{% assign share_description = seo.share_description | default: seo.description %}
|
|
20
|
+
{% if share_description %}<meta property="og:description" content="{{ share_description | escape }}">{% endif %}
|
|
20
21
|
{% if seo.canonical_url %}<meta property="og:url" content="{{ seo.canonical_url | escape }}">{% endif %}
|
|
21
22
|
<meta property="og:type" content="{{ seo.og_type }}">
|
|
22
23
|
<meta property="og:locale" content="{{ seo.locale | escape }}">
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
|
|
43
44
|
<meta name="twitter:card" content="{{ seo.twitter.card | escape }}">
|
|
44
45
|
<meta name="twitter:title" content="{{ seo.share_title | default: seo.page_title | escape }}">
|
|
45
|
-
{% if
|
|
46
|
+
{% if share_description %}<meta name="twitter:description" content="{{ share_description | escape }}">{% endif %}
|
|
46
47
|
{% if seo.image.url %}<meta name="twitter:image" content="{{ seo.image.url | escape }}">{% endif %}
|
|
47
48
|
{% if seo.image.alt %}<meta name="twitter:image:alt" content="{{ seo.image.alt | escape }}">{% endif %}
|
|
48
49
|
{% if seo.twitter.site %}<meta name="twitter:site" content="{{ seo.twitter.site | escape }}">{% endif %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg class="VPSponsorHeart" viewBox="0 0 16 16" focusable="false"><path class="VPSponsorHeartFill" d="M7.655 14.916v-.001h-.002l-.006-.003-.018-.01a22.066 22.066 0 0 1-3.744-2.584C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.044 5.231-3.886 6.818a22.094 22.094 0 0 1-3.433 2.414 7.152 7.152 0 0 1-.31.17l-.018.01-.008.004a.75.75 0 0 1-.69 0Z"></path><path class="VPSponsorHeartOutline" d="m8 14.25.345.666a.75.75 0 0 1-.69 0l-.008-.004-.018-.01a7.152 7.152 0 0 1-.31-.17 22.055 22.055 0 0 1-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.066 22.066 0 0 1-3.744 2.584l-.018.01-.006.003h-.002ZM4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.58 20.58 0 0 0 8 13.393a20.58 20.58 0 0 0 3.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.749.749 0 0 1-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5Z"></path></svg>
|