@conduction/docusaurus-preset 2.7.0-beta.1 → 2.7.0-beta.3
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.
- package/package.json +1 -1
- package/src/index.js +9 -3
- package/src/theme/Footer/index.jsx +20 -1
- package/src/theme/Navbar/index.jsx +36 -7
- package/static/lib/canal-footer.css +19 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -112,10 +112,16 @@ const baseNavbar = (siteName, repoUrl) => ({
|
|
|
112
112
|
src: 'img/logo.svg',
|
|
113
113
|
srcDark: 'img/logo-dark.svg',
|
|
114
114
|
},
|
|
115
|
+
/* `custom-*` prefix is the Docusaurus convention for theme-defined
|
|
116
|
+
navbar item types — items prefixed this way bypass the strict Joi
|
|
117
|
+
schema validator in @docusaurus/theme-classic, so the brand Navbar
|
|
118
|
+
swizzle can dispatch on them without registering each shape with
|
|
119
|
+
core. The swizzle accepts both `custom-github` and the bare
|
|
120
|
+
`github` (etc.) for forward-compat. */
|
|
115
121
|
items: [
|
|
116
|
-
{ type: 'versionPill', position: 'right' },
|
|
117
|
-
{ type: 'apiDocs', position: 'right' },
|
|
118
|
-
{ type: 'github', href: repoUrl || 'https://github.com/ConductionNL', position: 'right' },
|
|
122
|
+
{ type: 'custom-versionPill', position: 'right' },
|
|
123
|
+
{ type: 'custom-apiDocs', position: 'right' },
|
|
124
|
+
{ type: 'custom-github', href: repoUrl || 'https://github.com/ConductionNL', position: 'right' },
|
|
119
125
|
{ type: 'localeDropdown', position: 'right' },
|
|
120
126
|
],
|
|
121
127
|
});
|
|
@@ -316,6 +316,15 @@ export default function Footer() {
|
|
|
316
316
|
Open-source apps for <span className="next-blue">Nextcloud</span>. Built and
|
|
317
317
|
maintained by Conduction in Amsterdam, released under EUPL-1.2.
|
|
318
318
|
</p>
|
|
319
|
+
{/*
|
|
320
|
+
Brand citation. The producer chain stays dot-separated
|
|
321
|
+
(Conduction · sub-brand · partner) and connects to
|
|
322
|
+
Nextcloud through a vermillion-red heart — the "loves"
|
|
323
|
+
relationship is between the producer stack and the
|
|
324
|
+
platform it ships on. Nextcloud is a link to
|
|
325
|
+
nextcloud.com so visitors can verify the platform
|
|
326
|
+
upstream in one click.
|
|
327
|
+
*/}
|
|
319
328
|
<div className="triad">
|
|
320
329
|
<span>
|
|
321
330
|
<span className="h"></span>
|
|
@@ -326,7 +335,17 @@ export default function Footer() {
|
|
|
326
335
|
.map((b, i) => (
|
|
327
336
|
<React.Fragment key={i}> · {b.wordmark}</React.Fragment>
|
|
328
337
|
))}
|
|
329
|
-
{' '}
|
|
338
|
+
{' '}
|
|
339
|
+
<svg className="heart" viewBox="0 0 24 24" fill="currentColor" aria-label="loves" role="img">
|
|
340
|
+
<path d="M12 21s-6.7-4.35-9.2-8.4C.8 9.2 2 5.5 5.2 4.7c2-.5 3.8.4 4.8 1.9 1-1.5 2.8-2.4 4.8-1.9 3.2.8 4.4 4.5 2.4 7.9C18.7 16.65 12 21 12 21z"/>
|
|
341
|
+
</svg>
|
|
342
|
+
{' '}
|
|
343
|
+
<a
|
|
344
|
+
href="https://nextcloud.com"
|
|
345
|
+
target="_blank"
|
|
346
|
+
rel="noopener noreferrer"
|
|
347
|
+
className="next-blue"
|
|
348
|
+
>Nextcloud</a>
|
|
330
349
|
</span>
|
|
331
350
|
</div>
|
|
332
351
|
<div className="socials">
|
|
@@ -24,12 +24,18 @@
|
|
|
24
24
|
* { type: 'doc', label, to } internal doc link
|
|
25
25
|
* { type: 'link', label, to | href } internal/external link
|
|
26
26
|
* { type: 'localeDropdown' } Docusaurus locale switcher
|
|
27
|
-
* { type: 'github', href }
|
|
28
|
-
* { type: 'apiDocs', label?, to }
|
|
29
|
-
* { type: 'versionPill', prefix? }
|
|
27
|
+
* { type: 'custom-github', href } icon-only GitHub mark
|
|
28
|
+
* { type: 'custom-apiDocs', label?, to } icon + "API Documentation"
|
|
29
|
+
* { type: 'custom-versionPill', prefix? } "Stable · v{x.y.z}" pill
|
|
30
30
|
* reads customFields.appVersion;
|
|
31
31
|
* hidden when no version
|
|
32
32
|
*
|
|
33
|
+
* The `custom-` prefix is required so Docusaurus's themeConfig schema
|
|
34
|
+
* validator passes (`@docusaurus/theme-classic` rejects unknown bare
|
|
35
|
+
* type names). The swizzle below accepts both the prefixed and the
|
|
36
|
+
* bare names so 2.7.0-beta.1 sites that wired the bare names keep
|
|
37
|
+
* working after the upgrade.
|
|
38
|
+
*
|
|
33
39
|
* The pill prefix defaults to "Stable" but can be overridden per site
|
|
34
40
|
* (e.g. prefix="Beta" while on a pre-1.0 release line).
|
|
35
41
|
*
|
|
@@ -46,6 +52,24 @@ import {brandFor, productWordmark} from '../brand.jsx';
|
|
|
46
52
|
import {ICONS} from '../../components/primitives/icons';
|
|
47
53
|
import styles from './styles.module.css';
|
|
48
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Brand-specific navbar item types live under the `custom-` prefix
|
|
57
|
+
* because Docusaurus's themeConfig validator (Joi schema in
|
|
58
|
+
* @docusaurus/theme-classic) rejects unknown top-level types. The
|
|
59
|
+
* `custom-` namespace is the documented escape hatch: items prefixed
|
|
60
|
+
* with `custom-` bypass schema validation and are passed through to
|
|
61
|
+
* the theme as-is. The brand Navbar then dispatches on them below.
|
|
62
|
+
*
|
|
63
|
+
* Sites may also use the bare names (`github`, `apiDocs`,
|
|
64
|
+
* `versionPill`) — they render identically here but Docusaurus will
|
|
65
|
+
* reject the config at load time. Accept both forms so the migration
|
|
66
|
+
* from 2.7.0-beta.1 to .beta.2 doesn't break sites that already
|
|
67
|
+
* configured the bare names.
|
|
68
|
+
*/
|
|
69
|
+
function typeIs(item, kind) {
|
|
70
|
+
return item.type === kind || item.type === 'custom-' + kind;
|
|
71
|
+
}
|
|
72
|
+
|
|
49
73
|
/**
|
|
50
74
|
* Render a single navbar item. The brand navbar supports a small
|
|
51
75
|
* subset of Docusaurus item types plus the three brand-specific types
|
|
@@ -64,7 +88,7 @@ function NavItem({item, location, appVersion}) {
|
|
|
64
88
|
/* GitHub: icon-only link with an accessible label. The aria-label
|
|
65
89
|
gives screen-readers + browser tooltips a name without rendering
|
|
66
90
|
a visible text label in the navbar. */
|
|
67
|
-
if (item
|
|
91
|
+
if (typeIs(item, 'github')) {
|
|
68
92
|
return (
|
|
69
93
|
<a
|
|
70
94
|
href={item.href || 'https://github.com/ConductionNL'}
|
|
@@ -82,7 +106,7 @@ function NavItem({item, location, appVersion}) {
|
|
|
82
106
|
/* API Documentation: icon + label link. Target defaults to /api
|
|
83
107
|
(the Redocusaurus mount point used by every Conduction docs site).
|
|
84
108
|
Sites can override via `to` or `href`. */
|
|
85
|
-
if (item
|
|
109
|
+
if (typeIs(item, 'apiDocs')) {
|
|
86
110
|
const label = item.label || 'API Documentation';
|
|
87
111
|
const to = item.to || '/api';
|
|
88
112
|
const href = item.href;
|
|
@@ -106,7 +130,7 @@ function NavItem({item, location, appVersion}) {
|
|
|
106
130
|
or package.json). Hidden when no version is available so sites
|
|
107
131
|
without an app version (Hydra, design-system itself) get a clean
|
|
108
132
|
navbar instead of an empty pill. */
|
|
109
|
-
if (item
|
|
133
|
+
if (typeIs(item, 'versionPill')) {
|
|
110
134
|
if (!appVersion) return null;
|
|
111
135
|
const prefix = item.prefix || 'Stable';
|
|
112
136
|
return (
|
|
@@ -198,7 +222,12 @@ export default function Navbar() {
|
|
|
198
222
|
position="right" — but the three brand-specific item types
|
|
199
223
|
(github, apiDocs, versionPill) live on the right by convention,
|
|
200
224
|
mirroring the docs-shell mock. */
|
|
201
|
-
const RIGHT_TYPES = new Set([
|
|
225
|
+
const RIGHT_TYPES = new Set([
|
|
226
|
+
'localeDropdown',
|
|
227
|
+
'github', 'custom-github',
|
|
228
|
+
'apiDocs', 'custom-apiDocs',
|
|
229
|
+
'versionPill', 'custom-versionPill',
|
|
230
|
+
]);
|
|
202
231
|
const leftItems = items.filter(i => i.position !== 'right' && !RIGHT_TYPES.has(i.type));
|
|
203
232
|
const rightItems = items.filter(i => i.position === 'right' || RIGHT_TYPES.has(i.type));
|
|
204
233
|
|
|
@@ -190,6 +190,25 @@
|
|
|
190
190
|
display: inline-block; margin-right: 6px;
|
|
191
191
|
vertical-align: middle;
|
|
192
192
|
}
|
|
193
|
+
/* "Conduction ♥ Nextcloud" citation: a vermillion-red heart between
|
|
194
|
+
the producer chain and the Nextcloud platform link. Sized to the
|
|
195
|
+
surrounding 11px caption with a small inline lift so the heart
|
|
196
|
+
centres on the cap-height. */
|
|
197
|
+
.canal-footer .brand .triad .heart {
|
|
198
|
+
width: 11px; height: 11px;
|
|
199
|
+
color: var(--c-red-vermillion);
|
|
200
|
+
display: inline-block;
|
|
201
|
+
vertical-align: -1px;
|
|
202
|
+
margin: 0 2px;
|
|
203
|
+
}
|
|
204
|
+
.canal-footer .brand .triad a.next-blue {
|
|
205
|
+
color: var(--c-nextcloud-blue);
|
|
206
|
+
text-decoration: none;
|
|
207
|
+
transition: color 140ms ease;
|
|
208
|
+
}
|
|
209
|
+
.canal-footer .brand .triad a.next-blue:hover {
|
|
210
|
+
color: var(--c-nextcloud-cyan);
|
|
211
|
+
}
|
|
193
212
|
.canal-footer .brand .socials {
|
|
194
213
|
display: flex; gap: 10px;
|
|
195
214
|
margin-top: 18px;
|