@commonpub/layer 0.3.0 → 0.3.2
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/composables/useSiteName.ts +8 -2
- package/nuxt.config.ts +5 -0
- package/package.json +3 -3
- package/pages/[type]/index.vue +3 -2
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
/** Returns the configured site name from runtime config (defaults to 'CommonPub').
|
|
1
|
+
/** Returns the configured site name from runtime config (defaults to 'CommonPub').
|
|
2
|
+
* Safe to call inside lazy SEO resolvers — falls back to 'CommonPub' if
|
|
3
|
+
* the Nuxt instance is unavailable (e.g. during SSR head rendering). */
|
|
2
4
|
export function useSiteName(): string {
|
|
3
|
-
|
|
5
|
+
try {
|
|
6
|
+
return (useRuntimeConfig().public.siteName as string) || 'CommonPub';
|
|
7
|
+
} catch {
|
|
8
|
+
return 'CommonPub';
|
|
9
|
+
}
|
|
4
10
|
}
|
package/nuxt.config.ts
CHANGED
|
@@ -79,5 +79,10 @@ export default defineNuxtConfig({
|
|
|
79
79
|
},
|
|
80
80
|
nitro: {
|
|
81
81
|
preset: 'node-server',
|
|
82
|
+
// css-tree uses dynamic require() for data/patch.json which Rollup can't resolve.
|
|
83
|
+
// Keep it in node_modules instead of bundling into server chunks.
|
|
84
|
+
externals: {
|
|
85
|
+
external: ['css-tree'],
|
|
86
|
+
},
|
|
82
87
|
},
|
|
83
88
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commonpub/layer",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./nuxt.config.ts",
|
|
6
6
|
"files": [
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"@commonpub/config": "0.7.0",
|
|
49
49
|
"@commonpub/auth": "0.5.0",
|
|
50
50
|
"@commonpub/docs": "0.5.0",
|
|
51
|
-
"@commonpub/learning": "0.5.0",
|
|
52
51
|
"@commonpub/editor": "0.5.0",
|
|
52
|
+
"@commonpub/learning": "0.5.0",
|
|
53
53
|
"@commonpub/protocol": "0.9.4",
|
|
54
|
-
"@commonpub/server": "2.7.0",
|
|
55
54
|
"@commonpub/schema": "0.8.8",
|
|
55
|
+
"@commonpub/server": "2.7.0",
|
|
56
56
|
"@commonpub/ui": "0.7.1"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {}
|
package/pages/[type]/index.vue
CHANGED
|
@@ -3,10 +3,11 @@ import type { Serialized, ContentListItem, PaginatedResponse } from '@commonpub/
|
|
|
3
3
|
|
|
4
4
|
const route = useRoute();
|
|
5
5
|
const contentType = computed(() => route.params.type as string);
|
|
6
|
+
const siteName = useSiteName();
|
|
6
7
|
|
|
7
8
|
useSeoMeta({
|
|
8
|
-
title: () => `${contentType.value} — ${
|
|
9
|
-
description: () => `Browse ${contentType.value} on
|
|
9
|
+
title: () => `${contentType.value} — ${siteName}`,
|
|
10
|
+
description: () => `Browse ${contentType.value} on ${siteName}.`,
|
|
10
11
|
});
|
|
11
12
|
|
|
12
13
|
const sortBy = ref('recent');
|