create-nodality 1.0.96 → 1.0.97
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/bin/index.js +36 -0
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -98,6 +98,32 @@ new Des()
|
|
|
98
98
|
// Refine this file by hand; copy any new pieces from the Designer
|
|
99
99
|
// panel (or `npm run compile`) as you sketch in src/app.js.
|
|
100
100
|
const uploadPageJs = `import { Text } from "nodality";
|
|
101
|
+
// SEO metadata — uncomment + customise once you have real content.
|
|
102
|
+
// \`applySeoMeta\` writes description / Open Graph / Twitter card /
|
|
103
|
+
// canonical / JSON-LD tags into <head>; these land in the static
|
|
104
|
+
// HTML at build time so crawlers and social-card scrapers see them.
|
|
105
|
+
// Origin is auto-resolved from window.location at runtime; call
|
|
106
|
+
// \`setSeoOrigin("https://example.com")\` once at app boot if you
|
|
107
|
+
// want the prerendered tags to use your production URL too.
|
|
108
|
+
//
|
|
109
|
+
// import {
|
|
110
|
+
// applySeoMeta, setSeoOrigin,
|
|
111
|
+
// websiteJsonLd, organizationJsonLd,
|
|
112
|
+
// } from "nodality/seo";
|
|
113
|
+
// setSeoOrigin("https://${projectName}.example.com");
|
|
114
|
+
// applySeoMeta({
|
|
115
|
+
// path: "/",
|
|
116
|
+
// title: "${projectName} — homepage",
|
|
117
|
+
// description: "One-sentence pitch shown in Google search snippets.",
|
|
118
|
+
// image: "/og-cover.jpg",
|
|
119
|
+
// jsonLd: {
|
|
120
|
+
// "@context": "https://schema.org",
|
|
121
|
+
// "@graph": [
|
|
122
|
+
// websiteJsonLd({ name: "${projectName}", url: "https://${projectName}.example.com" }),
|
|
123
|
+
// organizationJsonLd({ name: "${projectName}", url: "https://${projectName}.example.com" }),
|
|
124
|
+
// ],
|
|
125
|
+
// },
|
|
126
|
+
// });
|
|
101
127
|
|
|
102
128
|
new Text("Hello")
|
|
103
129
|
.set({
|
|
@@ -108,6 +134,16 @@ new Text("Hello")
|
|
|
108
134
|
`;
|
|
109
135
|
writeFileSync(resolve(projectPath, "upload", "pages", "index.js"), uploadPageJs);
|
|
110
136
|
|
|
137
|
+
// robots.txt — allow-all default + sitemap pointer. `nodality
|
|
138
|
+
// prerender` writes upload/sitemap.xml on every build (1.0.168+),
|
|
139
|
+
// so the URL declared here will resolve once you deploy.
|
|
140
|
+
const robotsTxt = `User-agent: *
|
|
141
|
+
Allow: /
|
|
142
|
+
|
|
143
|
+
Sitemap: https://${projectName}.example.com/sitemap.xml
|
|
144
|
+
`;
|
|
145
|
+
writeFileSync(resolve(projectPath, "upload", "robots.txt"), robotsTxt);
|
|
146
|
+
|
|
111
147
|
// webpack outputs the bundle into upload/ so dev (live-server upload)
|
|
112
148
|
// and prerender both see the same lib.bundle.js. clean:false so the
|
|
113
149
|
// build does not wipe the SSG index.html / pages/ that live alongside.
|