@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terrymooreii/sia",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "description": "A simple, powerful static site generator with markdown, front matter, and Nunjucks templates",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
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: main # 'main' or 'minimal'
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):
@@ -0,0 +1,6 @@
1
+ {% if config.theme.showHero %}
2
+ <section class="hero-section">
3
+ <h1 class="hero-title">{{ site.title }}</h1>
4
+ <p class="hero-description">{{ site.description }}</p>
5
+ </section>
6
+ {% endif %}
@@ -2,10 +2,7 @@
2
2
 
3
3
  {% block content %}
4
4
  <div class="home-page">
5
- <section class="hero-section">
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.excerpt | excerpt(150) }}</div>
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 %}
@@ -0,0 +1,8 @@
1
+ {% if config.theme.showHero %}
2
+ <section class="hero">
3
+ <div class="hero-content">
4
+ <h1 class="hero-title">{{ site.title }}</h1>
5
+ <p class="hero-subtitle">{{ site.description }}</p>
6
+ </div>
7
+ </section>
8
+ {% endif %}
@@ -1,12 +1,7 @@
1
1
  {% extends "base.njk" %}
2
2
 
3
3
  {% block content %}
4
- <section class="hero">
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/sia/sia">Sia</a>.
5
+ Built with <a href="https://github.com/terrymooreii/sia">Sia</a>.
6
6
  </p>
7
7
 
8
8
  <nav class="footer-nav">
@@ -0,0 +1,6 @@
1
+ {% if config.theme.showHero %}
2
+ <section class="hero">
3
+ <h1 class="hero-title">{{ site.title }}</h1>
4
+ <p class="hero-description">{{ site.description }}</p>
5
+ </section>
6
+ {% endif %}
@@ -1,10 +1,7 @@
1
1
  {% extends "base.njk" %}
2
2
 
3
3
  {% block content %}
4
- <section class="hero">
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.excerpt }}</div>
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/sia/sia">Sia</a>.
5
+ Built with <a href="https://github.com/terrymooreii/sia">Sia</a>.
6
6
  </p>
7
7
 
8
8
  <nav class="footer-nav">
@@ -0,0 +1,6 @@
1
+ {% if config.theme.showHero %}
2
+ <section class="hero">
3
+ <h1 class="hero-title">{{ site.title }}</h1>
4
+ <p class="hero-description">{{ site.description }}</p>
5
+ </section>
6
+ {% endif %}
@@ -1,10 +1,7 @@
1
1
  {% extends "base.njk" %}
2
2
 
3
3
  {% block content %}
4
- <section class="hero">
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.excerpt }}</div>
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>