@oktis-works/cms 0.19.3 → 1.0.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/README.md +7 -7
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +78 -91
- package/dist/commands.js.map +1 -1
- package/dist/dev.d.ts.map +1 -1
- package/dist/dev.js +1 -9
- package/dist/dev.js.map +1 -1
- package/dist/extension-scaffold.d.ts +3 -5
- package/dist/extension-scaffold.d.ts.map +1 -1
- package/dist/extension-scaffold.js +24 -41
- package/dist/extension-scaffold.js.map +1 -1
- package/dist/generated/app-versions.js +7 -7
- package/dist/generated/app-versions.js.map +1 -1
- package/dist/generated/theme-assets.d.ts +2 -2
- package/dist/generated/theme-assets.d.ts.map +1 -1
- package/dist/generated/theme-assets.js +235 -555
- package/dist/generated/theme-assets.js.map +1 -1
- package/dist/install-loader.d.ts +13 -0
- package/dist/install-loader.d.ts.map +1 -1
- package/dist/install-loader.js +34 -2
- package/dist/install-loader.js.map +1 -1
- package/dist/plugins/mermaid-field/manifest.json +1 -1
- package/dist/prompt.d.ts +39 -5
- package/dist/prompt.d.ts.map +1 -1
- package/dist/prompt.js +147 -51
- package/dist/prompt.js.map +1 -1
- package/dist/redeploy.d.ts +2 -2
- package/dist/redeploy.d.ts.map +1 -1
- package/dist/redeploy.js +11 -22
- package/dist/redeploy.js.map +1 -1
- package/dist/scaffold-docs.d.ts +3 -7
- package/dist/scaffold-docs.d.ts.map +1 -1
- package/dist/scaffold-docs.js +69 -351
- package/dist/scaffold-docs.js.map +1 -1
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +26 -6
- package/dist/scaffold.js.map +1 -1
- package/dist/start.d.ts.map +1 -1
- package/dist/start.js +0 -7
- package/dist/start.js.map +1 -1
- package/dist/theme-assets.d.ts +1 -1
- package/dist/theme-assets.d.ts.map +1 -1
- package/dist/theme-assets.js +3 -3
- package/dist/theme-assets.js.map +1 -1
- package/dist/theme-build.d.ts +4 -7
- package/dist/theme-build.d.ts.map +1 -1
- package/dist/theme-build.js +3 -6
- package/dist/theme-build.js.map +1 -1
- package/dist/theme-dev.d.ts +1 -1
- package/dist/theme-dev.d.ts.map +1 -1
- package/dist/theme-dev.js +1 -5
- package/dist/theme-dev.js.map +1 -1
- package/dist/theme-engine-assets.d.ts +2 -3
- package/dist/theme-engine-assets.d.ts.map +1 -1
- package/dist/theme-engine-assets.js +9 -8
- package/dist/theme-engine-assets.js.map +1 -1
- package/dist/themes/default/404.tsx +10 -0
- package/dist/themes/default/CHANGELOG.md +7 -0
- package/dist/themes/default/archive.tsx +34 -0
- package/dist/themes/default/home.tsx +54 -0
- package/dist/themes/default/index.tsx +19 -0
- package/dist/themes/default/package.json +18 -0
- package/dist/themes/default/page.tsx +19 -0
- package/dist/themes/default/single.tsx +33 -0
- package/dist/themes/default/src/entry-server.tsx +30 -0
- package/dist/themes/default/theme.json +19 -18
- package/dist/update.d.ts.map +1 -1
- package/dist/update.js +0 -8
- package/dist/update.js.map +1 -1
- package/package.json +8 -8
- package/dist/theme-migrate.d.ts +0 -8
- package/dist/theme-migrate.d.ts.map +0 -1
- package/dist/theme-migrate.js +0 -56
- package/dist/theme-migrate.js.map +0 -1
- package/dist/themes/default/404.astro +0 -8
- package/dist/themes/default/archive.astro +0 -52
- package/dist/themes/default/dist/theme.css +0 -1015
- package/dist/themes/default/index.astro +0 -29
- package/dist/themes/default/page-about.astro +0 -52
- package/dist/themes/default/page-blog.astro +0 -52
- package/dist/themes/default/page-contact.astro +0 -56
- package/dist/themes/default/page-home.astro +0 -99
- package/dist/themes/default/page.astro +0 -35
- package/dist/themes/default/post-first-post.astro +0 -51
- package/dist/themes/default/post-second-post.astro +0 -51
- package/dist/themes/default/single.astro +0 -55
|
@@ -6,66 +6,58 @@
|
|
|
6
6
|
// file drifts from the directory it mirrors.
|
|
7
7
|
/** Complete default theme written by `okcms init` (paths relative to themes/default/). */
|
|
8
8
|
export const DEFAULT_THEME_FILES = {
|
|
9
|
-
"404.
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</main
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<div
|
|
41
|
-
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
9
|
+
"404.tsx": `export default function NotFound() {
|
|
10
|
+
return (
|
|
11
|
+
<main className="site error-404">
|
|
12
|
+
<h1>404</h1>
|
|
13
|
+
<h2>Page Not Found</h2>
|
|
14
|
+
<p>Sorry, we couldn't find the page you're looking for.</p>
|
|
15
|
+
<a href="/" className="btn btn-primary">Go Home</a>
|
|
16
|
+
</main>
|
|
17
|
+
);
|
|
18
|
+
}`,
|
|
19
|
+
"CHANGELOG.md": `# okcms-theme-default
|
|
20
|
+
|
|
21
|
+
## 1.0.0
|
|
22
|
+
|
|
23
|
+
### Major Changes
|
|
24
|
+
|
|
25
|
+
- Align the bundled default theme package with the React/Solid Theme SDK bridge release.
|
|
26
|
+
`,
|
|
27
|
+
"archive.tsx": `import type { ThemePageData } from '@oktis-works/theme-sdk';
|
|
28
|
+
|
|
29
|
+
export default function Archive({ page, items }: ThemePageData) {
|
|
30
|
+
return (
|
|
31
|
+
<main className="site archive">
|
|
32
|
+
<header className="archive-header">
|
|
33
|
+
<div className="container">
|
|
34
|
+
<h1 className="archive-title">{page.title}</h1>
|
|
35
|
+
{page.excerpt && <p className="archive-description">{page.excerpt}</p>}
|
|
36
|
+
</div>
|
|
37
|
+
</header>
|
|
38
|
+
<div className="container">
|
|
39
|
+
<section className="posts">
|
|
40
|
+
<div className="posts-grid">
|
|
41
|
+
{items.map((item) => (
|
|
42
|
+
<article className="post-card" key={String(item.slug)}>
|
|
43
|
+
<div className="post-card__content">
|
|
44
|
+
<div className="post-card__header">
|
|
45
|
+
<time className="post-card__date">{item.publishedAt ? new Date(item.publishedAt).toLocaleDateString() : ''}</time>
|
|
46
|
+
</div>
|
|
47
|
+
<h2 className="post-card__title">
|
|
48
|
+
<a href={\`/\${String(item.slug)}\`}>{String(item.title ?? '')}</a>
|
|
49
|
+
</h2>
|
|
50
|
+
{item.excerpt ? <p className="post-card__excerpt">{String(item.excerpt)}</p> : null}
|
|
51
|
+
<a href={\`/\${String(item.slug)}\`} className="btn btn-outline">Read More</a>
|
|
52
|
+
</div>
|
|
53
|
+
</article>
|
|
54
|
+
))}
|
|
53
55
|
</div>
|
|
54
|
-
</
|
|
55
|
-
{{/each}}
|
|
56
|
+
</section>
|
|
56
57
|
</div>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{{pagination}}
|
|
61
|
-
</nav>
|
|
62
|
-
{{/if}}
|
|
63
|
-
{{else}}
|
|
64
|
-
<p class="no-posts">No content published yet.</p>
|
|
65
|
-
{{/if}}
|
|
66
|
-
</div>
|
|
67
|
-
</section>
|
|
68
|
-
</main>`,
|
|
58
|
+
</main>
|
|
59
|
+
);
|
|
60
|
+
}`,
|
|
69
61
|
"dist/theme.css": `/**
|
|
70
62
|
* Tema Default do OkCMS — Design System CSS
|
|
71
63
|
* Engine: css | Isolation: manual
|
|
@@ -1082,494 +1074,180 @@ export const DEFAULT_THEME_FILES = {
|
|
|
1082
1074
|
}
|
|
1083
1075
|
}
|
|
1084
1076
|
`,
|
|
1085
|
-
"
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
<div class="page-content container">
|
|
1096
|
-
{{#if (field "content")}}
|
|
1097
|
-
<div class="entry-content">{{{field "content"}}}</div>
|
|
1098
|
-
{{else if content.text}}
|
|
1099
|
-
<p>{{content.text}}</p>
|
|
1100
|
-
{{/if}}
|
|
1101
|
-
|
|
1102
|
-
{{#if items}}
|
|
1103
|
-
<section class="listing">
|
|
1104
|
-
{{#each items}}
|
|
1105
|
-
<article class="card entry entry--item">
|
|
1106
|
-
<h2 class="entry__title"><a href="/{{slug}}">{{title}}</a></h2>
|
|
1107
|
-
{{#if excerpt}}<p class="entry__excerpt">{{excerpt}}</p>{{/if}}
|
|
1108
|
-
</article>
|
|
1109
|
-
{{/each}}
|
|
1110
|
-
</section>
|
|
1111
|
-
{{/if}}
|
|
1112
|
-
</div>
|
|
1113
|
-
</main>
|
|
1114
|
-
`,
|
|
1115
|
-
"page-about.astro": `<main data-template="page-about" data-type="page" class="page-about">
|
|
1116
|
-
<header class="site-header">
|
|
1117
|
-
<nav class="nav" role="navigation" aria-label="Main navigation">
|
|
1118
|
-
<a href="/" class="site-brand" aria-label="Home">
|
|
1119
|
-
{{site.title}}
|
|
1120
|
-
</a>
|
|
1121
|
-
<ul class="nav-menu">
|
|
1122
|
-
<li><a href="/about">{{#if menus.header.bySlug.about}}{{menus.header.bySlug.about.label}}{{else}}About{{/if}}</a></li>
|
|
1123
|
-
<li><a href="#contact">Contact</a></li>
|
|
1124
|
-
<li><a href="/blog">{{#if menus.header.bySlug.blog}}{{menus.header.bySlug.blog.label}}{{else}}Blog{{/if}}</a></li>
|
|
1125
|
-
</ul>
|
|
1126
|
-
</nav>
|
|
1127
|
-
</header>
|
|
1128
|
-
|
|
1129
|
-
<section class="page-header">
|
|
1130
|
-
<div class="container">
|
|
1131
|
-
<h1>{{field "title"}}</h1>
|
|
1132
|
-
{{#if (field "excerpt")}}
|
|
1133
|
-
<p class="page-excerpt">{{field "excerpt"}}</p>
|
|
1134
|
-
{{/if}}
|
|
1135
|
-
</div>
|
|
1136
|
-
</header>
|
|
1137
|
-
|
|
1138
|
-
<div class="page-content container">
|
|
1139
|
-
{{#if (field "content")}}
|
|
1140
|
-
<div class="entry-content">{{{field "content"}}}</div>
|
|
1141
|
-
{{else if (field "blocks")}}
|
|
1142
|
-
<div class="entry-content">
|
|
1143
|
-
{{#each fields.blocks}}
|
|
1144
|
-
{{#if (eq type 'heading')}}
|
|
1145
|
-
<h{{level}}>{{content}}</h{{level}}>
|
|
1146
|
-
{{else if (eq type 'paragraph')}}
|
|
1147
|
-
<p>{{content}}</p>
|
|
1148
|
-
{{else if (eq type 'image')}}
|
|
1149
|
-
<figure><img src="{{content.url}}" alt="{{content.alt}}" /></figure>
|
|
1150
|
-
{{/if}}
|
|
1151
|
-
{{/each}}
|
|
1152
|
-
</div>
|
|
1153
|
-
{{/if}}
|
|
1154
|
-
</div>
|
|
1155
|
-
</main>
|
|
1156
|
-
|
|
1157
|
-
<footer class="site-footer" role="contentinfo">
|
|
1158
|
-
<div class="container">
|
|
1159
|
-
<nav class="footer-nav" aria-label="Footer navigation">
|
|
1160
|
-
{{#each menus.footer.items}}
|
|
1161
|
-
<a href="{{url}}">{{label}}</a>
|
|
1162
|
-
{{/each}}
|
|
1163
|
-
</nav>
|
|
1164
|
-
<p class="copyright">© {{new Date().getFullYear()}} {{site.title}}. All rights reserved.</p>
|
|
1165
|
-
</div>
|
|
1166
|
-
</footer>
|
|
1167
|
-
`,
|
|
1168
|
-
"page-blog.astro": `<main data-template="page-blog" data-type="page" class="page-blog">
|
|
1169
|
-
<header class="page-header">
|
|
1170
|
-
<div class="container">
|
|
1171
|
-
<h1>{{field "title"}}</h1>
|
|
1172
|
-
{{#if (field "description")}}
|
|
1173
|
-
<p class="page-description">{{field "description"}}</p>
|
|
1174
|
-
{{/if}}
|
|
1175
|
-
</div>
|
|
1176
|
-
</header>
|
|
1177
|
-
|
|
1178
|
-
<section class="posts-section" aria-labelledby="posts-title">
|
|
1179
|
-
<div class="container">
|
|
1180
|
-
{{#if items}}
|
|
1181
|
-
<div class="posts-grid">
|
|
1182
|
-
{{#each items}}
|
|
1183
|
-
<article class="post-card">
|
|
1184
|
-
{{#if thumbnail.url}}
|
|
1185
|
-
<figure class="post-card__image">
|
|
1186
|
-
<a href="{{url}}">
|
|
1187
|
-
<img src="{{thumbnail.url}}" alt="{{thumbnail.alt}}" loading="lazy" />
|
|
1188
|
-
</a>
|
|
1189
|
-
</figure>
|
|
1190
|
-
{{/if}}
|
|
1191
|
-
<div class="post-card__content">
|
|
1192
|
-
<header class="post-card__header">
|
|
1193
|
-
<time class="post-card__date" datetime="{{published_at}}">
|
|
1194
|
-
{{#if published_at}}
|
|
1195
|
-
{{formatDate published_at}}
|
|
1196
|
-
{{/if}}
|
|
1197
|
-
</time>
|
|
1198
|
-
</header>
|
|
1199
|
-
<h2 class="post-card__title"><a href="{{url}}">{{title}}</a></h2>
|
|
1200
|
-
{{#if excerpt}}
|
|
1201
|
-
<p class="post-card__excerpt">{{excerpt}}</p>
|
|
1202
|
-
{{/if}}
|
|
1203
|
-
<a href="{{url}}" class="btn btn-outline">Continue reading</a>
|
|
1204
|
-
</div>
|
|
1205
|
-
</article>
|
|
1206
|
-
{{/each}}
|
|
1207
|
-
</div>
|
|
1208
|
-
|
|
1209
|
-
{{#if pagination}}
|
|
1210
|
-
<nav class="pagination" aria-label="Pagination">
|
|
1211
|
-
{{pagination}}
|
|
1212
|
-
</nav>
|
|
1213
|
-
{{/if}}
|
|
1214
|
-
{{else}}
|
|
1215
|
-
<p class="no-posts">No articles published yet.</p>
|
|
1216
|
-
{{/if}}
|
|
1217
|
-
</div>
|
|
1218
|
-
</section>
|
|
1219
|
-
</main>
|
|
1220
|
-
`,
|
|
1221
|
-
"page-contact.astro": `<main data-template="page-contact" data-type="page" class="page-contact">
|
|
1222
|
-
<header class="site-header">
|
|
1223
|
-
<nav class="nav" role="navigation" aria-label="Main navigation">
|
|
1224
|
-
<a href="/" class="site-brand" aria-label="Home">
|
|
1225
|
-
{{site.title}}
|
|
1226
|
-
</a>
|
|
1227
|
-
<ul class="nav-menu">
|
|
1228
|
-
<li><a href="/about">{{#if menus.header.bySlug.about}}{{menus.header.bySlug.about.label}}{{else}}About{{/if}}</a></li>
|
|
1229
|
-
<li><a href="#contact">Contact</a></li>
|
|
1230
|
-
<li><a href="/blog">{{#if menus.header.bySlug.blog}}{{menus.header.bySlug.blog.label}}{{else}}Blog{{/if}}</a></li>
|
|
1231
|
-
</ul>
|
|
1232
|
-
</nav>
|
|
1233
|
-
</header>
|
|
1234
|
-
|
|
1235
|
-
<section class="page-header">
|
|
1236
|
-
<div class="container">
|
|
1237
|
-
<h1>{{field "title"}}</h1>
|
|
1238
|
-
{{#if (field "excerpt")}}
|
|
1239
|
-
<p class="page-excerpt">{{field "excerpt"}}</p>
|
|
1240
|
-
{{/if}}
|
|
1241
|
-
</div>
|
|
1242
|
-
</section>
|
|
1243
|
-
|
|
1244
|
-
<section class="contact" id="contact" aria-labelledby="contact-title">
|
|
1245
|
-
<div class="container">
|
|
1246
|
-
<h2 id="contact-title">Get in Touch</h2>
|
|
1247
|
-
<p class="contact-intro">{{settings.contactText || 'Fill out the form or send us an email at hello@example.com — we would love to hear from you.'}}</p>
|
|
1248
|
-
<form class="contact-form" action="mailto:hello@example.com" method="POST" enctype="text/plain">
|
|
1249
|
-
<div class="form-group">
|
|
1250
|
-
<label for="contact-name">Name</label>
|
|
1251
|
-
<input type="text" id="contact-name" name="name" required />
|
|
1077
|
+
"home.tsx": `import type { ThemePageData } from '@oktis-works/theme-sdk';
|
|
1078
|
+
|
|
1079
|
+
export default function Home({ site, items, settings }: ThemePageData) {
|
|
1080
|
+
const theme = (settings.theme ?? {}) as Record<string, unknown>;
|
|
1081
|
+
return (
|
|
1082
|
+
<main className="site">
|
|
1083
|
+
<header className="site-header">
|
|
1084
|
+
<div className="container">
|
|
1085
|
+
<h1>{String(theme.siteTitle ?? site.title)}</h1>
|
|
1086
|
+
<p>{site.description}</p>
|
|
1252
1087
|
</div>
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1088
|
+
</header>
|
|
1089
|
+
<section className="hero">
|
|
1090
|
+
<div className="hero-content">
|
|
1091
|
+
<h1>Welcome to {String(theme.siteTitle ?? site.title)}</h1>
|
|
1092
|
+
<p className="hero-subtitle">{site.description || 'A modern CMS built with React and TypeScript.'}</p>
|
|
1093
|
+
<a href="/blog" className="btn btn-primary">Read the Blog</a>
|
|
1256
1094
|
</div>
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1095
|
+
</section>
|
|
1096
|
+
<section className="about-preview">
|
|
1097
|
+
<div className="container">
|
|
1098
|
+
<div className="about-content">
|
|
1099
|
+
<h2>About This Site</h2>
|
|
1100
|
+
<p>This is the default OkCMS theme, rebuilt with React SSR and island hydration.</p>
|
|
1101
|
+
<a href="/about" className="btn btn-secondary">Learn More</a>
|
|
1102
|
+
</div>
|
|
1260
1103
|
</div>
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
</
|
|
1266
|
-
|
|
1267
|
-
<
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
</
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
{{site.title}}
|
|
1283
|
-
</a>
|
|
1284
|
-
<ul class="nav-menu">
|
|
1285
|
-
<li><a href="/about">{{#if menus.header.bySlug.about}}{{menus.header.bySlug.about.label}}{{else}}About{{/if}}</a></li>
|
|
1286
|
-
<li><a href="#contact">Contact</a></li>
|
|
1287
|
-
<li><a href="/blog">{{#if menus.header.bySlug.blog}}{{menus.header.bySlug.blog.label}}{{else}}Blog{{/if}}</a></li>
|
|
1288
|
-
</ul>
|
|
1289
|
-
</nav>
|
|
1290
|
-
</header>
|
|
1291
|
-
|
|
1292
|
-
<section class="hero" id="hero" aria-labelledby="hero-title">
|
|
1293
|
-
<div class="hero-content">
|
|
1294
|
-
<h1 id="hero-title">{{field "title"}}</h1>
|
|
1295
|
-
{{#if (field "subtitle")}}
|
|
1296
|
-
<p class="hero-subtitle">{{field "subtitle"}}</p>
|
|
1297
|
-
{{/if}}
|
|
1298
|
-
<a href="/blog" class="btn btn-primary" role="button">View Blog</a>
|
|
1299
|
-
</div>
|
|
1300
|
-
</section>
|
|
1301
|
-
|
|
1302
|
-
<section class="about-preview" id="about" aria-labelledby="about-title">
|
|
1303
|
-
<div class="container">
|
|
1304
|
-
<h2 id="about-title">About Us</h2>
|
|
1305
|
-
{{#if (field "aboutPreview.html")}}
|
|
1306
|
-
<div class="about-content">{{{field "aboutPreview.html"}}}</div>
|
|
1307
|
-
{{else}}
|
|
1308
|
-
<p>About section content will appear here when configured.</p>
|
|
1309
|
-
{{/if}}
|
|
1310
|
-
<a href="/about" class="btn btn-secondary">Read more →</a>
|
|
1311
|
-
</div>
|
|
1312
|
-
</section>
|
|
1313
|
-
|
|
1314
|
-
<section class="latest-posts" aria-labelledby="latest-title">
|
|
1315
|
-
<div class="container">
|
|
1316
|
-
<header class="section-header">
|
|
1317
|
-
<h2 id="latest-title">Latest Articles</h2>
|
|
1318
|
-
</header>
|
|
1319
|
-
{{#if items}}
|
|
1320
|
-
<div class="posts-grid">
|
|
1321
|
-
{{#each items}}
|
|
1322
|
-
<article class="post-card">
|
|
1323
|
-
{{#if thumbnail.url}}
|
|
1324
|
-
<figure class="post-card__image">
|
|
1325
|
-
<img src="{{thumbnail.url}}" alt="{{thumbnail.alt}}" loading="lazy" />
|
|
1326
|
-
</figure>
|
|
1327
|
-
{{/if}}
|
|
1328
|
-
<div class="post-card__content">
|
|
1329
|
-
<h3 class="post-card__title"><a href="{{url}}">{{title}}</a></h3>
|
|
1330
|
-
{{#if excerpt}}
|
|
1331
|
-
<p class="post-card__excerpt">{{excerpt}}</p>
|
|
1332
|
-
{{/if}}
|
|
1333
|
-
<a href="{{url}}" class="btn btn-outline">Continue reading</a>
|
|
1104
|
+
</section>
|
|
1105
|
+
<section className="posts">
|
|
1106
|
+
<div className="container">
|
|
1107
|
+
<header className="section-header">
|
|
1108
|
+
<h2>Latest Posts</h2>
|
|
1109
|
+
</header>
|
|
1110
|
+
<div className="posts-grid">
|
|
1111
|
+
{items.map((item) => (
|
|
1112
|
+
<article className="post-card" key={String(item.slug)}>
|
|
1113
|
+
<div className="post-card__content">
|
|
1114
|
+
<div className="post-card__header">
|
|
1115
|
+
<time className="post-card__date">{item.publishedAt ? new Date(item.publishedAt).toLocaleDateString() : ''}</time>
|
|
1116
|
+
</div>
|
|
1117
|
+
<h2 className="post-card__title">
|
|
1118
|
+
<a href={\`/\${String(item.slug)}\`}>{String(item.title ?? '')}</a>
|
|
1119
|
+
</h2>
|
|
1120
|
+
{item.excerpt ? <p className="post-card__excerpt">{String(item.excerpt)}</p> : null}
|
|
1121
|
+
<a href={\`/\${String(item.slug)}\`} className="btn btn-outline">Read More</a>
|
|
1122
|
+
</div>
|
|
1123
|
+
</article>
|
|
1124
|
+
))}
|
|
1334
1125
|
</div>
|
|
1335
|
-
</article>
|
|
1336
|
-
{{/each}}
|
|
1337
|
-
</div>
|
|
1338
|
-
{{else}}
|
|
1339
|
-
<p class="no-posts">No articles published yet.</p>
|
|
1340
|
-
{{/if}}
|
|
1341
|
-
</div>
|
|
1342
|
-
</section>
|
|
1343
|
-
|
|
1344
|
-
<section class="contact" id="contact" aria-labelledby="contact-title">
|
|
1345
|
-
<div class="container">
|
|
1346
|
-
<h2 id="contact-title">Get in Touch</h2>
|
|
1347
|
-
<p class="contact-intro">{{settings.contactText || 'Fill out the form or send us an email at hello@example.com — we would love to hear from you.'}}</p>
|
|
1348
|
-
<form class="contact-form" action="mailto:hello@example.com" method="POST" enctype="text/plain">
|
|
1349
|
-
<div class="form-group">
|
|
1350
|
-
<label for="contact-name">Name</label>
|
|
1351
|
-
<input type="text" id="contact-name" name="name" required />
|
|
1352
1126
|
</div>
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1127
|
+
</section>
|
|
1128
|
+
</main>
|
|
1129
|
+
);
|
|
1130
|
+
}`,
|
|
1131
|
+
"index.tsx": `import type { ThemePageData } from '@oktis-works/theme-sdk';
|
|
1132
|
+
|
|
1133
|
+
export default function Index({ page, content }: ThemePageData) {
|
|
1134
|
+
return (
|
|
1135
|
+
<main className="site page">
|
|
1136
|
+
<header className="page-header">
|
|
1137
|
+
<div className="container">
|
|
1138
|
+
<h1>{page.title}</h1>
|
|
1139
|
+
{page.excerpt && <p className="page-excerpt">{page.excerpt}</p>}
|
|
1356
1140
|
</div>
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1141
|
+
</header>
|
|
1142
|
+
<div className="page-content">
|
|
1143
|
+
<div className="container">
|
|
1144
|
+
<div className="entry-content" dangerouslySetInnerHTML={{ __html: String(content.html ?? '') }} />
|
|
1360
1145
|
</div>
|
|
1361
|
-
<button type="submit" class="btn btn-primary">Send</button>
|
|
1362
|
-
</form>
|
|
1363
|
-
</div>
|
|
1364
|
-
</section>
|
|
1365
|
-
</main>
|
|
1366
|
-
|
|
1367
|
-
<footer class="site-footer" role="contentinfo">
|
|
1368
|
-
<div class="container">
|
|
1369
|
-
<nav class="footer-nav" aria-label="Footer navigation">
|
|
1370
|
-
{{#each menus.footer.items}}
|
|
1371
|
-
<a href="{{url}}">{{label}}</a>
|
|
1372
|
-
{{/each}}
|
|
1373
|
-
</nav>
|
|
1374
|
-
<p class="copyright">© {{new Date().getFullYear()}} {{site.title}}. All rights reserved.</p>
|
|
1375
|
-
</div>
|
|
1376
|
-
</footer>
|
|
1377
|
-
`,
|
|
1378
|
-
"page.astro": `<main data-template="page" data-type="{{page.type}}" class="page">
|
|
1379
|
-
<header class="page-header">
|
|
1380
|
-
<div class="container">
|
|
1381
|
-
<h1>{{field "title"}}</h1>
|
|
1382
|
-
{{#if (field "excerpt")}}
|
|
1383
|
-
<p class="page-excerpt">{{field "excerpt"}}</p>
|
|
1384
|
-
{{/if}}
|
|
1385
|
-
{{#if settings.theme.siteDescription}}
|
|
1386
|
-
<p class="site-description">{{settings.theme.siteDescription}}</p>
|
|
1387
|
-
{{/if}}
|
|
1388
|
-
</div>
|
|
1389
|
-
</header>
|
|
1390
|
-
|
|
1391
|
-
<div class="page-content container">
|
|
1392
|
-
{{#if (field "content")}}
|
|
1393
|
-
<div class="entry-content">{{{field "content"}}}</div>
|
|
1394
|
-
{{else if (field "blocks")}}
|
|
1395
|
-
<div class="entry-content">
|
|
1396
|
-
{{#each fields.blocks}}
|
|
1397
|
-
{{#if (eq type 'heading')}}
|
|
1398
|
-
<h{{level}}>{{content}}</h{{level}}>
|
|
1399
|
-
{{else if (eq type 'paragraph')}}
|
|
1400
|
-
<p>{{content}}</p>
|
|
1401
|
-
{{else if (eq type 'image')}}
|
|
1402
|
-
<figure><img src="{{content.url}}" alt="{{content.alt}}" /></figure>
|
|
1403
|
-
{{/if}}
|
|
1404
|
-
{{/each}}
|
|
1405
|
-
</div>
|
|
1406
|
-
{{/if}}
|
|
1407
|
-
</div>
|
|
1408
|
-
</main>
|
|
1409
|
-
|
|
1410
|
-
{{#if jsonLd}}
|
|
1411
|
-
<script type="application/ld+json">{{{jsonLd}}}</script>
|
|
1412
|
-
{{/if}}
|
|
1413
|
-
`,
|
|
1414
|
-
"post-first-post.astro": `<article data-template="post-first-post" data-type="post" class="post post-single">
|
|
1415
|
-
<header class="post-header">
|
|
1416
|
-
<div class="container">
|
|
1417
|
-
<h1 class="post-title">{{field "title"}}</h1>
|
|
1418
|
-
<div class="post-meta">
|
|
1419
|
-
<time datetime="{{content.published_at}}" class="post-date">
|
|
1420
|
-
{{#if content.published_at}}
|
|
1421
|
-
{{formatDate content.published_at}}
|
|
1422
|
-
{{/if}}
|
|
1423
|
-
</time>
|
|
1424
1146
|
</div>
|
|
1425
|
-
</
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
<footer class="post-footer">
|
|
1447
|
-
<div class="container">
|
|
1448
|
-
<nav class="post-nav" aria-label="Post navigation">
|
|
1449
|
-
{{#if prevPost}}
|
|
1450
|
-
<a href="/{{page.type}}/{{prevPost.slug}}" class="post-nav__prev" rel="prev">
|
|
1451
|
-
<span class="post-nav__label">Previous article</span>
|
|
1452
|
-
<span class="post-nav__title">{{prevPost.title}}</span>
|
|
1453
|
-
</a>
|
|
1454
|
-
{{/if}}
|
|
1455
|
-
{{#if nextPost}}
|
|
1456
|
-
<a href="/{{page.type}}/{{nextPost.slug}}" class="post-nav__next" rel="next">
|
|
1457
|
-
<span class="post-nav__label">Next article</span>
|
|
1458
|
-
<span class="post-nav__title">{{nextPost.title}}</span>
|
|
1459
|
-
</a>
|
|
1460
|
-
{{/if}}
|
|
1461
|
-
</nav>
|
|
1462
|
-
</div>
|
|
1463
|
-
</footer>
|
|
1464
|
-
</article>
|
|
1147
|
+
</main>
|
|
1148
|
+
);
|
|
1149
|
+
}`,
|
|
1150
|
+
"package.json": `{
|
|
1151
|
+
"name": "okcms-theme-default",
|
|
1152
|
+
"version": "1.0.0",
|
|
1153
|
+
"private": true,
|
|
1154
|
+
"type": "module",
|
|
1155
|
+
"dependencies": {
|
|
1156
|
+
"@oktis-works/theme-sdk": "^1.0.0",
|
|
1157
|
+
"react": "^19.0.0",
|
|
1158
|
+
"react-dom": "^19.0.0"
|
|
1159
|
+
},
|
|
1160
|
+
"devDependencies": {
|
|
1161
|
+
"@types/react": "^19.0.0",
|
|
1162
|
+
"@types/react-dom": "^19.0.0",
|
|
1163
|
+
"@vitejs/plugin-react": "^6.0.0",
|
|
1164
|
+
"typescript": "^5.7.0",
|
|
1165
|
+
"vite": "^8.0.0"
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1465
1168
|
`,
|
|
1466
|
-
"
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
{
|
|
1474
|
-
{{
|
|
1475
|
-
</
|
|
1169
|
+
"page.tsx": `import type { ThemePageData } from '@oktis-works/theme-sdk';
|
|
1170
|
+
|
|
1171
|
+
export default function Page({ page, content }: ThemePageData) {
|
|
1172
|
+
return (
|
|
1173
|
+
<main className="site page">
|
|
1174
|
+
<header className="page-header">
|
|
1175
|
+
<div className="container">
|
|
1176
|
+
<h1>{page.title}</h1>
|
|
1177
|
+
{page.excerpt && <p className="page-excerpt">{page.excerpt}</p>}
|
|
1178
|
+
</div>
|
|
1179
|
+
</header>
|
|
1180
|
+
<div className="page-content">
|
|
1181
|
+
<div className="container">
|
|
1182
|
+
<div className="entry-content" dangerouslySetInnerHTML={{ __html: String(content.html ?? '') }} />
|
|
1183
|
+
</div>
|
|
1476
1184
|
</div>
|
|
1477
|
-
</
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
<
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
{{
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
<span class="post-nav__label">Next article</span>
|
|
1510
|
-
<span class="post-nav__title">{{nextPost.title}}</span>
|
|
1511
|
-
</a>
|
|
1512
|
-
{{/if}}
|
|
1513
|
-
</nav>
|
|
1514
|
-
</div>
|
|
1515
|
-
</footer>
|
|
1516
|
-
</article>
|
|
1517
|
-
`,
|
|
1518
|
-
"single.astro": `<article data-template="single" data-type="{{page.type}}" class="post post-single">
|
|
1519
|
-
<header class="post-header">
|
|
1520
|
-
<div class="container">
|
|
1521
|
-
<h1 class="post-title">{{field "title"}}</h1>
|
|
1522
|
-
<div class="post-meta">
|
|
1523
|
-
<time datetime="{{content.published_at}}" class="post-date">
|
|
1524
|
-
{{#if content.published_at}}
|
|
1525
|
-
{{formatDate content.published_at}}
|
|
1526
|
-
{{/if}}
|
|
1527
|
-
</time>
|
|
1185
|
+
</main>
|
|
1186
|
+
);
|
|
1187
|
+
}`,
|
|
1188
|
+
"single.tsx": `import type { ThemePageData } from '@oktis-works/theme-sdk';
|
|
1189
|
+
|
|
1190
|
+
export default function Single({ page, content }: ThemePageData) {
|
|
1191
|
+
return (
|
|
1192
|
+
<article className="site single post-single">
|
|
1193
|
+
<div className="container">
|
|
1194
|
+
<header className="post-header">
|
|
1195
|
+
<h1 className="post-title">{page.title}</h1>
|
|
1196
|
+
<div className="post-meta">
|
|
1197
|
+
<time className="post-date">{page.publishedAt ? new Date(page.publishedAt).toLocaleDateString() : ''}</time>
|
|
1198
|
+
</div>
|
|
1199
|
+
</header>
|
|
1200
|
+
<div className="post-body" dangerouslySetInnerHTML={{ __html: String(content.html ?? '') }} />
|
|
1201
|
+
<footer className="post-footer">
|
|
1202
|
+
<nav className="post-nav" aria-label="Post navigation">
|
|
1203
|
+
{page.previous && (
|
|
1204
|
+
<a href={\`/\${String(page.previous.slug)}\`} className="post-nav__prev">
|
|
1205
|
+
<span className="post-nav__label">Previous</span>
|
|
1206
|
+
<span className="post-nav__title">{String(page.previous.title)}</span>
|
|
1207
|
+
</a>
|
|
1208
|
+
)}
|
|
1209
|
+
{page.next && (
|
|
1210
|
+
<a href={\`/\${String(page.next.slug)}\`} className="post-nav__next">
|
|
1211
|
+
<span className="post-nav__label">Next</span>
|
|
1212
|
+
<span className="post-nav__title">{String(page.next.title)}</span>
|
|
1213
|
+
</a>
|
|
1214
|
+
)}
|
|
1215
|
+
</nav>
|
|
1216
|
+
</footer>
|
|
1528
1217
|
</div>
|
|
1529
|
-
</
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
<span class="post-nav__title">{{nextPost.title}}</span>
|
|
1563
|
-
</a>
|
|
1564
|
-
{{/if}}
|
|
1565
|
-
</nav>
|
|
1566
|
-
</div>
|
|
1567
|
-
</footer>
|
|
1568
|
-
</article>
|
|
1569
|
-
|
|
1570
|
-
{{#if jsonLd}}
|
|
1571
|
-
<script type="application/ld+json">{{{jsonLd}}}</script>
|
|
1572
|
-
{{/if}}
|
|
1218
|
+
</article>
|
|
1219
|
+
);
|
|
1220
|
+
}`,
|
|
1221
|
+
"src/entry-server.tsx": `import Home from '../home';
|
|
1222
|
+
import Index from '../index';
|
|
1223
|
+
import Single from '../single';
|
|
1224
|
+
import Page from '../page';
|
|
1225
|
+
import Archive from '../archive';
|
|
1226
|
+
import NotFound from '../404';
|
|
1227
|
+
import { renderToStaticMarkup } from 'react-dom/server';
|
|
1228
|
+
import type { FC } from 'react';
|
|
1229
|
+
import type { ThemePageData, ThemeRenderContext, ThemeRenderOutput, ThemeSdkBridge } from '@oktis-works/theme-sdk';
|
|
1230
|
+
|
|
1231
|
+
const templates: Record<string, FC<ThemePageData>> = {
|
|
1232
|
+
'home': Home,
|
|
1233
|
+
'index': Index,
|
|
1234
|
+
'single': Single,
|
|
1235
|
+
'page': Page,
|
|
1236
|
+
'archive': Archive,
|
|
1237
|
+
'404': NotFound,
|
|
1238
|
+
};
|
|
1239
|
+
|
|
1240
|
+
export const templateKeys = Object.keys(templates);
|
|
1241
|
+
|
|
1242
|
+
export function render(
|
|
1243
|
+
key: string,
|
|
1244
|
+
data: ThemePageData,
|
|
1245
|
+
_ctx: ThemeRenderContext,
|
|
1246
|
+
_sdk: ThemeSdkBridge
|
|
1247
|
+
): ThemeRenderOutput {
|
|
1248
|
+
const Component = templates[key] ?? templates['404'];
|
|
1249
|
+
return { html: renderToStaticMarkup(<Component {...data} />) };
|
|
1250
|
+
}
|
|
1573
1251
|
`,
|
|
1574
1252
|
"src/theme.css": `/**
|
|
1575
1253
|
* Tema Default do OkCMS — Design System CSS
|
|
@@ -2588,40 +2266,41 @@ export const DEFAULT_THEME_FILES = {
|
|
|
2588
2266
|
`,
|
|
2589
2267
|
"theme.json": `{
|
|
2590
2268
|
"name": "default",
|
|
2591
|
-
"version": "0.
|
|
2592
|
-
"description": "Default OkCMS theme —
|
|
2269
|
+
"version": "0.37.0",
|
|
2270
|
+
"description": "Default OkCMS theme — React SSR with island hydration",
|
|
2593
2271
|
"type": "theme",
|
|
2594
2272
|
"author": "Oktis Works",
|
|
2595
2273
|
"compatibility": {
|
|
2596
|
-
"okcms": "^0.
|
|
2274
|
+
"okcms": "^1.0.0"
|
|
2597
2275
|
},
|
|
2598
2276
|
"screenshots": [
|
|
2599
2277
|
"screenshot.png"
|
|
2600
2278
|
],
|
|
2279
|
+
"render": {
|
|
2280
|
+
"engine": "react",
|
|
2281
|
+
"apiVersion": 2,
|
|
2282
|
+
"hydration": "islands",
|
|
2283
|
+
"entry": "src/entry-server.tsx"
|
|
2284
|
+
},
|
|
2285
|
+
"stylesConfig": {
|
|
2286
|
+
"engine": "css",
|
|
2287
|
+
"isolation": true,
|
|
2288
|
+
"entry": "src/theme.css",
|
|
2289
|
+
"output": "dist/theme.css"
|
|
2290
|
+
},
|
|
2601
2291
|
"provides": {
|
|
2602
2292
|
"layouts": [
|
|
2603
|
-
"
|
|
2604
|
-
"
|
|
2605
|
-
"page-contact",
|
|
2606
|
-
"page-blog",
|
|
2607
|
-
"post-first-post",
|
|
2608
|
-
"post-second-post",
|
|
2609
|
-
"page",
|
|
2293
|
+
"home",
|
|
2294
|
+
"index",
|
|
2610
2295
|
"single",
|
|
2296
|
+
"page",
|
|
2611
2297
|
"archive",
|
|
2612
|
-
"index",
|
|
2613
2298
|
"404"
|
|
2614
2299
|
],
|
|
2615
2300
|
"assets": [
|
|
2616
2301
|
"dist/theme.css"
|
|
2617
2302
|
]
|
|
2618
2303
|
},
|
|
2619
|
-
"stylesConfig": {
|
|
2620
|
-
"engine": "css",
|
|
2621
|
-
"isolation": "manual",
|
|
2622
|
-
"entry": "src/theme.css",
|
|
2623
|
-
"output": "dist/theme.css"
|
|
2624
|
-
},
|
|
2625
2304
|
"settings": [
|
|
2626
2305
|
{
|
|
2627
2306
|
"name": "siteTitle",
|
|
@@ -2642,7 +2321,8 @@ export const DEFAULT_THEME_FILES = {
|
|
|
2642
2321
|
"default": "Fill out the form or send us an email at hello@example.com"
|
|
2643
2322
|
}
|
|
2644
2323
|
]
|
|
2645
|
-
}
|
|
2324
|
+
}
|
|
2325
|
+
`,
|
|
2646
2326
|
};
|
|
2647
2327
|
/**
|
|
2648
2328
|
* Binary files of the default theme: base64 so the source stays valid TS,
|
|
@@ -2655,6 +2335,6 @@ export const DEFAULT_THEME_BINARY_FILES = {
|
|
|
2655
2335
|
export const DEFAULT_THEME_MANIFEST = DEFAULT_THEME_FILES['theme.json'] ?? '';
|
|
2656
2336
|
/** Default theme stylesheet, served straight from `dist/theme.css` (no build). */
|
|
2657
2337
|
export const DEFAULT_THEME_CSS = DEFAULT_THEME_FILES['dist/theme.css'] ?? '';
|
|
2658
|
-
/**
|
|
2659
|
-
export const
|
|
2338
|
+
/** React/Solid source components of the default theme. */
|
|
2339
|
+
export const THEME_COMPONENT_FILES = Object.fromEntries(Object.entries(DEFAULT_THEME_FILES).filter(([file]) => file.endsWith('.tsx')));
|
|
2660
2340
|
//# sourceMappingURL=theme-assets.js.map
|