fossbook 0.0.5 → 0.0.7

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 CHANGED
@@ -1,246 +1,247 @@
1
- # Fossbook
2
-
3
- A lightweight static blog site generator for GitHub Pages, similar to Hugo but built with Node.js.
4
-
5
- ## Features
6
-
7
- - **Markdown-based** — Write posts in Markdown with YAML front-matter
8
- - **Pagination** — Automatic home page pagination
9
- - **Tags** — Tag-based categorization with tag index and per-tag listing pages
10
- - **Theming** — Bundled Archie theme with support for custom themes
11
- - **SEO** — Open Graph and Twitter Card meta tags out of the box
12
- - **GitHub Pages** — Built-in CNAME support for custom domains
13
- - **Dev server** — Local preview server with Express
14
- - **Syntax highlighting** — Code block highlighting via highlight.js
15
-
16
- ## Quick Start
17
-
18
- ### Install globally
19
-
20
- ```bash
21
- npm install -g fossbook
22
- ```
23
-
24
- ### Create a new site
25
-
26
- ```bash
27
- mkdir my-blog && cd my-blog
28
- fossbook init
29
- ```
30
-
31
- This creates the following structure:
32
-
33
- ```
34
- my-blog/
35
- ├── content/
36
- ├── about.md
37
- └── posts/
38
- ├── static/
39
- │ └── images/
40
- ├── fossbook.config.js
41
- └── package.json
42
- ```
43
-
44
- ### Create a new post
45
-
46
- ```bash
47
- fossbook new "My First Post"
48
- ```
49
-
50
- This creates `content/posts/My First Post/index.md` with pre-filled front-matter and an `images/` directory.
51
-
52
- ### Build the site
53
-
54
- ```bash
55
- fossbook build
56
- ```
57
-
58
- ### Preview locally
59
-
60
- ```bash
61
- fossbook serve
62
- ```
63
-
64
- Open http://localhost:3000 to view your site.
65
-
66
- ## Configuration
67
-
68
- Create a `fossbook.config.js` in your project root:
69
-
70
- ```js
71
- module.exports = {
72
- blogName: "My Blog",
73
- authorName: "Your Name",
74
- authorDescription: "A short bio",
75
- authorWebsite: "https://example.com",
76
- blogDescription: "A blog about things",
77
- blogsite: "https://example.com",
78
-
79
- // Optional
80
- githubCNAME: "example.com",
81
- googleAnalyticsID: "",
82
- authorTwitter: "@you",
83
- siteTwitter: "@yourblog",
84
- githubRepository: "https://github.com/you/your-blog",
85
- image: "https://example.com/default-image.png",
86
- theme: "archie",
87
-
88
- // Directory overrides (defaults shown)
89
- content: "./content",
90
- postsDir: "./content/posts",
91
- outputDir: "./public",
92
- staticDir: "./static",
93
- themesDir: "./themes",
94
- };
95
- ```
96
-
97
- ## Content Format
98
-
99
- ### Post front-matter
100
-
101
- ```markdown
102
- ---
103
- title: My Post Title
104
- date: 2026-02-17
105
- description: "A brief summary of the post"
106
- image: "feature.png"
107
- tags: "JavaScript, Node.js, Static Site"
108
- ---
109
-
110
- Your Markdown content here...
111
- ```
112
-
113
- ### Directory structure
114
-
115
- ```
116
- content/posts/My Post Title/
117
- ├── index.md
118
- └── images/
119
- └── feature.png
120
- ```
121
-
122
- ## CLI Reference
123
-
124
- ```
125
- Usage: fossbook <command> [options]
126
-
127
- Commands:
128
- build Build the static site
129
- serve Build and start a local dev server
130
- new <title> Create a new post
131
- init Create a new fossbook site project
132
-
133
- Options:
134
- -c, --config Path to config file (default: ./fossbook.config.js)
135
- -o, --output Output directory (default: ./public)
136
- -p, --port Dev server port (default: 3000)
137
- -v, --version Show version number
138
- -h, --help Show help
139
- ```
140
-
141
- ## Theming
142
-
143
- Fossbook ships with the Archie theme by default. To use a custom theme:
144
-
145
- 1. Create a `themes/<your-theme>/` directory in your project
146
- 2. Add `layouts/` (HTML templates) and `assets/` (CSS, fonts, images)
147
- 3. Set `theme: "your-theme"` in `fossbook.config.js`
148
-
149
- Theme resolution order: user project `themes/` → built-in `themes/`.
150
-
151
- ### Required layout files
152
-
153
- ```
154
- layouts/
155
- ├── home.html # Home page with pagination
156
- ├── post.html # Individual post page
157
- ├── page.html # Static pages (e.g., about)
158
- ├── all_posts.html # All posts listing
159
- ├── tag.html # Per-tag listing
160
- ├── tag_list.html # Tag index page
161
- └── partials/
162
- └── footer.html # Footer partial
163
- ```
164
-
165
- ## Deploying to GitHub Pages
166
-
167
- Fossbook can automatically deploy your blog to GitHub Pages using GitHub Actions.
168
-
169
- ### Prerequisites: Install GitHub CLI (`gh`)
170
-
171
- The `fossbook deploy` command uses the GitHub CLI to create repositories and monitor deployments.
172
-
173
- **Linux (Debian/Ubuntu):**
174
-
175
- ```bash
176
- sudo apt install gh
177
- ```
178
-
179
- **macOS:**
180
-
181
- ```bash
182
- brew install gh
183
- ```
184
-
185
- **Windows:**
186
-
187
- ```bash
188
- winget install GitHub.cli
189
- ```
190
-
191
- Then authenticate with your GitHub account:
192
-
193
- ```bash
194
- gh auth login
195
- ```
196
-
197
- Follow the prompts to log in via browser or token.
198
-
199
- ### Initialize with GitHub
200
-
201
- ```bash
202
- mkdir my-blog && cd my-blog
203
- fossbook init --github
204
- ```
205
-
206
- This will:
207
- 1. Scaffold the site project (config, content directories)
208
- 2. Create a GitHub repository for your blog
209
- 3. Generate `.github/workflows/deploy.yml` for automatic deployments
210
- 4. Push the initial commit to GitHub
211
-
212
- ### Publish a post
213
-
214
- ```bash
215
- fossbook new "My New Article"
216
- # ... edit content/posts/My New Article/index.md ...
217
- fossbook deploy
218
- ```
219
-
220
- Fossbook will build the site, commit, push to GitHub, wait for the CI/CD pipeline to finish, and display the live URL:
221
-
222
- ```
223
- Building site... done.
224
- Committing: "Publish: My New Article"
225
- Pushing to origin/main...
226
- Waiting for GitHub Pages deployment...
227
-
228
- ✅ Published! View your article at:
229
- https://username.github.io/my-blog/My%20New%20Article/
230
- ```
231
-
232
- **Deploy options:**
233
-
234
- ```bash
235
- fossbook deploy --message "Update homepage" # Custom commit message
236
- fossbook deploy --no-wait # Push without waiting for CI
237
- ```
238
-
239
- ## License
240
-
241
- - Generator code: [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
242
- - Archie theme: [MIT License](https://github.com/athul/archie?tab=MIT-1-ov-file#readme)
243
-
244
- ## Credits
245
-
246
- Adapted from [kartiknair's blog](https://github.com/kartiknair/blog) and styled using the [Archie theme](https://github.com/athul/archie).
1
+ # Fossbook
2
+
3
+ A lightweight static blog site generator for GitHub Pages, similar to Hugo but built with Node.js.
4
+ It was originally part of the [F/OSS Comics blog](https://fosscomics.com) and is now an independent, installable package that anyone can use.
5
+
6
+ ## Features
7
+
8
+ - **Markdown-based** — Write posts in Markdown with YAML front-matter
9
+ - **Pagination** — Automatic home page pagination
10
+ - **Tags** — Tag-based categorization with tag index and per-tag listing pages
11
+ - **Theming** — Bundled Archie theme with support for custom themes
12
+ - **SEO** — Open Graph and Twitter Card meta tags out of the box
13
+ - **GitHub Pages** — Built-in CNAME support for custom domains
14
+ - **Dev server** — Local preview server with Express
15
+ - **Syntax highlighting** — Code block highlighting via highlight.js
16
+
17
+ ## Quick Start
18
+
19
+ ### Install globally
20
+
21
+ ```bash
22
+ npm install -g fossbook
23
+ ```
24
+
25
+ ### Create a new site
26
+
27
+ ```bash
28
+ mkdir my-blog && cd my-blog
29
+ fossbook init
30
+ ```
31
+
32
+ This creates the following structure:
33
+
34
+ ```
35
+ my-blog/
36
+ ├── content/
37
+ ├── about.md
38
+ │ └── posts/
39
+ ├── static/
40
+ │ └── images/
41
+ ├── fossbook.config.js
42
+ └── package.json
43
+ ```
44
+
45
+ ### Create a new post
46
+
47
+ ```bash
48
+ fossbook new "My First Post"
49
+ ```
50
+
51
+ This creates `content/posts/My First Post/index.md` with pre-filled front-matter and an `images/` directory.
52
+
53
+ ### Build the site
54
+
55
+ ```bash
56
+ fossbook build
57
+ ```
58
+
59
+ ### Preview locally
60
+
61
+ ```bash
62
+ fossbook serve
63
+ ```
64
+
65
+ Open http://localhost:3000 to view your site.
66
+
67
+ ## Configuration
68
+
69
+ Create a `fossbook.config.js` in your project root:
70
+
71
+ ```js
72
+ module.exports = {
73
+ blogName: "My Blog",
74
+ authorName: "Your Name",
75
+ authorDescription: "A short bio",
76
+ authorWebsite: "https://example.com",
77
+ blogDescription: "A blog about things",
78
+ blogsite: "https://example.com",
79
+
80
+ // Optional
81
+ githubCNAME: "example.com",
82
+ googleAnalyticsID: "",
83
+ authorTwitter: "@you",
84
+ siteTwitter: "@yourblog",
85
+ githubRepository: "https://github.com/you/your-blog",
86
+ image: "https://example.com/default-image.png",
87
+ theme: "archie",
88
+
89
+ // Directory overrides (defaults shown)
90
+ content: "./content",
91
+ postsDir: "./content/posts",
92
+ outputDir: "./public",
93
+ staticDir: "./static",
94
+ themesDir: "./themes",
95
+ };
96
+ ```
97
+
98
+ ## Content Format
99
+
100
+ ### Post front-matter
101
+
102
+ ```markdown
103
+ ---
104
+ title: My Post Title
105
+ date: 2026-02-17
106
+ description: "A brief summary of the post"
107
+ image: "feature.png"
108
+ tags: "JavaScript, Node.js, Static Site"
109
+ ---
110
+
111
+ Your Markdown content here...
112
+ ```
113
+
114
+ ### Directory structure
115
+
116
+ ```
117
+ content/posts/My Post Title/
118
+ ├── index.md
119
+ └── images/
120
+ └── feature.png
121
+ ```
122
+
123
+ ## CLI Reference
124
+
125
+ ```
126
+ Usage: fossbook <command> [options]
127
+
128
+ Commands:
129
+ build Build the static site
130
+ serve Build and start a local dev server
131
+ new <title> Create a new post
132
+ init Create a new fossbook site project
133
+
134
+ Options:
135
+ -c, --config Path to config file (default: ./fossbook.config.js)
136
+ -o, --output Output directory (default: ./public)
137
+ -p, --port Dev server port (default: 3000)
138
+ -v, --version Show version number
139
+ -h, --help Show help
140
+ ```
141
+
142
+ ## Theming
143
+
144
+ Fossbook ships with the Archie theme by default. To use a custom theme:
145
+
146
+ 1. Create a `themes/<your-theme>/` directory in your project
147
+ 2. Add `layouts/` (HTML templates) and `assets/` (CSS, fonts, images)
148
+ 3. Set `theme: "your-theme"` in `fossbook.config.js`
149
+
150
+ Theme resolution order: user project `themes/` → built-in `themes/`.
151
+
152
+ ### Required layout files
153
+
154
+ ```
155
+ layouts/
156
+ ├── home.html # Home page with pagination
157
+ ├── post.html # Individual post page
158
+ ├── page.html # Static pages (e.g., about)
159
+ ├── all_posts.html # All posts listing
160
+ ├── tag.html # Per-tag listing
161
+ ├── tag_list.html # Tag index page
162
+ └── partials/
163
+ └── footer.html # Footer partial
164
+ ```
165
+
166
+ ## Deploying to GitHub Pages
167
+
168
+ Fossbook can automatically deploy your blog to GitHub Pages using GitHub Actions.
169
+
170
+ ### Prerequisites: Install GitHub CLI (`gh`)
171
+
172
+ The `fossbook deploy` command uses the GitHub CLI to create repositories and monitor deployments.
173
+
174
+ **Linux (Debian/Ubuntu):**
175
+
176
+ ```bash
177
+ sudo apt install gh
178
+ ```
179
+
180
+ **macOS:**
181
+
182
+ ```bash
183
+ brew install gh
184
+ ```
185
+
186
+ **Windows:**
187
+
188
+ ```bash
189
+ winget install GitHub.cli
190
+ ```
191
+
192
+ Then authenticate with your GitHub account:
193
+
194
+ ```bash
195
+ gh auth login
196
+ ```
197
+
198
+ Follow the prompts to log in via browser or token.
199
+
200
+ ### Initialize with GitHub
201
+
202
+ ```bash
203
+ mkdir my-blog && cd my-blog
204
+ fossbook init --github
205
+ ```
206
+
207
+ This will:
208
+ 1. Scaffold the site project (config, content directories)
209
+ 2. Create a GitHub repository for your blog
210
+ 3. Generate `.github/workflows/deploy.yml` for automatic deployments
211
+ 4. Push the initial commit to GitHub
212
+
213
+ ### Publish a post
214
+
215
+ ```bash
216
+ fossbook new "My New Article"
217
+ # ... edit content/posts/My New Article/index.md ...
218
+ fossbook deploy
219
+ ```
220
+
221
+ Fossbook will build the site, commit, push to GitHub, wait for the CI/CD pipeline to finish, and display the live URL:
222
+
223
+ ```
224
+ Building site... done.
225
+ Committing: "Publish: My New Article"
226
+ Pushing to origin/main...
227
+ Waiting for GitHub Pages deployment... ✓
228
+
229
+ ✅ Published! View your article at:
230
+ https://username.github.io/my-blog/My%20New%20Article/
231
+ ```
232
+
233
+ **Deploy options:**
234
+
235
+ ```bash
236
+ fossbook deploy --message "Update homepage" # Custom commit message
237
+ fossbook deploy --no-wait # Push without waiting for CI
238
+ ```
239
+
240
+ ## License
241
+
242
+ - Generator code: [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
243
+ - Archie theme: [MIT License](https://github.com/athul/archie?tab=MIT-1-ov-file#readme)
244
+
245
+ ## Credits
246
+
247
+ Adapted from [kartiknair's blog](https://github.com/kartiknair/blog) and styled using the [Archie theme](https://github.com/athul/archie).