@terrymooreii/sia 2.1.5 → 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/_config.yml +3 -1
- package/bin/cli.js +7 -0
- package/docs/README.md +135 -0
- package/docs/creating-themes.md +987 -0
- package/docs/front-matter.md +557 -0
- package/docs/markdown-guide.md +536 -0
- package/docs/template-reference.md +581 -0
- package/lib/assets.js +15 -8
- package/lib/build.js +8 -4
- package/lib/config.js +3 -1
- package/lib/content.js +74 -2
- package/lib/init.js +3 -3
- package/lib/templates.js +14 -6
- package/lib/theme-resolver.js +175 -0
- package/lib/theme.js +1524 -0
- package/package.json +1 -1
- package/readme.md +51 -2
- package/themes/developer/includes/hero.njk +6 -0
- package/themes/developer/pages/index.njk +2 -5
- package/themes/magazine/includes/hero.njk +8 -0
- package/themes/magazine/pages/index.njk +4 -9
- package/themes/main/includes/footer.njk +1 -1
- package/themes/main/includes/hero.njk +6 -0
- package/themes/main/pages/index.njk +2 -5
- package/themes/minimal/includes/footer.njk +1 -1
- package/themes/minimal/includes/hero.njk +6 -0
- package/themes/minimal/pages/index.njk +2 -5
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
|
|
|
@@ -105,7 +106,8 @@ site:
|
|
|
105
106
|
url: "https://example.com"
|
|
106
107
|
author: "Your Name"
|
|
107
108
|
|
|
108
|
-
theme:
|
|
109
|
+
theme:
|
|
110
|
+
name: main # Options: main, minimal, developer, magazine
|
|
109
111
|
|
|
110
112
|
input: src
|
|
111
113
|
output: dist
|
|
@@ -390,8 +392,55 @@ sia build --clean
|
|
|
390
392
|
sia new post "Title"
|
|
391
393
|
sia new page "Title"
|
|
392
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
|
|
393
417
|
```
|
|
394
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
|
+
|
|
395
444
|
## Upgrading
|
|
396
445
|
|
|
397
446
|
If you installed Sia as a dependency (recommended):
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
{% block content %}
|
|
4
4
|
<div class="home-page">
|
|
5
|
-
|
|
6
|
-
<h1 class="hero-title">{{ site.title }}</h1>
|
|
7
|
-
<p class="hero-description">{{ site.description }}</p>
|
|
8
|
-
</section>
|
|
5
|
+
{% include "hero.njk" %}
|
|
9
6
|
|
|
10
7
|
<section class="posts-section">
|
|
11
8
|
<div class="section-header">
|
|
@@ -54,7 +51,7 @@
|
|
|
54
51
|
{% for note in collections.notes | limit(3) %}
|
|
55
52
|
<article class="note-card">
|
|
56
53
|
<time class="note-time">{{ note.date | date('short') }}</time>
|
|
57
|
-
<div class="note-preview">{{ note.
|
|
54
|
+
<div class="note-preview">{{ note.excerptHtml | safe }}</div>
|
|
58
55
|
<a href="{{ note.url }}" class="note-link">Read more →</a>
|
|
59
56
|
</article>
|
|
60
57
|
{% endfor %}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
{% extends "base.njk" %}
|
|
2
2
|
|
|
3
3
|
{% block content %}
|
|
4
|
-
|
|
5
|
-
<div class="hero-content">
|
|
6
|
-
<h1 class="hero-title">{{ site.title }}</h1>
|
|
7
|
-
<p class="hero-subtitle">{{ site.description }}</p>
|
|
8
|
-
</div>
|
|
9
|
-
</section>
|
|
4
|
+
{% include "hero.njk" %}
|
|
10
5
|
|
|
11
6
|
{% set featuredPost = collections.posts[0] %}
|
|
12
7
|
{% if featuredPost %}
|
|
@@ -17,7 +12,7 @@
|
|
|
17
12
|
<span class="featured-category">{{ featuredPost.tags[0] }}</span>
|
|
18
13
|
{% endif %}
|
|
19
14
|
<h2 class="featured-title">
|
|
20
|
-
<a href="{{ featuredPost.url }}">{{ featuredPost.title }}</a>
|
|
15
|
+
<a href="{{ featuredPost.url | url }}">{{ featuredPost.title }}</a>
|
|
21
16
|
</h2>
|
|
22
17
|
<p class="featured-excerpt">{{ featuredPost.excerpt | excerpt(200) }}</p>
|
|
23
18
|
<div class="featured-meta">
|
|
@@ -44,7 +39,7 @@
|
|
|
44
39
|
<span class="card-category">{{ post.tags[0] }}</span>
|
|
45
40
|
{% endif %}
|
|
46
41
|
<h3 class="card-title">
|
|
47
|
-
<a href="{{ post.url }}">{{ post.title }}</a>
|
|
42
|
+
<a href="{{ post.url | url }}">{{ post.title }}</a>
|
|
48
43
|
</h3>
|
|
49
44
|
<p class="card-excerpt">{{ post.excerpt | excerpt(100) }}</p>
|
|
50
45
|
<div class="card-meta">
|
|
@@ -70,7 +65,7 @@
|
|
|
70
65
|
<article class="note-preview">
|
|
71
66
|
<time datetime="{{ note.date | date('iso') }}">{{ note.date | date('short') }}</time>
|
|
72
67
|
<p>{{ note.excerpt | excerpt(150) }}</p>
|
|
73
|
-
<a href="{{ note.url }}" class="note-link">Read note →</a>
|
|
68
|
+
<a href="{{ note.url | url }}" class="note-link">Read note →</a>
|
|
74
69
|
</article>
|
|
75
70
|
{% endfor %}
|
|
76
71
|
</div>
|
|
@@ -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">
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
{% extends "base.njk" %}
|
|
2
2
|
|
|
3
3
|
{% block content %}
|
|
4
|
-
|
|
5
|
-
<h1 class="hero-title">{{ site.title }}</h1>
|
|
6
|
-
<p class="hero-description">{{ site.description }}</p>
|
|
7
|
-
</section>
|
|
4
|
+
{% include "hero.njk" %}
|
|
8
5
|
|
|
9
6
|
<section class="section">
|
|
10
7
|
<div class="section-header">
|
|
@@ -47,7 +44,7 @@
|
|
|
47
44
|
<div class="notes-grid">
|
|
48
45
|
{% for note in collections.notes | limit(3) %}
|
|
49
46
|
<article class="note-card">
|
|
50
|
-
<div class="note-card-content">{{ note.
|
|
47
|
+
<div class="note-card-content">{{ note.excerptHtml | safe }}</div>
|
|
51
48
|
<footer class="note-card-footer">
|
|
52
49
|
<time datetime="{{ note.date | date('iso') }}">{{ note.date | date('full_time') }}</time>
|
|
53
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">
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
{% extends "base.njk" %}
|
|
2
2
|
|
|
3
3
|
{% block content %}
|
|
4
|
-
|
|
5
|
-
<h1 class="hero-title">{{ site.title }}</h1>
|
|
6
|
-
<p class="hero-description">{{ site.description }}</p>
|
|
7
|
-
</section>
|
|
4
|
+
{% include "hero.njk" %}
|
|
8
5
|
|
|
9
6
|
<section class="section">
|
|
10
7
|
<div class="section-header">
|
|
@@ -47,7 +44,7 @@
|
|
|
47
44
|
<div class="notes-grid">
|
|
48
45
|
{% for note in collections.notes | limit(3) %}
|
|
49
46
|
<article class="note-card">
|
|
50
|
-
<div class="note-card-content">{{ note.
|
|
47
|
+
<div class="note-card-content">{{ note.excerptHtml | safe }}</div>
|
|
51
48
|
<footer class="note-card-footer">
|
|
52
49
|
<time datetime="{{ note.date | date('iso') }}">{{ note.date | date('full_time') }}</time>
|
|
53
50
|
<a href="{{ note.url }}" class="note-card-link">View →</a>
|