create-spark-html-app 0.11.0 → 0.11.1

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": "create-spark-html-app",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "Scaffold a spark-html app — dev/build/preview on Bun",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,11 +1,12 @@
1
- <!-- Pure UI — no <script>. Props (blog, active) come from whichever page
2
- imports it, rendered on the server and again after client mount. -->
1
+ <!-- Pure UI — no <script>. Props (blog, path) come from the layout; `path`
2
+ is ambient page scope (the current request path), so the highlight is
3
+ right on the server render and after client mount alike. -->
3
4
  <nav class="nav">
4
5
  <a class="brand" href="/">⚡ {blog}</a>
5
6
  <span class="links">
6
- <a href="/" :class="active === 'home' ? 'on' : ''">Posts</a>
7
- <a href="/about" :class="active === 'about' ? 'on' : ''">About</a>
8
- <a href="/admin" :class="active === 'admin' ? 'on' : ''">Manage</a>
7
+ <a href="/" :class="path === '/' ? 'on' : ''">Posts</a>
8
+ <a href="/about" :class="path === '/about' ? 'on' : ''">About</a>
9
+ <a href="/admin" :class="path.startsWith('/admin') ? 'on' : ''">Manage</a>
9
10
  <span import="/components/theme-toggle"></span>
10
11
  </span>
11
12
  </nav>
@@ -5,7 +5,7 @@
5
5
  <link rel="stylesheet" href="/style.css">
6
6
  <script type="module" src="/app.js"></script>
7
7
 
8
- <div import="/components/nav" blog="{author.name}"></div>
8
+ <div import="/components/nav" blog="{author.name}" path="{path}"></div>
9
9
 
10
10
  <slot></slot>
11
11