@superblog/cli 0.1.1 → 0.1.3
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/README.md +117 -0
- package/package.json +6 -6
package/README.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# superblog
|
|
2
|
+
|
|
3
|
+
The developer CLI for [Superblog](https://superblog.ai) custom templates.
|
|
4
|
+
|
|
5
|
+
Redesign your blog by writing HTML, watch it render on your own posts as you
|
|
6
|
+
save, then publish.
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm i -g @superblog/cli
|
|
10
|
+
superblog login
|
|
11
|
+
superblog template dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Getting started
|
|
15
|
+
|
|
16
|
+
**1. Install and log in.**
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm i -g @superblog/cli
|
|
20
|
+
superblog login
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Login opens your browser. Approve the machine, pick the site, and you are
|
|
24
|
+
done. No key is shown or copied; it is stored in `~/.superblog/config.json`
|
|
25
|
+
with mode `0600`. On a machine with no browser, `superblog login -no-browser`
|
|
26
|
+
prints a URL to open elsewhere and takes a pasted key.
|
|
27
|
+
|
|
28
|
+
**2. Write your template.**
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
mkdir my-template && cd my-template
|
|
32
|
+
superblog template dev
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
In an empty folder this offers to scaffold a starter template, then builds
|
|
36
|
+
your real site with it and gives you a live URL. Save a file and the page
|
|
37
|
+
reloads. Your live site is untouched the whole time.
|
|
38
|
+
|
|
39
|
+
**3. Publish.**
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
superblog template preview # upload this folder, build every post at a preview URL
|
|
43
|
+
superblog template deploy # upload this folder, then publish
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
A dev session builds a subset of posts for speed; `template preview` builds
|
|
47
|
+
every post, so it is the check before publishing. Nothing your readers see
|
|
48
|
+
changes until `template deploy`.
|
|
49
|
+
|
|
50
|
+
## Commands
|
|
51
|
+
|
|
52
|
+
| Command | What it does |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `superblog login` | Connect this machine to a site, through your browser |
|
|
55
|
+
| `superblog logout` | Forget the stored key |
|
|
56
|
+
| `superblog status` | Show which site you are working against |
|
|
57
|
+
| `superblog template dev` | Write your template and watch it live. Start here. |
|
|
58
|
+
| `superblog template preview` | Upload this folder, then build every post at a preview URL |
|
|
59
|
+
| `superblog template deploy` | Upload this folder, then publish |
|
|
60
|
+
| `superblog template init` | Only write the starter files. `dev` does this for you. |
|
|
61
|
+
| `superblog preview` | Build the site as the server has it, at a preview URL |
|
|
62
|
+
| `superblog deploy` | Publish the site as the server has it |
|
|
63
|
+
|
|
64
|
+
The bare `preview` and `deploy` act on your site without touching local files.
|
|
65
|
+
They are for content changes, no template involved. `-h` on any command lists
|
|
66
|
+
its flags.
|
|
67
|
+
|
|
68
|
+
## How a template is laid out
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
views/ one file per page type, all ten required
|
|
72
|
+
partials/
|
|
73
|
+
nav.html your site navigation
|
|
74
|
+
footer.html your site footer
|
|
75
|
+
*.html your own snippets
|
|
76
|
+
assets/ your css, js and images
|
|
77
|
+
docs/
|
|
78
|
+
index.html the whole guide and reference. Open it in a browser.
|
|
79
|
+
LLMS.md the same reference for a coding assistant
|
|
80
|
+
schema.json the same again, for an editor
|
|
81
|
+
template.json one decision: our stylesheet or your own CSS
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
A view is plain markup. The file name is what makes it that page, so there is
|
|
85
|
+
nothing to declare at the top:
|
|
86
|
+
|
|
87
|
+
```jinja
|
|
88
|
+
<h1>{{ title }}</h1>
|
|
89
|
+
<div class="prose">{{ content | safe }}</div>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The `<head>`, the SEO tags, the canonical and the fonts are handled for you
|
|
93
|
+
and are not reachable from a template, so nothing you write can break them.
|
|
94
|
+
|
|
95
|
+
Stylesheets and scripts in `assets/` load on every page automatically; your
|
|
96
|
+
CSS is linked after ours, so yours wins. A single asset can be 500KB, the
|
|
97
|
+
whole template 25MB.
|
|
98
|
+
|
|
99
|
+
All ten views and both partials are required. A template owns the whole
|
|
100
|
+
site's design; a missing page stops the build rather than leaving the site
|
|
101
|
+
half one design and half another.
|
|
102
|
+
|
|
103
|
+
Point a coding assistant at `docs/` and it writes against the real contract.
|
|
104
|
+
The scaffolded `docs/index.html` is the full guide for a person.
|
|
105
|
+
|
|
106
|
+
## What happens to a broken template
|
|
107
|
+
|
|
108
|
+
Templates are validated on every build. Errors name the file, the line and
|
|
109
|
+
what is wrong, in terms of the template you wrote.
|
|
110
|
+
|
|
111
|
+
In a dev session, a template that fails validation stops the session and
|
|
112
|
+
tells you why. Fix it and it rebuilds. On deploy, the same: the deploy stops
|
|
113
|
+
rather than publishing something you did not ask for. A deploy carries your
|
|
114
|
+
posts as well as your template, so an unfixed template holds up publishing
|
|
115
|
+
until it is fixed. That is deliberate: a failure you can see beats your
|
|
116
|
+
design being silently swapped for one you never chose.
|
|
117
|
+
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superblog/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Build custom templates for your Superblog: develop with live reload, preview, and deploy.",
|
|
5
5
|
"homepage": "https://superblog.ai",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"bin": { "superblog": "bin.js" },
|
|
8
8
|
"engines": { "node": ">=18" },
|
|
9
9
|
"optionalDependencies": {
|
|
10
|
-
"@superblog/darwin-arm64": "0.1.
|
|
11
|
-
"@superblog/darwin-x64": "0.1.
|
|
12
|
-
"@superblog/linux-x64": "0.1.
|
|
13
|
-
"@superblog/linux-arm64": "0.1.
|
|
14
|
-
"@superblog/windows-x64": "0.1.
|
|
10
|
+
"@superblog/darwin-arm64": "0.1.3",
|
|
11
|
+
"@superblog/darwin-x64": "0.1.3",
|
|
12
|
+
"@superblog/linux-x64": "0.1.3",
|
|
13
|
+
"@superblog/linux-arm64": "0.1.3",
|
|
14
|
+
"@superblog/windows-x64": "0.1.3"
|
|
15
15
|
}
|
|
16
16
|
}
|