jekyll-theme-centos 2.52.0.beta.101 → 2.52.0.beta.103
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 +2 -2
- data/_data/base/backtotop_schema.yml +6 -4
- data/_data/base/card_schema.yml +2 -2
- data/_data/base/copyright_schema.yml +1 -1
- 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/_includes/base/color-table.html.liquid +4 -4
- data/_includes/base/configuration_variables-nested.html.liquid +29 -8
- 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 +8 -9
- 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 +49 -53
- data/_sass/base/_highlight-theme.scss +102 -0
- data/_sass/base/_preview.scss +74 -0
- data/_sass/base/_variables.scss +54 -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 +15 -9
- data/assets/js/base/highlight.js +86 -12
- metadata +5 -1
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')
|
|
@@ -55,6 +53,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
55
53
|
next: '<i class="fa-solid fa-chevron-right" aria-hidden="true"></i>',
|
|
56
54
|
last: '<i class="fa-solid fa-angles-right" aria-hidden="true"></i>'
|
|
57
55
|
}
|
|
56
|
+
},
|
|
57
|
+
// DataTables puts the keyboard-focusable sort trigger on a nested
|
|
58
|
+
// `.dt-column-order` span, not the `<th>` itself, so focus-ring has to
|
|
59
|
+
// go there. initComplete runs once the header row exists, which is
|
|
60
|
+
// the earliest point that span can be selected.
|
|
61
|
+
initComplete: function () {
|
|
62
|
+
this.api().table().header().querySelectorAll('.dt-column-order')
|
|
63
|
+
.forEach(handle => handle.classList.add('focus-ring'))
|
|
58
64
|
}
|
|
59
65
|
})
|
|
60
66
|
})
|
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.103
|
|
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
|
|
@@ -365,6 +366,7 @@ files:
|
|
|
365
366
|
- _includes/base/navbar.html.liquid
|
|
366
367
|
- _includes/base/navindex.html.liquid
|
|
367
368
|
- _includes/base/ogp.html.liquid
|
|
369
|
+
- _includes/base/preview.html.liquid
|
|
368
370
|
- _includes/base/project.html.liquid
|
|
369
371
|
- _includes/base/shortcut.html.liquid
|
|
370
372
|
- _includes/base/social.html.liquid
|
|
@@ -379,8 +381,10 @@ files:
|
|
|
379
381
|
- _sass/base/_customization.scss
|
|
380
382
|
- _sass/base/_datatable.scss
|
|
381
383
|
- _sass/base/_download.scss
|
|
384
|
+
- _sass/base/_highlight-theme.scss
|
|
382
385
|
- _sass/base/_light-dark.scss
|
|
383
386
|
- _sass/base/_maps.scss
|
|
387
|
+
- _sass/base/_preview.scss
|
|
384
388
|
- _sass/base/_theme-colors.scss
|
|
385
389
|
- _sass/base/_variables.scss
|
|
386
390
|
- _sass/bootstrap/_accordion.scss
|