@writedocs/generator 0.10.19 → 0.11.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.
- package/astro.config.mjs +32 -8
- package/package.json +96 -93
- package/src/cli/base-path-layout.js +44 -0
- package/src/cli/build.js +177 -168
- package/src/cli/check-built-styles.js +41 -33
- package/src/cli/dev.js +261 -244
- package/src/cli/generate-api-pages.js +9 -5
- package/src/cli/page-list-watch.js +69 -66
- package/src/cli/run-pagefind.js +154 -148
- package/src/cli/write-mcp-files.js +103 -96
- package/src/cli/write-redirects-file.js +25 -8
- package/src/components/AppIcon.astro +51 -50
- package/src/components/Card.astro +193 -192
- package/src/components/CopyPageMenu.astro +374 -370
- package/src/components/Hint.astro +188 -187
- package/src/components/Icon.astro +72 -71
- package/src/components/Image.astro +165 -164
- package/src/components/Tile.astro +67 -66
- package/src/components/Video.astro +137 -136
- package/src/layout/BaseLayout.astro +21 -12
- package/src/layout/components/AnalyticsScripts.astro +6 -2
- package/src/layout/components/Breadcrumbs.astro +98 -97
- package/src/layout/components/ConsentBanner.astro +119 -118
- package/src/layout/components/MobileMenu.astro +229 -228
- package/src/layout/components/NavTree.astro +393 -392
- package/src/layout/components/Sidebar.astro +232 -231
- package/src/layout/components/SiteFooter.astro +87 -86
- package/src/layout/components/TopBar.astro +386 -385
- package/src/lib/agent-markdown.js +164 -162
- package/src/lib/asset-dimensions.js +89 -0
- package/src/lib/base-path.js +90 -0
- package/src/lib/config-schema.js +10 -0
- package/src/lib/config-schema.ts +17 -0
- package/src/lib/config.ts +1314 -1289
- package/src/lib/consent.js +108 -102
- package/src/lib/image-size.js +152 -140
- package/src/lib/json-schema-descriptions.js +1 -0
- package/src/lib/link-check.js +42 -4
- package/src/lib/llms-index.ts +90 -88
- package/src/lib/mcp-dev-integration.js +65 -60
- package/src/lib/mcp-index.ts +102 -101
- package/src/lib/pages.js +312 -304
- package/src/lib/project-files-integration.js +116 -61
- package/src/lib/project-files.js +137 -126
- package/src/lib/project-ignore.js +46 -0
- package/src/lib/rehype-base-path.js +62 -0
- package/src/lib/rehype-image-loading.js +71 -71
- package/src/lib/robots-txt.js +21 -16
- package/src/lib/seo-tags.js +155 -140
- package/src/lib/site-base.ts +27 -0
- package/src/lib/styles-asset-integration.js +58 -12
- package/src/lib/wdignore-cases.json +195 -0
- package/src/lib/wdignore.js +177 -0
- package/src/pages/404.astro +63 -62
- package/src/pages/[...slug].astro +1604 -1597
- package/src/pages/[...slug].md.ts +93 -93
- package/src/pages/llms-full.txt.ts +88 -86
- package/src/scripts/search.ts +241 -237
- package/writedocs.schema.json +6 -0
|
@@ -1,118 +1,119 @@
|
|
|
1
|
-
---
|
|
2
|
-
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{consent.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<button type="button" class="wd-consent-button
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
font
|
|
88
|
-
font-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
border:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
color: var(--wd-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
outline
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
1
|
+
---
|
|
2
|
+
import { siteHref } from '../../lib/site-base';
|
|
3
|
+
// writedocs.json's `integrations.consent` - the banner that asks before the
|
|
4
|
+
// analytics integrations load. It's in the page hidden; src/scripts/
|
|
5
|
+
// consent.ts shows it when the reader hasn't answered yet (window.wdConsent,
|
|
6
|
+
// defined in <head> by consentLoaderScript() in lib/consent.js), and again
|
|
7
|
+
// when they follow a link to #cookie-settings.
|
|
8
|
+
//
|
|
9
|
+
// A strip along the bottom of the window rather than a dialog: the page
|
|
10
|
+
// stays readable and usable while it's there, so focus isn't trapped and
|
|
11
|
+
// nothing is covered that can't be scrolled into view (consent.ts pads the
|
|
12
|
+
// page's end by the banner's height).
|
|
13
|
+
interface Props {
|
|
14
|
+
consent: {
|
|
15
|
+
message: string;
|
|
16
|
+
acceptLabel: string;
|
|
17
|
+
declineLabel: string;
|
|
18
|
+
policyUrl: string | null;
|
|
19
|
+
policyLabel: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const { consent } = Astro.props as Props;
|
|
23
|
+
---
|
|
24
|
+
<section class="wd-consent" id="wd-consent" aria-label="Cookie consent" data-pagefind-ignore hidden>
|
|
25
|
+
<div class="wd-consent-inner">
|
|
26
|
+
<p class="wd-consent-text">
|
|
27
|
+
{consent.message}{" "}
|
|
28
|
+
{consent.policyUrl && <a href={siteHref(consent.policyUrl)}>{consent.policyLabel}</a>}
|
|
29
|
+
</p>
|
|
30
|
+
<div class="wd-consent-actions">
|
|
31
|
+
<button type="button" class="wd-consent-button" data-consent="denied">{consent.declineLabel}</button>
|
|
32
|
+
<button type="button" class="wd-consent-button wd-consent-accept" data-consent="granted">{consent.acceptLabel}</button>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</section>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import { initConsent } from "../../scripts/consent";
|
|
39
|
+
|
|
40
|
+
initConsent(document);
|
|
41
|
+
document.addEventListener("astro:page-load", () => initConsent(document));
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style is:global>
|
|
45
|
+
.wd-consent {
|
|
46
|
+
position: fixed;
|
|
47
|
+
left: 0;
|
|
48
|
+
right: 0;
|
|
49
|
+
bottom: 0;
|
|
50
|
+
/* Above the topbar (10) and the page; below the search and image
|
|
51
|
+
overlays (100), which the reader opened on purpose. */
|
|
52
|
+
z-index: 50;
|
|
53
|
+
background: var(--wd-surface);
|
|
54
|
+
border-top: 1px solid var(--wd-border);
|
|
55
|
+
color: var(--wd-text);
|
|
56
|
+
box-shadow: 0 -4px 16px rgb(0 0 0 / 0.08);
|
|
57
|
+
}
|
|
58
|
+
.wd-consent[hidden] {
|
|
59
|
+
display: none;
|
|
60
|
+
}
|
|
61
|
+
.wd-consent-inner {
|
|
62
|
+
max-width: 1440px;
|
|
63
|
+
margin: 0 auto;
|
|
64
|
+
padding: 0.85rem 1.5rem;
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: space-between;
|
|
68
|
+
gap: 1rem 1.5rem;
|
|
69
|
+
}
|
|
70
|
+
.wd-consent-text {
|
|
71
|
+
margin: 0;
|
|
72
|
+
font-size: 0.88rem;
|
|
73
|
+
line-height: 1.5;
|
|
74
|
+
}
|
|
75
|
+
.wd-consent-text a {
|
|
76
|
+
color: var(--wd-primary);
|
|
77
|
+
text-decoration: underline;
|
|
78
|
+
}
|
|
79
|
+
.wd-consent-actions {
|
|
80
|
+
display: flex;
|
|
81
|
+
gap: 0.5rem;
|
|
82
|
+
flex-shrink: 0;
|
|
83
|
+
}
|
|
84
|
+
/* Both buttons the same size and weight but for the fill - declining is as
|
|
85
|
+
easy as accepting. */
|
|
86
|
+
.wd-consent-button {
|
|
87
|
+
font: inherit;
|
|
88
|
+
font-size: 0.85rem;
|
|
89
|
+
font-weight: 600;
|
|
90
|
+
padding: 0.45rem 1rem;
|
|
91
|
+
border-radius: 0.5rem;
|
|
92
|
+
border: 1px solid var(--wd-border);
|
|
93
|
+
background: var(--wd-background);
|
|
94
|
+
color: var(--wd-heading);
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
}
|
|
97
|
+
.wd-consent-button:hover {
|
|
98
|
+
border-color: var(--wd-primary);
|
|
99
|
+
}
|
|
100
|
+
.wd-consent-accept {
|
|
101
|
+
background: var(--wd-primary);
|
|
102
|
+
border-color: var(--wd-primary);
|
|
103
|
+
color: var(--wd-on-primary);
|
|
104
|
+
}
|
|
105
|
+
.wd-consent-button:focus-visible {
|
|
106
|
+
outline: 2px solid var(--wd-primary);
|
|
107
|
+
outline-offset: 2px;
|
|
108
|
+
}
|
|
109
|
+
@media (max-width: 640px) {
|
|
110
|
+
.wd-consent-inner {
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
align-items: stretch;
|
|
113
|
+
padding: 0.85rem 1rem;
|
|
114
|
+
}
|
|
115
|
+
.wd-consent-actions > .wd-consent-button {
|
|
116
|
+
flex: 1;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
</style>
|