jekyll-theme-centos 2.52.0.beta.102 → 2.52.0.beta.104
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/_data/base/announcement_schema.yml +0 -1
- data/_data/base/backtotop_schema.yml +7 -4
- data/_data/base/calendar_schema.yml +6 -4
- data/_data/base/card_schema.yml +2 -2
- data/_data/base/copyright_schema.yml +1 -1
- data/_data/base/datatable_schema.yml +8 -6
- data/_data/base/fontawesome_schema.yml +10 -2
- data/_data/base/heading_anchor.yml +1 -1
- data/_data/base/heading_anchor_schema.yml +1 -1
- data/_data/base/highlight_schema.yml +1433 -60
- data/_data/base/link_schema.yml +1 -1
- data/_data/base/preview_schema.yml +88 -0
- data/_data/base/project.yml +1 -1
- data/_includes/base/color-table.html.liquid +4 -4
- data/_includes/base/configuration_variables-default-cell.html.liquid +83 -0
- data/_includes/base/configuration_variables-nested.html.liquid +4 -11
- data/_includes/base/configuration_variables.html.liquid +3 -11
- data/_includes/base/copyvalue.html.liquid +23 -17
- data/_includes/base/download_architecture.html.liquid +13 -11
- data/_includes/base/download_documentation.html.liquid +1 -1
- data/_includes/base/download_filevalue.html.liquid +1 -1
- data/_includes/base/footer.html.liquid +1 -1
- data/_includes/base/head.html.liquid +12 -10
- data/_includes/base/highlight.html.liquid +40 -50
- data/_includes/base/navbar.html.liquid +4 -4
- data/_includes/base/preview.html.liquid +119 -0
- data/_sass/base/_calendar.scss +2 -1
- data/_sass/base/_customization.scss +61 -52
- data/_sass/base/_highlight-theme.scss +102 -0
- data/_sass/base/_preview.scss +74 -0
- data/_sass/base/_theme-colors.scss +8 -5
- data/_sass/base/_variables.scss +55 -73
- data/assets/css/base/stylesheet.min.scss +3 -1
- data/assets/js/base/backtotop.js +2 -2
- data/assets/js/base/copyvalue.js +3 -0
- data/assets/js/base/datatable.js +27 -9
- data/assets/js/base/highlight.js +86 -12
- metadata +6 -1
data/_sass/base/_variables.scss
CHANGED
|
@@ -20,39 +20,36 @@
|
|
|
20
20
|
// ────────────────────────────────────────────────────────────────────────────
|
|
21
21
|
// Function: Get saturation multiplier for a given shade grade
|
|
22
22
|
// ────────────────────────────────────────────────────────────────────────────
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
// Using 2.0x multiplier to reach 100% from base ~50% saturation
|
|
23
|
+
// Light shades (50-400) get less saturated for a softer look on a light
|
|
24
|
+
// background; dark shades (800-950) get more, to counter the desaturation
|
|
25
|
+
// Bootstrap's own algorithm would otherwise produce. The 950 multiplier
|
|
26
|
+
// (2.0x) pushes toward the wallpaper's 100% saturation, but only reaches it
|
|
27
|
+
// for a base color already at 50%+ saturation — see saturated-shade() below
|
|
28
|
+
// for how this plays out for each CentOS color.
|
|
30
29
|
@function saturation-multiplier($shade) {
|
|
31
30
|
@if $shade <= 400 {
|
|
32
|
-
@return 0.6;
|
|
31
|
+
@return 0.6;
|
|
33
32
|
} @else if $shade == 500 {
|
|
34
|
-
@return 1.0;
|
|
33
|
+
@return 1.0;
|
|
35
34
|
} @else if $shade == 600 {
|
|
36
|
-
@return 1.0;
|
|
35
|
+
@return 1.0;
|
|
37
36
|
} @else if $shade == 700 {
|
|
38
|
-
@return 1.0;
|
|
37
|
+
@return 1.0;
|
|
39
38
|
} @else if $shade == 800 {
|
|
40
|
-
@return 1.1;
|
|
39
|
+
@return 1.1;
|
|
41
40
|
} @else if $shade == 900 {
|
|
42
|
-
@return 1.8;
|
|
41
|
+
@return 1.8;
|
|
43
42
|
} @else if $shade == 950 {
|
|
44
|
-
@return 2.0;
|
|
43
|
+
@return 2.0;
|
|
45
44
|
} @else {
|
|
46
|
-
@return 1.0;
|
|
45
|
+
@return 1.0;
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
// ────────────────────────────────────────────────────────────────────────────
|
|
51
50
|
// Function: Calculate target lightness for a shade grade
|
|
52
51
|
// ────────────────────────────────────────────────────────────────────────────
|
|
53
|
-
//
|
|
54
|
-
// Creates smooth interpolation from light to dark
|
|
55
|
-
// Option 2: Target 8% lightness for grade 950 (matches wallpaper ~16% brightness)
|
|
52
|
+
// Interpolates lightness smoothly from light (grade 50) to dark (grade 950).
|
|
56
53
|
@function target-lightness($shade, $base-lightness) {
|
|
57
54
|
@if $shade < 500 {
|
|
58
55
|
// Light shades: interpolate from 95% (very light) down to base lightness
|
|
@@ -67,8 +64,7 @@
|
|
|
67
64
|
// Grade 900: transition toward wallpaper lightness
|
|
68
65
|
@return $base-lightness - math.div(900 - 500, 500) * ($base-lightness - 10%);
|
|
69
66
|
} @else if $shade == 950 {
|
|
70
|
-
//
|
|
71
|
-
// All grade-950 colors use 8% lightness to match wallpaper depth
|
|
67
|
+
// Every color's grade-950 targets the wallpaper's 8% lightness.
|
|
72
68
|
@return 8%;
|
|
73
69
|
} @else {
|
|
74
70
|
// Default fallback
|
|
@@ -77,29 +73,21 @@
|
|
|
77
73
|
}
|
|
78
74
|
|
|
79
75
|
// ────────────────────────────────────────────────────────────────────────────
|
|
80
|
-
// Function: Generate saturation-normalized shade
|
|
76
|
+
// Function: Generate a saturation-normalized shade
|
|
81
77
|
// ────────────────────────────────────────────────────────────────────────────
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
78
|
+
// Extracts HSL from the base color, applies the multipliers above, and
|
|
79
|
+
// returns the shade as HSL. Kept as a function rather than hardcoded shades
|
|
80
|
+
// so every color family follows the same rule and stays internally
|
|
81
|
+
// consistent if a base color ever changes.
|
|
82
|
+
//
|
|
83
|
+
// Grade 950 targets the wallpaper's saturation and lightness (see the top
|
|
84
|
+
// of this file), but only reaches it for a base color already saturated
|
|
85
|
+
// enough for the 2.0x multiplier to hit 100% — orange, blue, and green all
|
|
86
|
+
// do. Purple's base saturation is too low, so purple-950 lands close to the
|
|
87
|
+
// wallpaper's dark corner rather than matching it exactly; see
|
|
88
|
+
// src/YAML/color.yml or the generated src/SASS/_light-dark.scss for its
|
|
89
|
+
// actual current value.
|
|
85
90
|
@function saturated-shade($color, $shade) {
|
|
86
|
-
// ────────────────────────────────────────────────────────────────────────────
|
|
87
|
-
// Function: Generate saturation-normalized shade with wallpaper alignment
|
|
88
|
-
// ────────────────────────────────────────────────────────────────────────────
|
|
89
|
-
// Design Principle: Grade-950 colors maintain native hues while achieving
|
|
90
|
-
// wallpaper aesthetic through shared saturation (100%) and lightness (~8%)
|
|
91
|
-
//
|
|
92
|
-
// Wallpaper Reference: #1A0029 (100% saturation, 8% lightness)
|
|
93
|
-
// Grade-950 Alignment: All colors achieve 100% saturation + 8% lightness
|
|
94
|
-
// Result: UI colors share wallpaper depth while maintaining brand identity
|
|
95
|
-
//
|
|
96
|
-
// Why function-based instead of hardcoded?
|
|
97
|
-
// - Maintains hue consistency within each color family
|
|
98
|
-
// - Preserves algorithmic cohesion across all 4 color families
|
|
99
|
-
// - Achieves wallpaper correlation through saturation/brightness alignment
|
|
100
|
-
// - Creates unified visual language respecting color family rules
|
|
101
|
-
// ────────────────────────────────────────────────────────────────────────────
|
|
102
|
-
|
|
103
91
|
// Extract current HSL values from the color
|
|
104
92
|
$current-hue: hue($color);
|
|
105
93
|
$current-saturation: saturation($color);
|
|
@@ -128,38 +116,25 @@ $centos-base-colors: (
|
|
|
128
116
|
$centos-color-shades: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950;
|
|
129
117
|
|
|
130
118
|
// --------------------------------------------------------------------------------
|
|
131
|
-
// Theme
|
|
132
|
-
//
|
|
133
|
-
//
|
|
134
|
-
//
|
|
135
|
-
//
|
|
136
|
-
//
|
|
137
|
-
//
|
|
138
|
-
// outcomes. Brand colors remain from official CentOS specification.
|
|
139
|
-
//
|
|
140
|
-
// Color Theory Rationale:
|
|
141
|
-
// - Orange = Caution/Warning (warm, attention-getting, ISO standard)
|
|
142
|
-
// - Blue = Information (cool, trustworthy, ISO standard)
|
|
143
|
-
// - Red = Danger (alert, critical, ISO standard)
|
|
144
|
-
// - Green = Success (positive, safe, ISO standard)
|
|
145
|
-
// - Purple = Brand primary (custom, strong visual identity)
|
|
146
|
-
//
|
|
147
|
-
// Mapping:
|
|
148
|
-
// - Primary: centos-purple #A54C93 (brand primary - balanced for visual prominence)
|
|
149
|
-
// - Secondary: centos-orange #B27800 (brand secondary - balanced for color harmony)
|
|
150
|
-
// - Success: centos-green #4A8400 darkened (positive outcomes, from #84B800)
|
|
151
|
-
// - Warning: centos-orange #C86A00 darkened (caution/attention, warm tone - correct psychology)
|
|
152
|
-
// - Danger: External red #C62828 (critical/destructive - no CentOS equivalent)
|
|
153
|
-
// - Info: External blue #1976D2 (informational - distinguishes from warning)
|
|
119
|
+
// Theme colors
|
|
120
|
+
// --------------------------------------------------------------------------------
|
|
121
|
+
// Primary and secondary come straight from the CentOS brand palette. Success
|
|
122
|
+
// and warning are darkened centos-green/centos-orange, keeping them on-brand
|
|
123
|
+
// while following the ISO 3864 color meanings (green = success, orange =
|
|
124
|
+
// caution). Danger and info have no CentOS equivalent, so they use ISO
|
|
125
|
+
// 3864's own red and blue instead.
|
|
154
126
|
//
|
|
155
|
-
//
|
|
127
|
+
// All four are WCAG AA verified against both white and black text. After
|
|
128
|
+
// changing one, re-check with:
|
|
129
|
+
// python3 scripts/colors/tools/calculate-contrast.py "#FFFFFF" "<hex>"
|
|
130
|
+
// See color.md for the full contrast and color-psychology write-up.
|
|
156
131
|
// --------------------------------------------------------------------------------
|
|
157
132
|
$primary: map-get($centos-base-colors, 'centos-purple');
|
|
158
|
-
$secondary: map-get($centos-base-colors, 'centos-orange'); //
|
|
159
|
-
$success: #4A8400; // Darkened centos-green
|
|
160
|
-
$warning: #C86A00; // Darkened centos-orange
|
|
161
|
-
$danger: #C62828; // External red
|
|
162
|
-
$info: #1976D2; // External blue
|
|
133
|
+
$secondary: map-get($centos-base-colors, 'centos-orange'); // CentOS brand secondary
|
|
134
|
+
$success: #4A8400; // Darkened centos-green
|
|
135
|
+
$warning: #C86A00; // Darkened centos-orange - warm, urgent
|
|
136
|
+
$danger: #C62828; // External red - no CentOS equivalent
|
|
137
|
+
$info: #1976D2; // External blue - distinguishes from warning
|
|
163
138
|
|
|
164
139
|
// Light and dark are automatically generated from centos-purple using the saturation-normalized
|
|
165
140
|
// shade system. Instead of assigning function results to variables here (which causes Dart Sass
|
|
@@ -174,10 +149,17 @@ $info: #1976D2; // External blue: 4.60:1 (white), 4.56:1 (black) - WCAG AA
|
|
|
174
149
|
$white: #ffffff;
|
|
175
150
|
$black: #000000;
|
|
176
151
|
|
|
152
|
+
// Bootstrap's default inline-code color isn't part of this site's brand
|
|
153
|
+
// and fails WCAG AA against the code background in _customization.scss.
|
|
154
|
+
// This is centos-purple-700.
|
|
155
|
+
$code-color: #673259;
|
|
156
|
+
|
|
177
157
|
// Background and Body variables
|
|
178
158
|
// These control the default background and text colors for the entire page.
|
|
179
159
|
$body-bg: $white;
|
|
180
|
-
$body-color: #1c0d19; //
|
|
160
|
+
$body-color: #1c0d19; // purple-tinted near-black; matches the text_color_hex value
|
|
161
|
+
// paired with the light centos-purple shades (50-400) in
|
|
162
|
+
// src/YAML/color.yml
|
|
181
163
|
|
|
182
164
|
// Bootstrap's color-contrast() function (used by .text-bg-* utilities like
|
|
183
165
|
// .text-bg-light) picks between $color-contrast-dark/-light to pair with a
|
|
@@ -188,8 +170,8 @@ $color-contrast-dark: $body-color;
|
|
|
188
170
|
|
|
189
171
|
// Border and Emphasis colors
|
|
190
172
|
// Used for borders, dividers, and higher-contrast text.
|
|
191
|
-
$border-color: #e8d9e5; //
|
|
192
|
-
$emphasis-color: #d1b3cb; //
|
|
173
|
+
$border-color: #e8d9e5; // light purple-family tint, for borders and dividers
|
|
174
|
+
$emphasis-color: #d1b3cb; // light purple-family tint, higher-contrast than $border-color
|
|
193
175
|
|
|
194
176
|
// Dropdown menu
|
|
195
177
|
$dropdown-dark-bg: $dark;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
/*!
|
|
5
5
|
* CentOS Customization
|
|
6
|
-
* Copyright
|
|
6
|
+
* Copyright (c) 2026 Alain Reguera Delgado
|
|
7
7
|
* Licensed under MIT License (https://opensource.org/licenses/MIT)
|
|
8
8
|
*
|
|
9
9
|
* Customized CSS extensions for the CentOS project built on top of Bootstrap.
|
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
// 6. Add additional custom code here
|
|
43
43
|
@import "base/customization";
|
|
44
44
|
@import "base/download";
|
|
45
|
+
@import "base/preview";
|
|
46
|
+
@import "base/highlight-theme";
|
|
45
47
|
|
|
46
48
|
// 7. Third-party component theme overrides (must load after our own
|
|
47
49
|
// customizations so component-specific corrections win the cascade).
|
data/assets/js/base/backtotop.js
CHANGED
|
@@ -15,8 +15,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const config = {
|
|
18
|
-
diameter: parseInt(scriptTag.dataset.diameter || '
|
|
19
|
-
backgroundColor: scriptTag.dataset.backgroundColor || '#
|
|
18
|
+
diameter: parseInt(scriptTag.dataset.diameter || '44', 10),
|
|
19
|
+
backgroundColor: scriptTag.dataset.backgroundColor || '#A14F8C',
|
|
20
20
|
textColor: scriptTag.dataset.textColor || '#ffffff'
|
|
21
21
|
}
|
|
22
22
|
|
data/assets/js/base/copyvalue.js
CHANGED
|
@@ -126,6 +126,9 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
|
126
126
|
|
|
127
127
|
const handlers = new WeakMap()
|
|
128
128
|
|
|
129
|
+
// .copy-btn is a real <button>, so the browser already turns Enter and
|
|
130
|
+
// Space into a native click — one listener covers mouse, keyboard, and
|
|
131
|
+
// assistive-tech activation.
|
|
129
132
|
document.addEventListener('click', function (e) {
|
|
130
133
|
const button = e.target.closest('.copy-btn')
|
|
131
134
|
if (!button) return
|
data/assets/js/base/datatable.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// first in the document) always runs before DataTables prunes off-page
|
|
9
|
-
// rows from the DOM — otherwise their <code> elements never get 'hljs'.
|
|
1
|
+
// Reads its configuration from data attributes datatable.html.liquid sets
|
|
2
|
+
// on this script tag.
|
|
3
|
+
|
|
4
|
+
// Waits for DOMContentLoaded, same as highlight.js, whose script tag comes
|
|
5
|
+
// first in the document and so runs first: this ordering makes sure every
|
|
6
|
+
// <code> element gets its 'hljs' class before DataTables prunes off-page
|
|
7
|
+
// rows from the DOM.
|
|
10
8
|
document.addEventListener('DOMContentLoaded', () => {
|
|
11
9
|
if (typeof DataTable === 'undefined') {
|
|
12
10
|
console.warn('datatable: DataTable not available')
|
|
@@ -41,7 +39,19 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
41
39
|
wrapper.appendChild(tableEl)
|
|
42
40
|
}
|
|
43
41
|
|
|
42
|
+
// DataTables' autoWidth measures every cell in a detached, unconstrained
|
|
43
|
+
// clone before the table is laid out, so a `.long-value` cell's
|
|
44
|
+
// `overflow-wrap: anywhere` (_customization.scss) never gets a chance
|
|
45
|
+
// to wrap during that measurement — DataTables sees the value's full
|
|
46
|
+
// one-line length and gives its column that much width, starving every
|
|
47
|
+
// other column. Detected by content, not column position or count, so
|
|
48
|
+
// it holds regardless of which column the value ends up in or how many
|
|
49
|
+
// columns the table has. Skipping autoWidth here lets the browser's own
|
|
50
|
+
// table layout size columns instead, which does respect the wrap.
|
|
51
|
+
const hasWrappingLongValue = tableEl.querySelector('.long-value') !== null
|
|
52
|
+
|
|
44
53
|
new DataTable(tableEl, {
|
|
54
|
+
autoWidth: !hasWrappingLongValue,
|
|
45
55
|
paging: enabledCondition,
|
|
46
56
|
info: enabledCondition,
|
|
47
57
|
searching: enabledCondition,
|
|
@@ -55,6 +65,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
55
65
|
next: '<i class="fa-solid fa-chevron-right" aria-hidden="true"></i>',
|
|
56
66
|
last: '<i class="fa-solid fa-angles-right" aria-hidden="true"></i>'
|
|
57
67
|
}
|
|
68
|
+
},
|
|
69
|
+
// DataTables puts the keyboard-focusable sort trigger on a nested
|
|
70
|
+
// `.dt-column-order` span, not the `<th>` itself, so focus-ring has to
|
|
71
|
+
// go there. initComplete runs once the header row exists, which is
|
|
72
|
+
// the earliest point that span can be selected.
|
|
73
|
+
initComplete: function () {
|
|
74
|
+
this.api().table().header().querySelectorAll('.dt-column-order')
|
|
75
|
+
.forEach(handle => handle.classList.add('focus-ring'))
|
|
58
76
|
}
|
|
59
77
|
})
|
|
60
78
|
})
|
data/assets/js/base/highlight.js
CHANGED
|
@@ -1,17 +1,91 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
//
|
|
1
|
+
// Colorizes every <pre><code> block, then gives any block not already
|
|
2
|
+
// inside a preview component the same toolbar (language label + copy
|
|
3
|
+
// button) preview.html.liquid renders for its own code row. This way
|
|
4
|
+
// every code sample looks and behaves the same, whether it's a plain
|
|
5
|
+
// fenced Markdown block or built with the preview component. A wrapped
|
|
6
|
+
// block has no demo row, since a plain fenced block has no demo to show.
|
|
7
|
+
|
|
8
|
+
// Waits for DOMContentLoaded explicitly instead of relying on `defer`:
|
|
9
|
+
// this script tag lives in <head>, and a consumer that inlines the file
|
|
10
|
+
// (e.g. monolith bundling) drops the `src` that `defer` depends on.
|
|
9
11
|
document.addEventListener('DOMContentLoaded', () => {
|
|
10
|
-
if (typeof hljs === 'undefined'
|
|
11
|
-
console.warn('highlight: hljs
|
|
12
|
+
if (typeof hljs === 'undefined') {
|
|
13
|
+
console.warn('highlight: hljs not available')
|
|
12
14
|
return
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
// Records each block's declared language (a ```language fence becomes a
|
|
18
|
+
// language-<x> class) before hljs.highlightAll() runs. highlightAll()
|
|
19
|
+
// guesses a language for any block missing one, and that guess is often
|
|
20
|
+
// wrong (a short Liquid snippet can easily read as Bash) — only a
|
|
21
|
+
// language the author actually wrote should show as the toolbar label.
|
|
22
|
+
//
|
|
23
|
+
// Scoped to `pre code`: an inline `code` span getting the `.hljs` class
|
|
24
|
+
// would pull in _highlight-theme.scss's block-code color reset, stomping
|
|
25
|
+
// the separate inline-code chip style in _customization.scss.
|
|
26
|
+
const declaredLanguages = new WeakMap()
|
|
27
|
+
document.querySelectorAll('pre code').forEach(el => {
|
|
28
|
+
el.classList.add('hljs')
|
|
29
|
+
const languageClass = [...el.classList].find(c => c.startsWith('language-'))
|
|
30
|
+
if (languageClass) declaredLanguages.set(el, languageClass.replace('language-', ''))
|
|
31
|
+
})
|
|
32
|
+
|
|
16
33
|
hljs.highlightAll()
|
|
34
|
+
|
|
35
|
+
document.querySelectorAll('pre code.hljs').forEach(codeEl => {
|
|
36
|
+
const preEl = codeEl.parentElement
|
|
37
|
+
if (!preEl || preEl.closest('.preview-code')) return
|
|
38
|
+
|
|
39
|
+
const language = declaredLanguages.get(codeEl) || ''
|
|
40
|
+
|
|
41
|
+
const wrapper = document.createElement('div')
|
|
42
|
+
wrapper.className = 'preview mb-3 border rounded overflow-hidden'
|
|
43
|
+
|
|
44
|
+
// No border-top: the toolbar is always the first row here (a wrapped
|
|
45
|
+
// block has no demo row above it), so a top border would double up
|
|
46
|
+
// against the outer .preview border.
|
|
47
|
+
const toolbar = document.createElement('div')
|
|
48
|
+
toolbar.className = 'preview-toolbar m-0 p-2 border-bottom border-centos-purple-100'
|
|
49
|
+
|
|
50
|
+
if (language) {
|
|
51
|
+
const languageEl = document.createElement('span')
|
|
52
|
+
languageEl.className = 'preview-language small font-monospace text-body-secondary text-uppercase'
|
|
53
|
+
languageEl.textContent = language
|
|
54
|
+
toolbar.appendChild(languageEl)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const actions = document.createElement('div')
|
|
58
|
+
actions.className = 'preview-actions'
|
|
59
|
+
|
|
60
|
+
const copyBtn = document.createElement('button')
|
|
61
|
+
copyBtn.setAttribute('type', 'button')
|
|
62
|
+
copyBtn.className = 'copy-btn focus-ring preview-copy'
|
|
63
|
+
copyBtn.setAttribute('data-bs-toggle', 'tooltip')
|
|
64
|
+
copyBtn.setAttribute('data-bs-title', 'Copy code')
|
|
65
|
+
copyBtn.setAttribute('data-copy-value', codeEl.textContent)
|
|
66
|
+
copyBtn.setAttribute('aria-label', 'Copy code')
|
|
67
|
+
copyBtn.innerHTML = '<i class="fa-regular fa-copy"></i>'
|
|
68
|
+
actions.appendChild(copyBtn)
|
|
69
|
+
toolbar.appendChild(actions)
|
|
70
|
+
|
|
71
|
+
const codeRow = document.createElement('div')
|
|
72
|
+
codeRow.className = 'preview-code p-0 m-0'
|
|
73
|
+
|
|
74
|
+
// Matches the p-2 preview.html.liquid puts on its own <pre> — same
|
|
75
|
+
// padding for a code block whether it came from a plain fenced
|
|
76
|
+
// Markdown block or the preview component.
|
|
77
|
+
preEl.classList.add('p-2')
|
|
78
|
+
|
|
79
|
+
preEl.replaceWith(wrapper)
|
|
80
|
+
wrapper.appendChild(toolbar)
|
|
81
|
+
codeRow.appendChild(preEl)
|
|
82
|
+
wrapper.appendChild(codeRow)
|
|
83
|
+
|
|
84
|
+
// init-tooltips.js already made its one-time pass before this button
|
|
85
|
+
// existed, so its tooltip has to be initialized here instead — the
|
|
86
|
+
// same thing preview.html.liquid's server-rendered copy buttons need.
|
|
87
|
+
if (typeof bootstrap !== 'undefined' && bootstrap.Tooltip) {
|
|
88
|
+
new bootstrap.Tooltip(copyBtn)
|
|
89
|
+
}
|
|
90
|
+
})
|
|
17
91
|
})
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-theme-centos
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.52.0.beta.
|
|
4
|
+
version: 2.52.0.beta.104
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alain Reguera Delgado
|
|
@@ -317,6 +317,7 @@ files:
|
|
|
317
317
|
- _data/base/navindex_schema.yml
|
|
318
318
|
- _data/base/ogp.yml
|
|
319
319
|
- _data/base/ogp_schema.yml
|
|
320
|
+
- _data/base/preview_schema.yml
|
|
320
321
|
- _data/base/project.yml
|
|
321
322
|
- _data/base/project_schema.yml
|
|
322
323
|
- _data/base/script_schema.yml
|
|
@@ -340,6 +341,7 @@ files:
|
|
|
340
341
|
- _includes/base/calendar.html.liquid
|
|
341
342
|
- _includes/base/card.html.liquid
|
|
342
343
|
- _includes/base/color-table.html.liquid
|
|
344
|
+
- _includes/base/configuration_variables-default-cell.html.liquid
|
|
343
345
|
- _includes/base/configuration_variables-nested.html.liquid
|
|
344
346
|
- _includes/base/configuration_variables.html.liquid
|
|
345
347
|
- _includes/base/content.html.liquid
|
|
@@ -365,6 +367,7 @@ files:
|
|
|
365
367
|
- _includes/base/navbar.html.liquid
|
|
366
368
|
- _includes/base/navindex.html.liquid
|
|
367
369
|
- _includes/base/ogp.html.liquid
|
|
370
|
+
- _includes/base/preview.html.liquid
|
|
368
371
|
- _includes/base/project.html.liquid
|
|
369
372
|
- _includes/base/shortcut.html.liquid
|
|
370
373
|
- _includes/base/social.html.liquid
|
|
@@ -379,8 +382,10 @@ files:
|
|
|
379
382
|
- _sass/base/_customization.scss
|
|
380
383
|
- _sass/base/_datatable.scss
|
|
381
384
|
- _sass/base/_download.scss
|
|
385
|
+
- _sass/base/_highlight-theme.scss
|
|
382
386
|
- _sass/base/_light-dark.scss
|
|
383
387
|
- _sass/base/_maps.scss
|
|
388
|
+
- _sass/base/_preview.scss
|
|
384
389
|
- _sass/base/_theme-colors.scss
|
|
385
390
|
- _sass/base/_variables.scss
|
|
386
391
|
- _sass/bootstrap/_accordion.scss
|