jekyll-theme-profile 2.1.1 → 2.2.1
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/_config.yml +13 -0
- data/_includes/awesome-nav-breadcrumbs.html +0 -3
- data/_includes/head.html +1 -0
- data/_includes/header-appbar.html +3 -0
- data/_includes/header-sidebar.html +3 -0
- data/_includes/header-stacked.html +14 -9
- data/_includes/header-topbar.html +6 -1
- data/_includes/resolve-versioning.html +16 -0
- data/_includes/version-selector.html +22 -0
- data/_includes/version-warning.html +15 -0
- data/_layouts/default.html +2 -1
- data/_layouts/docs.html +1 -0
- data/_sass/_main.scss +18 -0
- data/assets/js/versioning.js +300 -0
- metadata +6 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aa628df566d3dd2147c61603e880b27c10b759a1d125e9003cb4a2058f7fa60c
|
|
4
|
+
data.tar.gz: 5a3e21311ad8c9cf6c9623ad445bdea4357053eb9a81d9c1800974920d34302c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 758bff4b0b36a335260f4da19132cc1c599e46212d9035b03f59e665e64ff70d7f4ffe0097c42097c9ce6ee04243ac581a54784eef230b3896fe75a7e3987956
|
|
7
|
+
data.tar.gz: '09fb03e94567c4ff551e017fc8b5450cbadcd2207e89433dc7150eb584aab0e664548677d762df3c023aa18d60c07dd0f735df04b4fe260252156391b7889f17'
|
data/_config.yml
CHANGED
|
@@ -34,6 +34,19 @@ repo_info: true # Show the information for the source of this project
|
|
|
34
34
|
user_metadata: true # Show the metadata associated with the user
|
|
35
35
|
profile_link: true # Show a link to the github profile for the user
|
|
36
36
|
|
|
37
|
+
####################
|
|
38
|
+
# Versioned docs settings
|
|
39
|
+
# versions:
|
|
40
|
+
# enabled: true
|
|
41
|
+
# config: /versions.json
|
|
42
|
+
# prefix: ""
|
|
43
|
+
# # config and prefix are emitted exactly as configured here
|
|
44
|
+
# # versioning is enabled only when this block is present, or when enabled is explicitly true
|
|
45
|
+
# show_warning: true
|
|
46
|
+
# warning_title: Non-default version
|
|
47
|
+
# warning_message: You are viewing a non-default version of these docs.
|
|
48
|
+
# unavailable_label: Version info unavailable
|
|
49
|
+
|
|
37
50
|
##########################
|
|
38
51
|
# # Social media settings
|
|
39
52
|
# icon_color: "#959da5" # The color of the social media icons on the site
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
<div class="Breadcrumb d-flex flex-items-center">
|
|
2
2
|
<nav aria-label="Breadcrumb" class="f5">
|
|
3
3
|
<ol class="breadcrumb">
|
|
4
|
-
<li class="breadcrumb-item">
|
|
5
|
-
<a href="{{ '/' | relative_url }}">home</a>
|
|
6
|
-
</li>
|
|
7
4
|
{% if page.breadcrumbs and page.breadcrumbs.size > 0 %}
|
|
8
5
|
{% for crumb in page.breadcrumbs %}
|
|
9
6
|
{% if forloop.last %}
|
data/_includes/head.html
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
<script src="{{ '/assets/js/theme-toggle.js' | relative_url }}"></script>
|
|
30
30
|
<script src="{{ '/assets/js/anchor-links.js' | relative_url }}"></script>
|
|
31
31
|
<script src="{{ '/assets/js/topbar.js' | relative_url }}"></script>
|
|
32
|
+
<script src="{{ '/assets/js/versioning.js' | relative_url }}"></script>
|
|
32
33
|
<script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
|
|
33
34
|
<script src="{{ '/assets/js/mermaid.js' | relative_url }}"></script>
|
|
34
35
|
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
<span class="octicon octicon-mark-github-24"></span>
|
|
15
15
|
<span class="h4 text-semibold mx-3">{{ name }}</span>
|
|
16
16
|
</a>
|
|
17
|
+
<span class="d-none d-sm-block flex-content-center ml-2">
|
|
18
|
+
{% include version-selector.html %}
|
|
19
|
+
</span>
|
|
17
20
|
</div>
|
|
18
21
|
<div class="AppHeader-item d-flex flex-items-center">
|
|
19
22
|
{% include toggle.html %}
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
<div class="px-5 py-2">
|
|
37
37
|
{%- include masthead.html size="128px" %}
|
|
38
38
|
</div>
|
|
39
|
+
<div class="d-flex flex-justify-center ml-2">
|
|
40
|
+
{% include version-selector.html %}
|
|
41
|
+
</div>
|
|
39
42
|
{%- if site.repo_info and site.repository %}
|
|
40
43
|
<div class="py-2">
|
|
41
44
|
{% include mini-repo-info-card.html class="Header-link no-underline" %}
|
|
@@ -12,16 +12,21 @@
|
|
|
12
12
|
{%- endif %}
|
|
13
13
|
</div>
|
|
14
14
|
{%- if site.nav %}
|
|
15
|
-
<div class="Header
|
|
16
|
-
<div class="
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<div class="d-flex flex-1 flex-sm-grow-0 flex-justify-start">
|
|
20
|
-
<div class="d-flex d-sm-none">
|
|
21
|
-
{% include nav-overlay.html%}
|
|
15
|
+
<div class="Header z-2 position-sticky top-0 topbar">
|
|
16
|
+
<div class="container-xl d-flex flex-row flex-1">
|
|
17
|
+
<div class="d-flex flex-1 hide-sm">
|
|
18
|
+
{% include nav.html %}
|
|
22
19
|
</div>
|
|
23
|
-
<div class="d-flex">
|
|
24
|
-
|
|
20
|
+
<div class="d-flex flex-sm-grow-0 flex-justify-start">
|
|
21
|
+
<div class="d-flex d-sm-none">
|
|
22
|
+
{% include nav-overlay.html%}
|
|
23
|
+
</div>
|
|
24
|
+
<div class="d-flex">
|
|
25
|
+
<div class="m-2">
|
|
26
|
+
{% include version-selector.html %}
|
|
27
|
+
</div>
|
|
28
|
+
{% include toggle.html %}
|
|
29
|
+
</div>
|
|
25
30
|
</div>
|
|
26
31
|
</div>
|
|
27
32
|
</div>
|
|
@@ -17,7 +17,12 @@
|
|
|
17
17
|
<span class="octicon octicon-mark-github-24"></span>
|
|
18
18
|
</a>
|
|
19
19
|
</div>
|
|
20
|
-
<
|
|
20
|
+
<div class="Header-item Header-link Header-item--full">
|
|
21
|
+
<a href="{{ site.baseurl }}/">{{ name }}</a>
|
|
22
|
+
<div class="d-inline-block ml-4">
|
|
23
|
+
{% include version-selector.html %}
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
21
26
|
<div class="Header-item">
|
|
22
27
|
{% include toggle.html %}
|
|
23
28
|
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{%- assign versions_enabled = false -%}
|
|
2
|
+
{%- if site.versions and site.versions != empty -%}
|
|
3
|
+
{%- assign versions_enabled = true -%}
|
|
4
|
+
{%- endif -%}
|
|
5
|
+
{%- if site.versions and site.versions.enabled != nil -%}
|
|
6
|
+
{%- assign versions_enabled = site.versions.enabled -%}
|
|
7
|
+
{%- endif -%}
|
|
8
|
+
{%- if page.versions and page.versions.enabled != nil -%}
|
|
9
|
+
{%- assign versions_enabled = page.versions.enabled -%}
|
|
10
|
+
{%- endif -%}
|
|
11
|
+
{%- assign versions_json = site.versions.config | default: "/versions.json" -%}
|
|
12
|
+
{%- assign versions_prefix = site.versions.prefix | default: "" -%}
|
|
13
|
+
{%- unless versions_enabled -%}
|
|
14
|
+
{%- assign versions_json = "" -%}
|
|
15
|
+
{%- assign versions_prefix = "" -%}
|
|
16
|
+
{%- endunless -%}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{%- assign unavailable_label = site.versions.unavailable_label | default: "Version info unavailable" -%}
|
|
2
|
+
<details class="version-selector details-reset details-overlay d-none" data-version-selector
|
|
3
|
+
data-version-unavailable-label="{{ unavailable_label }}">
|
|
4
|
+
<summary class="version-selector__trigger d-flex flex-items-center text-nowrap" aria-haspopup="true">
|
|
5
|
+
<span class="f6" data-version-current-label></span>
|
|
6
|
+
<span class="octicon octicon-chevron-down-16 ml-1"></span>
|
|
7
|
+
</summary>
|
|
8
|
+
<details-menu class="SelectMenu" role="menu">
|
|
9
|
+
<div class="SelectMenu-modal">
|
|
10
|
+
<div class="SelectMenu-header">
|
|
11
|
+
<div tabindex="-1" class="SelectMenu-title">Versions</div>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="SelectMenu-list" data-version-options>
|
|
14
|
+
<div class="SelectMenu-item color-fg-muted" data-version-loading>Loading versions...</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="SelectMenu-footer">
|
|
17
|
+
<div class="ActionList-sectionDivider mt-0 mb-1"></div>
|
|
18
|
+
<div class="color-fg-muted f6" data-version-status></div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</details-menu>
|
|
22
|
+
</details>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{%- assign show_version_warning = site.versions.show_warning | default: false -%}
|
|
2
|
+
{%- assign version_warning_title = site.versions.warning_title | default: "Non-default version" -%}
|
|
3
|
+
{%- assign version_warning_message = site.versions.warning_message | default: "You are viewing a non-default version of these docs." -%}
|
|
4
|
+
{%- if show_version_warning != false -%}
|
|
5
|
+
<div class="d-none mb-4" data-version-warning aria-live="polite"
|
|
6
|
+
data-version-warning-message="{{ version_warning_message | escape }}">
|
|
7
|
+
<div class="border rounded-2 color-bg-subtle p-3 d-flex flex-items-start">
|
|
8
|
+
<span class="octicon octicon-alert-16 mr-2 mt-1 color-fg-attention"></span>
|
|
9
|
+
<div class="f6 color-fg-default">
|
|
10
|
+
<strong class="d-block mb-1">{{ version_warning_title }}</strong>
|
|
11
|
+
<span data-version-warning-text>{{ version_warning_message }}</span>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
{%- endif -%}
|
data/_layouts/default.html
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{%- assign style = page.style | default: layout.style | default: site.style | default: "appbar" %}
|
|
2
2
|
{%- assign light_theme = site.light_theme | default: "light" %}
|
|
3
3
|
{%- assign dark_theme = site.dark_theme | default: "dark" %}
|
|
4
|
+
{%- include resolve-versioning.html %}
|
|
4
5
|
<!doctype html>
|
|
5
|
-
<html lang="en" data-color-mode="auto" data-light-theme="{{ light_theme }}" data-dark-theme="{{ dark_theme }}">
|
|
6
|
+
<html lang="en" data-color-mode="auto" data-light-theme="{{ light_theme }}" data-dark-theme="{{ dark_theme }}" data-baseurl="{{ site.baseurl }}" data-versioning-enabled="{{ versions_enabled }}"{% if versions_enabled %} data-versions-json="{{ versions_json }}" data-versioning-prefix="{{ versions_prefix }}"{% endif %}>
|
|
6
7
|
|
|
7
8
|
{%- include head.html %}
|
|
8
9
|
|
data/_layouts/docs.html
CHANGED
data/_sass/_main.scss
CHANGED
|
@@ -160,6 +160,24 @@ body::before {
|
|
|
160
160
|
color: var(--fgColor-default, var(--color-fg-default));
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
.version-selector__trigger {
|
|
164
|
+
color: var(--fgColor-default, var(--color-fg-default));
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
text-decoration: none;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.version-selector__trigger:hover {
|
|
170
|
+
text-decoration: none;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.AppHeader .version-selector__trigger {
|
|
174
|
+
color: var(--fgColor-default, var(--color-fg-default));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.Header .version-selector__trigger {
|
|
178
|
+
color: var(--header-fgColor-default, var(--color-header-text));
|
|
179
|
+
}
|
|
180
|
+
|
|
163
181
|
.ActionListItem {
|
|
164
182
|
background-color: var(--control-transparent-bgColor-rest, #0000);
|
|
165
183
|
border-radius: var(--borderRadius-medium, 0.375rem);
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
document.addEventListener('DOMContentLoaded', function () {
|
|
2
|
+
var html = document.documentElement;
|
|
3
|
+
var selector = document.querySelector('[data-version-selector]');
|
|
4
|
+
var warning = document.querySelector('[data-version-warning]');
|
|
5
|
+
|
|
6
|
+
if (!selector && !warning) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
var versioningEnabled = html.dataset.versioningEnabled === 'true';
|
|
11
|
+
var versionsUrl = html.dataset.versionsJson || '/versions.json';
|
|
12
|
+
var versioningPrefix = html.dataset.versioningPrefix || '';
|
|
13
|
+
var defaultAlias = normalizeKey(html.dataset.defaultDocAlias || 'latest');
|
|
14
|
+
|
|
15
|
+
if (!versioningEnabled) {
|
|
16
|
+
renderFallback();
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function ensureLeadingSlash(path) {
|
|
21
|
+
if (!path) {
|
|
22
|
+
return '/';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return path.charAt(0) === '/' ? path : '/' + path;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function stripTrailingSlash(path) {
|
|
29
|
+
if (!path || path === '/') {
|
|
30
|
+
return '/';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return path.replace(/\/+$/, '') || '/';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function normalizeKey(value) {
|
|
37
|
+
return String(value || '').trim().replace(/^\/+|\/+$/g, '');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function stripVersioningPrefix(path) {
|
|
41
|
+
var normalized = ensureLeadingSlash(path);
|
|
42
|
+
var normalizedPrefix = stripTrailingSlash(ensureLeadingSlash(versioningPrefix || ''));
|
|
43
|
+
|
|
44
|
+
if (!normalizedPrefix || normalizedPrefix === '/') {
|
|
45
|
+
return normalized;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (normalized === normalizedPrefix) {
|
|
49
|
+
return '/';
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (normalized.indexOf(normalizedPrefix + '/') === 0) {
|
|
53
|
+
return normalized.slice(normalizedPrefix.length) || '/';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return normalized;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function normalizePath(value) {
|
|
60
|
+
var path = value || '/';
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
path = new URL(path, window.location.origin).pathname;
|
|
64
|
+
} catch (error) {
|
|
65
|
+
path = String(path);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return stripVersioningPrefix(ensureLeadingSlash(path));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function versionRoot(key) {
|
|
72
|
+
var normalized = normalizeKey(key);
|
|
73
|
+
return normalized ? '/' + normalized + '/' : '/';
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function buildHref(path) {
|
|
77
|
+
var normalized = normalizePath(path);
|
|
78
|
+
var normalizedPrefix = stripTrailingSlash(ensureLeadingSlash(versioningPrefix || ''));
|
|
79
|
+
|
|
80
|
+
if (!normalizedPrefix || normalizedPrefix === '/') {
|
|
81
|
+
return normalized;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (normalized === '/') {
|
|
85
|
+
return normalizedPrefix;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return normalizedPrefix + normalized;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function joinPaths(left, right) {
|
|
92
|
+
var leftPath = stripTrailingSlash(normalizePath(left));
|
|
93
|
+
var rightPath = normalizePath(right);
|
|
94
|
+
var keepTrailingSlash = right === '/' || /\/$/.test(String(right || ''));
|
|
95
|
+
|
|
96
|
+
if (leftPath === '/') {
|
|
97
|
+
return keepTrailingSlash ? stripTrailingSlash(rightPath) + '/' : rightPath;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (rightPath === '/') {
|
|
101
|
+
return leftPath + '/';
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
var joined = stripTrailingSlash(leftPath + '/' + rightPath.replace(/^\//, ''));
|
|
105
|
+
return keepTrailingSlash ? joined + '/' : joined;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function matchesRoot(pathname, root) {
|
|
109
|
+
if (root === '/') {
|
|
110
|
+
return pathname === '/';
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return pathname === root.slice(0, -1) || pathname.indexOf(root) === 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function normalizeVersions(payload) {
|
|
117
|
+
if (!Array.isArray(payload)) {
|
|
118
|
+
return [];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
var targets = [];
|
|
122
|
+
var seen = {};
|
|
123
|
+
|
|
124
|
+
payload.forEach(function (entry) {
|
|
125
|
+
if (!entry || !entry.version) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
var version = normalizeKey(entry.version);
|
|
130
|
+
var title = entry.title || version;
|
|
131
|
+
var aliases = Array.isArray(entry.aliases) ? entry.aliases : [];
|
|
132
|
+
var normalizedAliases = aliases.map(normalizeKey).filter(Boolean);
|
|
133
|
+
var hasDefaultAlias = normalizedAliases.indexOf(defaultAlias) !== -1;
|
|
134
|
+
|
|
135
|
+
if (!version || seen[version]) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
seen[version] = true;
|
|
140
|
+
targets.push({
|
|
141
|
+
key: version,
|
|
142
|
+
label: hasDefaultAlias ? title + ' (' + defaultAlias + ')' : title,
|
|
143
|
+
root: versionRoot(version),
|
|
144
|
+
version: version,
|
|
145
|
+
aliases: normalizedAliases
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
return targets;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function findActiveTarget(pathname, targets) {
|
|
153
|
+
var active = null;
|
|
154
|
+
|
|
155
|
+
targets.forEach(function (target) {
|
|
156
|
+
var targetRoots = [target.root].concat(target.aliases.map(versionRoot));
|
|
157
|
+
|
|
158
|
+
targetRoots.forEach(function (root) {
|
|
159
|
+
if (matchesRoot(pathname, root) && (!active || root.length > active.root.length)) {
|
|
160
|
+
active = {
|
|
161
|
+
key: target.key,
|
|
162
|
+
label: target.label,
|
|
163
|
+
root: root,
|
|
164
|
+
version: target.version,
|
|
165
|
+
aliases: target.aliases
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
if (matchesRoot(pathname, target.root) && (!active || target.root.length > active.root.length)) {
|
|
171
|
+
active = target;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
if (active) {
|
|
176
|
+
return active;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function stripActiveRoot(pathname, activeTarget) {
|
|
183
|
+
if (!activeTarget || activeTarget.root === '/') {
|
|
184
|
+
return pathname;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (!matchesRoot(pathname, activeTarget.root)) {
|
|
188
|
+
return pathname;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (pathname === activeTarget.root.slice(0, -1)) {
|
|
192
|
+
return '/';
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return pathname.slice(activeTarget.root.length - 1) || '/';
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function findDefaultTarget(targets) {
|
|
199
|
+
return targets.find(function (target) {
|
|
200
|
+
return target.key === defaultAlias || target.aliases.indexOf(defaultAlias) !== -1;
|
|
201
|
+
}) || targets[0] || null;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function renderFallback() {
|
|
205
|
+
if (selector) {
|
|
206
|
+
selector.classList.add('d-none');
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (warning) {
|
|
210
|
+
warning.classList.add('d-none');
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function updateWarning(activeTarget, defaultTarget) {
|
|
215
|
+
if (!warning) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
var message = warning.dataset.versionWarningMessage || 'You are viewing a non-default version of these docs.';
|
|
220
|
+
var text = warning.querySelector('[data-version-warning-text]');
|
|
221
|
+
|
|
222
|
+
if (text) {
|
|
223
|
+
text.textContent = message;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (activeTarget && defaultTarget && activeTarget.version !== defaultTarget.version) {
|
|
227
|
+
warning.classList.remove('d-none');
|
|
228
|
+
} else {
|
|
229
|
+
warning.classList.add('d-none');
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function render(payload) {
|
|
234
|
+
var targets = normalizeVersions(payload);
|
|
235
|
+
|
|
236
|
+
if (!targets.length) {
|
|
237
|
+
renderFallback();
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
var currentPath = normalizePath(window.location.pathname);
|
|
242
|
+
var activeTarget = findActiveTarget(currentPath, targets);
|
|
243
|
+
var defaultTarget = findDefaultTarget(targets);
|
|
244
|
+
var relativePath = stripActiveRoot(currentPath, activeTarget);
|
|
245
|
+
var currentSearch = window.location.search || '';
|
|
246
|
+
var currentHash = window.location.hash || '';
|
|
247
|
+
|
|
248
|
+
if (selector) {
|
|
249
|
+
var list = selector.querySelector('[data-version-options]');
|
|
250
|
+
var currentLabel = selector.querySelector('[data-version-current-label]');
|
|
251
|
+
var status = selector.querySelector('[data-version-status]');
|
|
252
|
+
|
|
253
|
+
selector.classList.remove('d-none');
|
|
254
|
+
|
|
255
|
+
if (list) {
|
|
256
|
+
list.innerHTML = '';
|
|
257
|
+
|
|
258
|
+
targets.forEach(function (target) {
|
|
259
|
+
var item = document.createElement('a');
|
|
260
|
+
item.className = 'SelectMenu-item';
|
|
261
|
+
item.setAttribute('role', 'menuitem');
|
|
262
|
+
item.href = buildHref(joinPaths(target.root, relativePath)) + currentSearch + currentHash;
|
|
263
|
+
item.textContent = target.label;
|
|
264
|
+
|
|
265
|
+
if (activeTarget && target.key === activeTarget.key) {
|
|
266
|
+
item.setAttribute('aria-current', 'page');
|
|
267
|
+
item.classList.add('text-semibold');
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
item.addEventListener('click', function () {
|
|
271
|
+
selector.removeAttribute('open');
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
list.appendChild(item);
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (currentLabel) {
|
|
279
|
+
currentLabel.textContent = activeTarget ? activeTarget.label : '';
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if (status) {
|
|
283
|
+
status.textContent = targets.length + ' target' + (targets.length === 1 ? '' : 's') + ' available';
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
updateWarning(activeTarget, defaultTarget);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
fetch(versionsUrl, { cache: 'no-cache' })
|
|
291
|
+
.then(function (response) {
|
|
292
|
+
if (!response.ok) {
|
|
293
|
+
throw new Error('Unable to load version metadata');
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
return response.json();
|
|
297
|
+
})
|
|
298
|
+
.then(render)
|
|
299
|
+
.catch(renderFallback);
|
|
300
|
+
});
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-theme-profile
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Allison Thackston
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll
|
|
@@ -117,9 +117,12 @@ files:
|
|
|
117
117
|
- _includes/related.html
|
|
118
118
|
- _includes/repo-card.html
|
|
119
119
|
- _includes/repositories.html
|
|
120
|
+
- _includes/resolve-versioning.html
|
|
120
121
|
- _includes/social.html
|
|
121
122
|
- _includes/toggle.html
|
|
122
123
|
- _includes/user-metadata.html
|
|
124
|
+
- _includes/version-selector.html
|
|
125
|
+
- _includes/version-warning.html
|
|
123
126
|
- _layouts/category_index.html
|
|
124
127
|
- _layouts/category_layout.html
|
|
125
128
|
- _layouts/default.html
|
|
@@ -152,6 +155,7 @@ files:
|
|
|
152
155
|
- assets/js/mermaid.js
|
|
153
156
|
- assets/js/theme-toggle.js
|
|
154
157
|
- assets/js/topbar.js
|
|
158
|
+
- assets/js/versioning.js
|
|
155
159
|
homepage: https://www.primerpages.com
|
|
156
160
|
licenses:
|
|
157
161
|
- MIT
|