Skip to content

Commit ba5f2d4

Browse files
committed
📝 ssg documentation improved
1 parent e68a183 commit ba5f2d4

File tree

54 files changed

+283
-200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+283
-200
lines changed

articles/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Getting Started
33
description: Create full-stack javascript applications within seconds
44
---
55

6-
> 📌 You can watch a video tutorial on our [Youtube Channel](https://www.youtube.com/watch?v=l23z00GEar8).
6+
> 📌 You can watch a video tutorial on our [Youtube Channel](https://www.youtube.com/watch?v=l23z00GEar8&list=PL5ylYELQy1hyFbguVaShp3XujjdVXLpId).
77
88
Create full-stack javascript applications within seconds using *npx* to generate your project files from the latest template.
99

articles/static-site-generation.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ Static sites are useful for read-only applications like blogs and documentation.
1111
1212
All the benefits of [server-side rendering](/server-side-rendering) apply to static generated sites.
1313

14-
You can generate a static website with the following NPX command:
14+
You can generate a static website from your Nullstack application with the following NPX command:
1515

1616
```sh
1717
npx create-nullstatic-app
1818
```
1919

20+
> 🔥 You must be in a Nullstack project folder to run this command.
21+
2022
By default, it will create your Nullstatic application in the *static* folder.
2123

2224
You can change the folder by passing it as an argument to the command:
@@ -39,6 +41,29 @@ On the subsequent requests, Nullstack will fetch the generated JSON and update t
3941

4042
This, in fact, gives you not only a static generated site, but a static generated API that feeds a Single Page Application with zero costs.
4143

44+
## Good Pratices
45+
46+
You can add a script to your package.json to generate your static website in a custom folder:
47+
48+
```jsx
49+
{
50+
"name": "nullstack.github.io",
51+
"version": "0.0.1",
52+
"description": "",
53+
"author": "",
54+
"license": "ISC",
55+
"devDependencies": {
56+
"nullstack": "~0.9.0"
57+
},
58+
"scripts": {
59+
"start": "npx webpack --config node_modules/nullstack/webpack.config.js --mode=development --watch",
60+
"build": "npx webpack --config node_modules/nullstack/webpack.config.js --mode=production",
61+
"ssg": "npx create-nullstatic-app docs"
62+
}
63+
}
64+
65+
```
66+
4267
## Caveats
4368

4469
Nullstatic only crawls your application up to the initiate resolution, further API requests triggered by events will be ignored.

docs/404.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
<meta property="og:locale" content="en">
1717
<link rel="shortcut icon" href="/favicon-96x96.png" type="image/png">
1818
<link rel="icon" href="/favicon-96x96.png" type="image/png">
19-
<link rel="manifest" href="/manifest-1559346b155b5a89a6acc9918d4e1249.json" integrity="sha512-dZgijzedfi73kz1kWm59C1cCtmMc4h1r1cC/8LGrn8niVN5QOpk6VM3id275XMzw8LrPIohK8bk3c6V070nTMQ==">
19+
<link rel="manifest" href="/manifest-8d5ca4ab8bb5386038595a2ff3f8ced5.json" integrity="sha512-dZgijzedfi73kz1kWm59C1cCtmMc4h1r1cC/8LGrn8niVN5QOpk6VM3id275XMzw8LrPIohK8bk3c6V070nTMQ==">
2020
<meta name="mobile-web-app-capable" content="yes">
2121
<meta name="apple-mobile-web-app-capable" content="yes">
2222
<meta name="application-name" content="Nullstack">
2323
<meta name="apple-mobile-web-app-title" content="Nullstack">
2424

2525
<meta name="msapplication-starturl" content="/">
2626
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
27-
<link rel="stylesheet" href="/client-1559346b155b5a89a6acc9918d4e1249.css" integrity="sha512-yZzVC9YeVzQTwSyngIq6/ixaQvh0UFz3tBlN/Y6RJYuRmlQM4FuEDSmbJcEjyK9VeMABpS0tL7Z22vycB9Vs7w==" crossorigin="anonymous">
27+
<link rel="stylesheet" href="/client-8d5ca4ab8bb5386038595a2ff3f8ced5.css" integrity="sha512-SL0iipAOw8MMlS1uy2qCXIs+48cJek2lZx8z0nsnLiLp8v7c/1f658kEBkDpvRMuPT6npAENYiF8ZaROAby47A==" crossorigin="anonymous">
2828

2929
<link rel="apple-touch-icon" sizes="180x180" href="/icon-180x180.png">
3030
<meta name="msapplication-TileColor" content="#2d3748">
@@ -36,16 +36,16 @@
3636
<script async>
3737
window.page = {"image":"/image-1200x630.png","status":404,"locale":"en","title":"Not Found - Nullstack","description":"Sorry, this is not the page you are looking for."};
3838
window.instances = {"_.0":{},"_.0.0.1":{"expanded":false},"_.0.0.7":{"title":"","html":""},"_.0.0.8":{},"_.0.0.9":{}};
39-
window.environment = {"client":false,"server":true,"development":false,"production":true,"static":true,"key":"1559346b155b5a89a6acc9918d4e1249"};
39+
window.environment = {"client":false,"server":true,"development":false,"production":true,"static":true,"key":"8d5ca4ab8bb5386038595a2ff3f8ced5"};
4040
window.settings = {};
4141
window.worker = {"enabled":true,"fetching":false,"preload":["/nullstack.svg","/about","/application-startup","/context-data","/context-environment","/context-page","/context-project","/context-secrets","/context-settings","/context","/full-stack-lifecycle","/getting-started","/how-to-deploy-a-nullstack-application","/how-to-use-facebook-pixel-with-nullstack","/how-to-use-google-analytics-with-nullstack","/how-to-use-mongodb-with-nullstack","/instance-key","/instance-self","/njs-file-extension","/renderable-components","/routes-and-params","/server-functions","/server-request-and-response","/server-side-rendering","/service-worker","/stateful-components","/static-site-generation","/styles","/two-way-bindings","/documentation","/components","/about","/contributors","/roboto-v20-latin-300.woff2","/roboto-v20-latin-500.woff2","/crete-round-v9-latin-regular.woff2","/nullachan.png"],"headers":{},"loading":{},"online":true,"responsive":true};
4242
window.params = {"slug":"404"};
4343
window.project = {"type":"website","display":"standalone","orientation":"portrait","scope":"/","root":"/","favicon":"/favicon-96x96.png","icons":{"72":"/icon-72x72.png","96":"/icon-96x96.png","128":"/icon-128x128.png","144":"/icon-144x144.png","152":"/icon-152x152.png","180":"/icon-180x180.png","192":"/icon-192x192.png","384":"/icon-384x384.png","512":"/icon-512x512.png"},"disallow":[],"sitemap":true,"cdn":"","protocol":"https","name":"Nullstack","domain":"nullstack.app","color":"#d22365","backgroundColor":"#2d3748"};
4444
window.context = {};
4545
document.addEventListener('DOMContentLoaded', () => {
4646
const script = window.document.createElement('script');
47-
script.src = '/client-1559346b155b5a89a6acc9918d4e1249.js';
48-
script.integrity = 'sha512-z2U4yEF1C++LHfb7nhmql6lT1mVl8ixiK72zSbxGzHsrqY210JpGD0M0gN5gKjqpVBbRqTUeDbHJBxZIDMI1zA==';
47+
script.src = '/client-8d5ca4ab8bb5386038595a2ff3f8ced5.js';
48+
script.integrity = 'sha512-snMoRmU+UcUUiOcHhOWgO31lsZi8lgovjwlpnxMZWOT/KndAakVftXKC5gmP4bBOKAFeqQ5JhdtE3lJsXe/ZoQ==';
4949
script.crossOrigin = 'anonymous';
5050
document.body.append(script);
5151
});

docs/404/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
<meta property="og:locale" content="en">
1717
<link rel="shortcut icon" href="/favicon-96x96.png" type="image/png">
1818
<link rel="icon" href="/favicon-96x96.png" type="image/png">
19-
<link rel="manifest" href="/manifest-1559346b155b5a89a6acc9918d4e1249.json" integrity="sha512-dZgijzedfi73kz1kWm59C1cCtmMc4h1r1cC/8LGrn8niVN5QOpk6VM3id275XMzw8LrPIohK8bk3c6V070nTMQ==">
19+
<link rel="manifest" href="/manifest-8d5ca4ab8bb5386038595a2ff3f8ced5.json" integrity="sha512-dZgijzedfi73kz1kWm59C1cCtmMc4h1r1cC/8LGrn8niVN5QOpk6VM3id275XMzw8LrPIohK8bk3c6V070nTMQ==">
2020
<meta name="mobile-web-app-capable" content="yes">
2121
<meta name="apple-mobile-web-app-capable" content="yes">
2222
<meta name="application-name" content="Nullstack">
2323
<meta name="apple-mobile-web-app-title" content="Nullstack">
2424

2525
<meta name="msapplication-starturl" content="/">
2626
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
27-
<link rel="stylesheet" href="/client-1559346b155b5a89a6acc9918d4e1249.css" integrity="sha512-yZzVC9YeVzQTwSyngIq6/ixaQvh0UFz3tBlN/Y6RJYuRmlQM4FuEDSmbJcEjyK9VeMABpS0tL7Z22vycB9Vs7w==" crossorigin="anonymous">
27+
<link rel="stylesheet" href="/client-8d5ca4ab8bb5386038595a2ff3f8ced5.css" integrity="sha512-SL0iipAOw8MMlS1uy2qCXIs+48cJek2lZx8z0nsnLiLp8v7c/1f658kEBkDpvRMuPT6npAENYiF8ZaROAby47A==" crossorigin="anonymous">
2828

2929
<link rel="apple-touch-icon" sizes="180x180" href="/icon-180x180.png">
3030
<meta name="msapplication-TileColor" content="#2d3748">
@@ -36,16 +36,16 @@
3636
<script async>
3737
window.page = {"image":"/image-1200x630.png","status":404,"locale":"en","title":"Not Found - Nullstack","description":"Sorry, this is not the page you are looking for."};
3838
window.instances = {"_.0":{},"_.0.0.1":{"expanded":false},"_.0.0.7":{"title":"","html":""},"_.0.0.8":{},"_.0.0.9":{}};
39-
window.environment = {"client":false,"server":true,"development":false,"production":true,"static":true,"key":"1559346b155b5a89a6acc9918d4e1249"};
39+
window.environment = {"client":false,"server":true,"development":false,"production":true,"static":true,"key":"8d5ca4ab8bb5386038595a2ff3f8ced5"};
4040
window.settings = {};
4141
window.worker = {"enabled":true,"fetching":false,"preload":["/nullstack.svg","/about","/application-startup","/context-data","/context-environment","/context-page","/context-project","/context-secrets","/context-settings","/context","/full-stack-lifecycle","/getting-started","/how-to-deploy-a-nullstack-application","/how-to-use-facebook-pixel-with-nullstack","/how-to-use-google-analytics-with-nullstack","/how-to-use-mongodb-with-nullstack","/instance-key","/instance-self","/njs-file-extension","/renderable-components","/routes-and-params","/server-functions","/server-request-and-response","/server-side-rendering","/service-worker","/stateful-components","/static-site-generation","/styles","/two-way-bindings","/documentation","/components","/about","/contributors","/roboto-v20-latin-300.woff2","/roboto-v20-latin-500.woff2","/crete-round-v9-latin-regular.woff2","/nullachan.png"],"headers":{},"loading":{},"online":true,"responsive":true};
4242
window.params = {"slug":"404"};
4343
window.project = {"type":"website","display":"standalone","orientation":"portrait","scope":"/","root":"/","favicon":"/favicon-96x96.png","icons":{"72":"/icon-72x72.png","96":"/icon-96x96.png","128":"/icon-128x128.png","144":"/icon-144x144.png","152":"/icon-152x152.png","180":"/icon-180x180.png","192":"/icon-192x192.png","384":"/icon-384x384.png","512":"/icon-512x512.png"},"disallow":[],"sitemap":true,"cdn":"","protocol":"https","name":"Nullstack","domain":"nullstack.app","color":"#d22365","backgroundColor":"#2d3748"};
4444
window.context = {};
4545
document.addEventListener('DOMContentLoaded', () => {
4646
const script = window.document.createElement('script');
47-
script.src = '/client-1559346b155b5a89a6acc9918d4e1249.js';
48-
script.integrity = 'sha512-z2U4yEF1C++LHfb7nhmql6lT1mVl8ixiK72zSbxGzHsrqY210JpGD0M0gN5gKjqpVBbRqTUeDbHJBxZIDMI1zA==';
47+
script.src = '/client-8d5ca4ab8bb5386038595a2ff3f8ced5.js';
48+
script.integrity = 'sha512-snMoRmU+UcUUiOcHhOWgO31lsZi8lgovjwlpnxMZWOT/KndAakVftXKC5gmP4bBOKAFeqQ5JhdtE3lJsXe/ZoQ==';
4949
script.crossOrigin = 'anonymous';
5050
document.body.append(script);
5151
});

0 commit comments

Comments
 (0)