@terrymooreii/sia 2.1.6 → 2.1.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/bin/cli.js +7 -0
- package/docs/README.md +4 -1
- package/docs/creating-themes.md +216 -1
- package/lib/assets.js +14 -7
- package/lib/build.js +8 -4
- package/lib/init.js +3 -3
- package/lib/templates.js +11 -4
- package/lib/theme-resolver.js +175 -0
- package/lib/theme.js +1524 -0
- package/package.json +1 -1
- package/readme.md +49 -1
- package/themes/developer/pages/index.njk +1 -1
- package/themes/main/includes/footer.njk +1 -1
- package/themes/main/pages/index.njk +1 -1
- package/themes/minimal/includes/footer.njk +1 -1
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -12,7 +12,8 @@ A simple, powerful static site generator built with JavaScript. Similar to Eleve
|
|
|
12
12
|
- **Pagination** - Built-in pagination for listing pages
|
|
13
13
|
- **Image Support** - Automatic image copying and organization
|
|
14
14
|
- **Live Reload** - Development server with hot reloading
|
|
15
|
-
- **Themes** - Built-in themes (main, minimal) with light/dark mode toggle
|
|
15
|
+
- **Themes** - Built-in themes (main, minimal, developer, magazine) with light/dark mode toggle
|
|
16
|
+
- **Custom Themes** - Create and share themes as npm packages (`sia-theme-*`)
|
|
16
17
|
- **RSS Feed** - Automatic RSS feed generation
|
|
17
18
|
- **YAML/JSON Config** - Flexible configuration options
|
|
18
19
|
|
|
@@ -391,8 +392,55 @@ sia build --clean
|
|
|
391
392
|
sia new post "Title"
|
|
392
393
|
sia new page "Title"
|
|
393
394
|
sia new note "Content"
|
|
395
|
+
|
|
396
|
+
# Create a new theme package
|
|
397
|
+
sia theme my-theme
|
|
398
|
+
sia theme my-theme --quick # Skip prompts
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
## Custom Theme Packages
|
|
402
|
+
|
|
403
|
+
Sia supports external themes distributed as npm packages. Theme packages must be named `sia-theme-{name}`.
|
|
404
|
+
|
|
405
|
+
### Using an External Theme
|
|
406
|
+
|
|
407
|
+
```bash
|
|
408
|
+
# Install the theme package
|
|
409
|
+
npm install sia-theme-awesome
|
|
410
|
+
|
|
411
|
+
# Configure in _config.yml
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
```yaml
|
|
415
|
+
theme:
|
|
416
|
+
name: awesome # Uses sia-theme-awesome package
|
|
394
417
|
```
|
|
395
418
|
|
|
419
|
+
Sia resolves themes in this order:
|
|
420
|
+
1. Built-in themes (`main`, `minimal`, `developer`, `magazine`)
|
|
421
|
+
2. npm packages matching `sia-theme-{name}`
|
|
422
|
+
|
|
423
|
+
### Creating a Theme Package
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
# Generate a new theme scaffold
|
|
427
|
+
sia theme my-theme
|
|
428
|
+
|
|
429
|
+
# This creates sia-theme-my-theme/ with:
|
|
430
|
+
# - package.json (properly configured)
|
|
431
|
+
# - README.md (documentation template)
|
|
432
|
+
# - layouts/, includes/, pages/, styles/
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
After customizing, publish to npm:
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
cd sia-theme-my-theme
|
|
439
|
+
npm publish
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
See [Creating Themes](docs/creating-themes.md) for detailed documentation.
|
|
443
|
+
|
|
396
444
|
## Upgrading
|
|
397
445
|
|
|
398
446
|
If you installed Sia as a dependency (recommended):
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
{% for note in collections.notes | limit(3) %}
|
|
52
52
|
<article class="note-card">
|
|
53
53
|
<time class="note-time">{{ note.date | date('short') }}</time>
|
|
54
|
-
<div class="note-preview">{{ note.
|
|
54
|
+
<div class="note-preview">{{ note.excerptHtml | safe }}</div>
|
|
55
55
|
<a href="{{ note.url }}" class="note-link">Read more →</a>
|
|
56
56
|
</article>
|
|
57
57
|
{% endfor %}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="container">
|
|
3
3
|
<p class="footer-text">
|
|
4
4
|
© {{ "now" | date('year') }} {{ site.author or site.title }}.
|
|
5
|
-
Built with <a href="https://github.com/
|
|
5
|
+
Built with <a href="https://github.com/terrymooreii/sia">Sia</a>.
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<nav class="footer-nav">
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
<div class="notes-grid">
|
|
45
45
|
{% for note in collections.notes | limit(3) %}
|
|
46
46
|
<article class="note-card">
|
|
47
|
-
<div class="note-card-content">{{ note.
|
|
47
|
+
<div class="note-card-content">{{ note.excerptHtml | safe }}</div>
|
|
48
48
|
<footer class="note-card-footer">
|
|
49
49
|
<time datetime="{{ note.date | date('iso') }}">{{ note.date | date('full_time') }}</time>
|
|
50
50
|
<a href="{{ note.url }}" class="note-card-link">View →</a>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="container">
|
|
3
3
|
<p class="footer-text">
|
|
4
4
|
© {{ "now" | date('year') }} {{ site.author or site.title }}.
|
|
5
|
-
Built with <a href="https://github.com/
|
|
5
|
+
Built with <a href="https://github.com/terrymooreii/sia">Sia</a>.
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<nav class="footer-nav">
|