@docmd/template-summer 0.8.6
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/LICENSE +21 -0
- package/README.md +90 -0
- package/dist/assets/css/summer.css +3418 -0
- package/dist/assets/js/summer.js +660 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +79 -0
- package/dist/templates/404.ejs +156 -0
- package/dist/templates/layout.ejs +609 -0
- package/dist/templates/partials/footer.ejs +69 -0
- package/dist/templates/partials/menubar.ejs +92 -0
- package/dist/templates/partials/options-menu.ejs +45 -0
- package/dist/templates/toc.ejs +53 -0
- package/package.json +61 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------
|
|
3
|
+
* @docmd/template-summer
|
|
4
|
+
* A bright, hopeful, summer-feel layout for docmd 0.8.7+.
|
|
5
|
+
*
|
|
6
|
+
* • Top: logo + (new) centred search bar + menubar at the BOTTOM of the logo bar
|
|
7
|
+
* • Side: clean section list with icons
|
|
8
|
+
* • Main: airy content with right-rail TOC
|
|
9
|
+
* • Below: centred "last updated + edit" footer
|
|
10
|
+
*
|
|
11
|
+
* Implements the `template` plugin capability. Partial override set
|
|
12
|
+
* intentionally small — the resolver will fall back to the default
|
|
13
|
+
* for any slot not listed here.
|
|
14
|
+
*
|
|
15
|
+
* File-system layout: this package ships `.ejs`, `.css`, and `.js` files
|
|
16
|
+
* alongside the compiled JS. Path resolution uses `import.meta.url`
|
|
17
|
+
* (URL-relative) so the same code works in dev (`src/index.ts`) and
|
|
18
|
+
* after `tsc` (`dist/index.js`). The build step copies `templates/` and
|
|
19
|
+
* `assets/` into `dist/` so the URL math is identical in both places.
|
|
20
|
+
* --------------------------------------------------------------------
|
|
21
|
+
*/
|
|
22
|
+
import { fileURLToPath } from 'node:url';
|
|
23
|
+
// ── Resolve asset paths relative to this source file ─────────────────────
|
|
24
|
+
//
|
|
25
|
+
// `import.meta.url` points at:
|
|
26
|
+
// - src/index.ts (during development / pnpm exec)
|
|
27
|
+
// - dist/index.js (after `tsc`)
|
|
28
|
+
//
|
|
29
|
+
// Using `new URL('../templates/...', import.meta.url)` keeps both paths
|
|
30
|
+
// correct as long as the `templates/` and `assets/` directories sit
|
|
31
|
+
// next to the entry point file (one level up from `src/` or `dist/`).
|
|
32
|
+
//
|
|
33
|
+
const here = import.meta.url;
|
|
34
|
+
const urlOf = (relPath) => new URL(relPath, here).href;
|
|
35
|
+
const pathOf = (relPath) => fileURLToPath(urlOf(relPath));
|
|
36
|
+
// ── Plugin descriptor ────────────────────────────────────────────────────
|
|
37
|
+
export const plugin = {
|
|
38
|
+
name: 'template-summer',
|
|
39
|
+
version: '0.8.7',
|
|
40
|
+
capabilities: ['template'],
|
|
41
|
+
};
|
|
42
|
+
// ── Template file overrides ──────────────────────────────────────────────
|
|
43
|
+
const templates = [
|
|
44
|
+
// Full layout override — biggest change vs default.
|
|
45
|
+
{ type: 'layout', templatePath: pathOf('../templates/layout.ejs') },
|
|
46
|
+
// Standalone Summer-styled 404 page (uses summer.css, halo gradient, glass card).
|
|
47
|
+
{ type: '404', templatePath: pathOf('../templates/404.ejs') },
|
|
48
|
+
// Re-style the menubar so it sits below the logo (not above).
|
|
49
|
+
{ type: 'menubar', templatePath: pathOf('../templates/partials/menubar.ejs') },
|
|
50
|
+
// Tighter, more modern footer.
|
|
51
|
+
{ type: 'footer', templatePath: pathOf('../templates/partials/footer.ejs') },
|
|
52
|
+
// Right-rail TOC styled for summer + scroll-spy hooks.
|
|
53
|
+
{ type: 'toc', templatePath: pathOf('../templates/toc.ejs') },
|
|
54
|
+
// Custom options-menu (omits search — we render that in the topbar).
|
|
55
|
+
{ type: 'options-menu', templatePath: pathOf('../templates/partials/options-menu.ejs') },
|
|
56
|
+
];
|
|
57
|
+
// ── Asset bundles ───────────────────────────────────────────────────────
|
|
58
|
+
const templateAssets = [
|
|
59
|
+
{
|
|
60
|
+
type: 'css',
|
|
61
|
+
path: pathOf('../assets/css/summer.css'),
|
|
62
|
+
// Priority 25 so it loads AFTER plugin CSS (20), giving the template full style precedence.
|
|
63
|
+
priority: 25,
|
|
64
|
+
position: 'head',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'js',
|
|
68
|
+
path: pathOf('../assets/js/summer.js'),
|
|
69
|
+
priority: 25,
|
|
70
|
+
position: 'body',
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
// ── Default export (PluginModule) ────────────────────────────────────────
|
|
74
|
+
const summerTemplate = {
|
|
75
|
+
plugin,
|
|
76
|
+
templates,
|
|
77
|
+
templateAssets,
|
|
78
|
+
};
|
|
79
|
+
export default summerTemplate;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
============================================================================
|
|
3
|
+
@docmd/template-summer — 404.ejs
|
|
4
|
+
|
|
5
|
+
Summer-themed 404 page. Standalone HTML so it renders correctly even when
|
|
6
|
+
the regular layout can't be resolved (e.g. broken template install).
|
|
7
|
+
Loads assets/css/summer.css (priority 25, set by src/index.ts) and
|
|
8
|
+
falls back to the project's theme colour overlay if present.
|
|
9
|
+
============================================================================
|
|
10
|
+
-->
|
|
11
|
+
<!DOCTYPE html>
|
|
12
|
+
<html lang="<%= (locals.activeLocale && locals.activeLocale.id) ? locals.activeLocale.id : 'en' %>"
|
|
13
|
+
<%= (locals.activeLocale && locals.activeLocale.dir && locals.activeLocale.dir !== 'ltr') ? ' dir="' + locals.activeLocale.dir + '"' : '' %>>
|
|
14
|
+
<head>
|
|
15
|
+
<meta charset="UTF-8">
|
|
16
|
+
<meta name="generator" content="docmd template-summer v0.8.7">
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
|
|
18
|
+
<meta name="theme-color" content="#fbfaf6" media="(prefers-color-scheme: light)">
|
|
19
|
+
<meta name="theme-color" content="#13110d" media="(prefers-color-scheme: dark)">
|
|
20
|
+
<title>404 · <%= siteTitle || 'docmd' %></title>
|
|
21
|
+
|
|
22
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
23
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
24
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">
|
|
25
|
+
|
|
26
|
+
<link rel="stylesheet" href="<%= relativePathToRoot %>assets/css/summer.css?v=<%= buildHash %>">
|
|
27
|
+
|
|
28
|
+
<% if (theme && theme.name && theme.name !== 'default') { %>
|
|
29
|
+
<link rel="stylesheet" href="<%= relativePathToRoot %>assets/css/docmd-theme-<%= theme.name %>.css?v=<%= buildHash %>">
|
|
30
|
+
<% } %>
|
|
31
|
+
|
|
32
|
+
<% (customCssFiles || []).forEach(cssFile => {
|
|
33
|
+
const cleanPath = cssFile.startsWith('/') ? cssFile.substring(1) : cssFile;
|
|
34
|
+
%>
|
|
35
|
+
<link rel="stylesheet" href="<%= relativePathToRoot %><%= cleanPath %>?v=<%= buildHash %>">
|
|
36
|
+
<% }); %>
|
|
37
|
+
|
|
38
|
+
<%- themeInitScript %>
|
|
39
|
+
|
|
40
|
+
<style>
|
|
41
|
+
.summer-404 {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
min-height: 100vh;
|
|
47
|
+
text-align: center;
|
|
48
|
+
padding: 24px;
|
|
49
|
+
position: relative;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
}
|
|
52
|
+
.summer-404::before {
|
|
53
|
+
content: "";
|
|
54
|
+
position: absolute;
|
|
55
|
+
top: -30%;
|
|
56
|
+
left: 50%;
|
|
57
|
+
transform: translateX(-50%);
|
|
58
|
+
width: 720px;
|
|
59
|
+
height: 720px;
|
|
60
|
+
max-width: 140vw;
|
|
61
|
+
background: radial-gradient(circle at center, var(--summer-halo, rgba(255, 196, 84, 0.18)) 0%, transparent 65%);
|
|
62
|
+
filter: blur(20px);
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
z-index: 0;
|
|
65
|
+
}
|
|
66
|
+
.summer-404__card {
|
|
67
|
+
position: relative;
|
|
68
|
+
z-index: 1;
|
|
69
|
+
max-width: 520px;
|
|
70
|
+
padding: 40px 32px;
|
|
71
|
+
border-radius: 20px;
|
|
72
|
+
background: var(--summer-card-bg, rgba(255, 255, 255, 0.6));
|
|
73
|
+
backdrop-filter: blur(12px);
|
|
74
|
+
-webkit-backdrop-filter: blur(12px);
|
|
75
|
+
border: 1px solid var(--summer-border, rgba(0, 0, 0, 0.06));
|
|
76
|
+
box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.12);
|
|
77
|
+
}
|
|
78
|
+
.summer-404__code {
|
|
79
|
+
font-size: 7rem;
|
|
80
|
+
line-height: 1;
|
|
81
|
+
font-weight: 800;
|
|
82
|
+
letter-spacing: -0.04em;
|
|
83
|
+
margin: 0 0 8px;
|
|
84
|
+
background: linear-gradient(135deg, #ffb347 0%, #ff6b6b 50%, #c084fc 100%);
|
|
85
|
+
-webkit-background-clip: text;
|
|
86
|
+
background-clip: text;
|
|
87
|
+
-webkit-text-fill-color: transparent;
|
|
88
|
+
color: transparent;
|
|
89
|
+
}
|
|
90
|
+
.summer-404__title {
|
|
91
|
+
font-size: 1.5rem;
|
|
92
|
+
font-weight: 600;
|
|
93
|
+
margin: 0 0 8px;
|
|
94
|
+
color: var(--text-color, #1a1a1a);
|
|
95
|
+
}
|
|
96
|
+
.summer-404__msg {
|
|
97
|
+
font-size: 1rem;
|
|
98
|
+
line-height: 1.6;
|
|
99
|
+
color: var(--text-muted, #6b6b6b);
|
|
100
|
+
margin: 0 0 28px;
|
|
101
|
+
}
|
|
102
|
+
.summer-404__actions {
|
|
103
|
+
display: flex;
|
|
104
|
+
gap: 12px;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
flex-wrap: wrap;
|
|
107
|
+
}
|
|
108
|
+
.summer-404__btn {
|
|
109
|
+
display: inline-flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
gap: 6px;
|
|
112
|
+
padding: 10px 20px;
|
|
113
|
+
border-radius: 10px;
|
|
114
|
+
font-size: 0.95rem;
|
|
115
|
+
font-weight: 500;
|
|
116
|
+
text-decoration: none;
|
|
117
|
+
transition: transform 0.15s ease, box-shadow 0.15s ease;
|
|
118
|
+
}
|
|
119
|
+
.summer-404__btn--primary {
|
|
120
|
+
background: linear-gradient(135deg, #ffb347 0%, #ff8c5a 100%);
|
|
121
|
+
color: #fff;
|
|
122
|
+
box-shadow: 0 4px 14px -4px rgba(255, 140, 90, 0.5);
|
|
123
|
+
}
|
|
124
|
+
.summer-404__btn--primary:hover { transform: translateY(-1px); }
|
|
125
|
+
.summer-404__btn--ghost {
|
|
126
|
+
background: transparent;
|
|
127
|
+
color: var(--text-color, #1a1a1a);
|
|
128
|
+
border: 1px solid var(--summer-border, rgba(0, 0, 0, 0.12));
|
|
129
|
+
}
|
|
130
|
+
.summer-404__btn--ghost:hover { background: rgba(0, 0, 0, 0.04); }
|
|
131
|
+
:root[data-theme="dark"] .summer-404__card,
|
|
132
|
+
:root[data-theme="dark"] .summer-404__btn--ghost:hover {
|
|
133
|
+
background: rgba(30, 28, 24, 0.7);
|
|
134
|
+
}
|
|
135
|
+
</style>
|
|
136
|
+
</head>
|
|
137
|
+
<body>
|
|
138
|
+
<main class="summer-404" role="main">
|
|
139
|
+
<div class="summer-404__card">
|
|
140
|
+
<div class="summer-404__code" aria-hidden="true">404</div>
|
|
141
|
+
<h1 class="summer-404__title"><%= typeof t === 'function' ? t('pageNotFound') : 'Page not found' %></h1>
|
|
142
|
+
<p class="summer-404__msg"><%= content || (typeof t === 'function' ? t('pageNotFoundMsg') : 'The page you’re looking for doesn’t exist or has moved.') %></p>
|
|
143
|
+
<div class="summer-404__actions">
|
|
144
|
+
<a href="<%= relativePathToRoot %>" class="summer-404__btn summer-404__btn--primary">
|
|
145
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
|
|
146
|
+
<%= typeof t === 'function' ? t('returnHome') : 'Return home' %>
|
|
147
|
+
</a>
|
|
148
|
+
<a href="javascript:history.length > 1 ? history.back() : (location.href = '<%= relativePathToRoot %>')" class="summer-404__btn summer-404__btn--ghost">
|
|
149
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M19 12H5M12 19l-7-7 7-7"></path></svg>
|
|
150
|
+
<%= typeof t === 'function' ? t('goBack') : 'Go back' %>
|
|
151
|
+
</a>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</main>
|
|
155
|
+
</body>
|
|
156
|
+
</html>
|