@leadertechie/personal-site-kit 0.1.0-alpha.21 → 0.1.0-alpha.23
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/dist/chunks/{template-Lmx7Dxoc.js → template-VrYrCcQL.js} +8 -7
- package/dist/index.js +1 -1
- package/dist/prerender/template.d.ts.map +1 -1
- package/dist/prerender.js +3 -23
- package/dist/shared/__tests__/router.test.d.ts +2 -0
- package/dist/shared/__tests__/router.test.d.ts.map +1 -0
- package/dist/shared/router.d.ts.map +1 -1
- package/dist/shared.js +1 -1
- package/package.json +1 -1
|
@@ -129,7 +129,7 @@ const generatePageContent = (pathname, routes, footerLinks, data) => {
|
|
|
129
129
|
canonicalUrl,
|
|
130
130
|
content: mainContent
|
|
131
131
|
};
|
|
132
|
-
} else if (pathname === "/about
|
|
132
|
+
} else if (pathname === "/about") {
|
|
133
133
|
const apiBaseUrl = data?.apiUrl || "";
|
|
134
134
|
const mainContent = `
|
|
135
135
|
${bannerTemplate}
|
|
@@ -166,14 +166,15 @@ class Router {
|
|
|
166
166
|
this.logo = "/api/logo";
|
|
167
167
|
this.appElement = null;
|
|
168
168
|
const store = ui.getStore();
|
|
169
|
-
const
|
|
170
|
-
|
|
169
|
+
const storeConfig = store.getConfig();
|
|
170
|
+
const uiConfig = ui.getConfig();
|
|
171
|
+
this.routes = uiConfig.routes?.length ? uiConfig.routes : [
|
|
171
172
|
{ link: "/", text: "Home" },
|
|
172
173
|
{ link: "/blogs", text: "Blogs" },
|
|
173
174
|
{ link: "/stories", text: "Stories" },
|
|
174
|
-
{ link: "/about
|
|
175
|
+
{ link: "/about", text: "About" }
|
|
175
176
|
];
|
|
176
|
-
this.apiUrl =
|
|
177
|
+
this.apiUrl = storeConfig.apiUrl;
|
|
177
178
|
}
|
|
178
179
|
get config() {
|
|
179
180
|
return this.ui.getStore().getConfig();
|
|
@@ -253,7 +254,7 @@ class Router {
|
|
|
253
254
|
case "/":
|
|
254
255
|
await this.renderHomePage();
|
|
255
256
|
break;
|
|
256
|
-
case "/about
|
|
257
|
+
case "/about":
|
|
257
258
|
this.renderAboutMePage();
|
|
258
259
|
break;
|
|
259
260
|
case "/blogs":
|
|
@@ -337,7 +338,7 @@ class Router {
|
|
|
337
338
|
this.afterRender();
|
|
338
339
|
}
|
|
339
340
|
renderAboutMePage() {
|
|
340
|
-
const pageContent = generatePageContent("/about
|
|
341
|
+
const pageContent = generatePageContent("/about", this.routes, this.footerLinks, {
|
|
341
342
|
siteTitle: this.siteTitle,
|
|
342
343
|
copyright: this.copyright,
|
|
343
344
|
apiUrl: this.apiUrl
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { A, B, M, R, W, c, a, g, b, d, h, e, r, s, v } from "./chunks/website-ap
|
|
|
2
2
|
import { WebsitePrerender } from "./prerender.js";
|
|
3
3
|
import { A as A2, a as a2, b as b2, c as c2, d as d2, e as e2, f, g as g2, h as h2, i, B as B2, F, M as M2, j, S, k } from "./chunks/index-DsRjL9Uy.js";
|
|
4
4
|
import { S as S2, g as g3, i as i2, r as r2 } from "./chunks/site-store-CGV9c2DI.js";
|
|
5
|
-
import { R as R2, T, W as W2, b as b3, c as c3, g as g4, r as r3 } from "./chunks/template-
|
|
5
|
+
import { R as R2, T, W as W2, b as b3, c as c3, g as g4, r as r3 } from "./chunks/template-VrYrCcQL.js";
|
|
6
6
|
export {
|
|
7
7
|
A as AUTH_KV,
|
|
8
8
|
A2 as AdminAboutMeSection,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/prerender/template.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAsDD,eAAO,MAAM,kBAAkB,GAAU,8FAStC,aAAa,KAAG,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/prerender/template.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAsDD,eAAO,MAAM,kBAAkB,GAAU,8FAStC,aAAa,KAAG,OAAO,CAAC,MAAM,CAmChC,CAAC"}
|
package/dist/prerender.js
CHANGED
|
@@ -73,26 +73,6 @@ const createHtmlTemplate = async ({
|
|
|
73
73
|
<link rel="canonical" href="${canonicalUrl}" />
|
|
74
74
|
<link rel="stylesheet" crossorigin href="${css}" />
|
|
75
75
|
<script type="module" crossorigin src="${js}"><\/script>
|
|
76
|
-
<!-- md2interact: client-side DOM interactions, CSS hydration, and event bus -->
|
|
77
|
-
<script type="module">
|
|
78
|
-
import { init } from '@leadertechie/md2interact';
|
|
79
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
80
|
-
init({
|
|
81
|
-
interactions: {
|
|
82
|
-
'poll': { selector: '[data-interact="poll"]' },
|
|
83
|
-
'live-update': { selector: '[data-interact="live-update"]' },
|
|
84
|
-
'click-toggle': { selector: '[data-interact="click-toggle"]' },
|
|
85
|
-
'infinite-scroll': { selector: '[data-interact="infinite-scroll"]' },
|
|
86
|
-
'form-live': { selector: '[data-interact="form-live"]' }
|
|
87
|
-
},
|
|
88
|
-
cssHydration: {
|
|
89
|
-
inlineCritical: true,
|
|
90
|
-
layerInjection: true,
|
|
91
|
-
themeToggle: true
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
<\/script>
|
|
96
76
|
</head>
|
|
97
77
|
<body>
|
|
98
78
|
${hydrationData}
|
|
@@ -322,7 +302,7 @@ const generatePageContent = async (pathname, routes, footerLinks, env) => {
|
|
|
322
302
|
};
|
|
323
303
|
if (pathname === "/" || pathname === "") {
|
|
324
304
|
return strategies.home();
|
|
325
|
-
} else if (pathname === "/about
|
|
305
|
+
} else if (pathname === "/about") {
|
|
326
306
|
return strategies.about();
|
|
327
307
|
} else if (pathname === "/blogs" || pathname === "/blogs/") {
|
|
328
308
|
return strategies.blogsList();
|
|
@@ -345,7 +325,7 @@ class WebsitePrerender {
|
|
|
345
325
|
{ link: "/", text: "Home" },
|
|
346
326
|
{ link: "/blogs", text: "Blogs" },
|
|
347
327
|
{ link: "/stories", text: "Stories" },
|
|
348
|
-
{ link: "/about
|
|
328
|
+
{ link: "/about", text: "About" }
|
|
349
329
|
];
|
|
350
330
|
this.defaultFooterLinks = options.defaultFooterLinks || [
|
|
351
331
|
{ text: "LinkedIn", link: "https://linkedin.com/in/yourname" },
|
|
@@ -520,7 +500,7 @@ class WebsitePrerender {
|
|
|
520
500
|
return fetch(request);
|
|
521
501
|
}
|
|
522
502
|
let hydrationScript = "";
|
|
523
|
-
if (url.pathname === "/about
|
|
503
|
+
if (url.pathname === "/about" || url.pathname === "/about/") {
|
|
524
504
|
const aboutMeData = await this.fetchAboutMeData(apiUrl, env);
|
|
525
505
|
if (aboutMeData) {
|
|
526
506
|
hydrationScript = `<script>window.__HYDRATION_DATA__ = ${JSON.stringify(aboutMeData)};<\/script>`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.test.d.ts","sourceRoot":"","sources":["../../../src/shared/__tests__/router.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/shared/router.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,qBAAa,MAAM;IAML,OAAO,CAAC,EAAE;IALtB,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,UAAU,CAA4B;gBAE1B,EAAE,EAAE,SAAS;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/shared/router.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,qBAAa,MAAM;IAML,OAAO,CAAC,EAAE;IALtB,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,UAAU,CAA4B;gBAE1B,EAAE,EAAE,SAAS;IAgBjC,OAAO,KAAK,MAAM,GAEjB;IAED,OAAO,KAAK,SAAS,GAEpB;IAED,OAAO,KAAK,SAAS,GAEpB;IAED,OAAO,KAAK,WAAW,GAatB;IAEM,IAAI,CAAC,YAAY,GAAE,MAAc;IAWxC,OAAO,CAAC,mBAAmB;IAsCd,QAAQ,CAAC,IAAI,EAAE,MAAM;IA6BlC,OAAO,CAAC,WAAW;IAgCnB;;;OAGG;IACH,OAAO,CAAC,WAAW;YAIL,cAAc;IAmC5B,OAAO,CAAC,iBAAiB;YASX,qBAAqB;YAkBrB,uBAAuB;YAoBvB,eAAe;CAiB9B"}
|
package/dist/shared.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S, g, i, r } from "./chunks/site-store-CGV9c2DI.js";
|
|
2
|
-
import { R, T, W, b, c, g as g2, r as r2 } from "./chunks/template-
|
|
2
|
+
import { R, T, W, b, c, g as g2, r as r2 } from "./chunks/template-VrYrCcQL.js";
|
|
3
3
|
export {
|
|
4
4
|
R as Router,
|
|
5
5
|
S as SiteStore,
|
package/package.json
CHANGED