create-nodality 1.0.96 → 1.0.98
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 +47 -6
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -98,16 +98,57 @@ 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
|
-
new Text("Hello")
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
128
|
+
new Text("Hello").set({
|
|
129
|
+
size: "S1",
|
|
130
|
+
font: "Arial",
|
|
131
|
+
stroke: {
|
|
132
|
+
op: {
|
|
133
|
+
name: "blast",
|
|
134
|
+
color: "green",
|
|
135
|
+
width: "1px"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}).render("#mount");
|
|
108
139
|
`;
|
|
109
140
|
writeFileSync(resolve(projectPath, "upload", "pages", "index.js"), uploadPageJs);
|
|
110
141
|
|
|
142
|
+
// robots.txt — allow-all default + sitemap pointer. `nodality
|
|
143
|
+
// prerender` writes upload/sitemap.xml on every build (1.0.168+),
|
|
144
|
+
// so the URL declared here will resolve once you deploy.
|
|
145
|
+
const robotsTxt = `User-agent: *
|
|
146
|
+
Allow: /
|
|
147
|
+
|
|
148
|
+
Sitemap: https://${projectName}.example.com/sitemap.xml
|
|
149
|
+
`;
|
|
150
|
+
writeFileSync(resolve(projectPath, "upload", "robots.txt"), robotsTxt);
|
|
151
|
+
|
|
111
152
|
// webpack outputs the bundle into upload/ so dev (live-server upload)
|
|
112
153
|
// and prerender both see the same lib.bundle.js. clean:false so the
|
|
113
154
|
// build does not wipe the SSG index.html / pages/ that live alongside.
|