stack-site-builder 1.21.0 → 1.22.0

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/CHANGELOG.md CHANGED
@@ -11,6 +11,19 @@ content schema, while a consuming site supplies only content, taxonomy data and
11
11
  config. Sites track the theme with `pnpm up stack-site-builder`, so each release
12
12
  here is a plain version bump they pull in.
13
13
 
14
+ ## [1.22.0] - 2026-07-25
15
+
16
+ ### Added
17
+
18
+ - **Cards-home catalog Browse nav** — `home.browse = { href, label?, external? }`:
19
+ on a cards home the stacks catalog Browse nav is hidden (it anchors into the
20
+ catalog home's `#categories` section, which a cards home doesn't have). Set
21
+ `home.browse` to add a header nav item (the same grid icon) that links to a
22
+ separate catalog page instead — e.g. a category browse at `/categories/tools/`.
23
+ `href` is a locale-less internal path (prefixed per locale) or an external URL;
24
+ `label` falls back to the theme's "Browse" string. The catalog home is
25
+ unaffected — it keeps its built-in `#categories` Browse.
26
+
14
27
  ## [1.21.0] - 2026-07-24
15
28
 
16
29
  ### Added
package/README.md CHANGED
@@ -165,7 +165,20 @@ home: {
165
165
 
166
166
  Localized values are either one string or a per-locale record with
167
167
  default-locale fallback. On a cards home the header's Browse link (which
168
- anchors into the catalog) hides itself.
168
+ anchors into the catalog home's `#categories` section) hides itself — set
169
+ `home.browse` to add it back, pointing at a separate catalog page instead:
170
+
171
+ ```ts
172
+ home: {
173
+ template: 'cards',
174
+ // …
175
+ // Header nav item (grid icon) → a standalone catalog page. Use this when the
176
+ // catalog lives at a category browse rather than on the home. `href` is a
177
+ // locale-less internal path (or an external URL with `external: true`);
178
+ // `label` defaults to the theme's "Browse" string.
179
+ browse: { href: '/categories/tools/', label: { ko: '사용 도구', en: 'Tools' } },
180
+ },
181
+ ```
169
182
 
170
183
  ## Papers (opt-in)
171
184
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "stack-site-builder",
3
3
  "type": "module",
4
- "version": "1.21.0",
4
+ "version": "1.22.0",
5
5
  "license": "MIT",
6
6
  "description": "The engine behind the awesome-*-stack catalog sites: an Astro theme with the catalog/concepts/articles/slides/samples routes, components, styles and markdown pipeline. Sites provide content, taxonomy data and config.",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/CodeCompose7/stack-site-builder.git"
9
+ "url": "git+https://github.com/CodeComposeStudio/stack-site-builder.git"
10
10
  },
11
11
  "files": [
12
12
  "index.mjs",
@@ -12,7 +12,7 @@ import BackToTop from '../components/BackToTop.astro';
12
12
  import Footer from '@aas-footer';
13
13
  import { getNavPages, pageSlugOf } from '../lib/pages';
14
14
  import { getNavProducts, getTopProducts, productSlugOf } from '../lib/products';
15
- import { homeTemplate } from '../lib/home';
15
+ import { homeTemplate, home as homeConfig, loc } from '../lib/home';
16
16
  import { sectionEnabled, type SectionKey } from '../lib/sections';
17
17
  import { siteIcons } from '../lib/icons';
18
18
  import { privateClientData } from '../lib/private';
@@ -84,6 +84,10 @@ const showRepoLink =
84
84
  // layouts never drift: an icon-only row (≥sm) and a labelled dropdown menu
85
85
  // (<sm, so a phone header stays to a few controls instead of a long icon run).
86
86
  // `svg` is the icon's inner markup (drawn into a shared <svg> shell below).
87
+ // Shared 2×2 grid icon for the catalog Browse nav (catalog home + cards-home
88
+ // `home.browse`).
89
+ const CATALOG_ICON =
90
+ '<rect width="7" height="7" x="3" y="3" rx="1"/><rect width="7" height="7" x="14" y="3" rx="1"/><rect width="7" height="7" x="14" y="14" rx="1"/><rect width="7" height="7" x="3" y="14" rx="1"/>';
87
91
  const allNavItems: {
88
92
  href: string;
89
93
  label: string;
@@ -92,18 +96,30 @@ const allNavItems: {
92
96
  keepFilters?: boolean;
93
97
  section?: SectionKey;
94
98
  }[] = [
95
- // Browse anchors into the catalog home's category sections it only makes
96
- // sense when the site keeps the catalog home template.
99
+ // Browse (grid icon): on the catalog home it anchors into the #categories
100
+ // section; on a cards home it's off unless the site sets `home.browse` to
101
+ // point at a separate catalog page (e.g. a category browse).
97
102
  ...(homeTemplate === 'catalog'
98
103
  ? [
99
104
  {
100
105
  href: `${home}#categories`,
101
106
  label: t('nav.browse'),
102
107
  keepFilters: true,
103
- svg: '<rect width="7" height="7" x="3" y="3" rx="1"/><rect width="7" height="7" x="14" y="3" rx="1"/><rect width="7" height="7" x="14" y="14" rx="1"/><rect width="7" height="7" x="3" y="14" rx="1"/>',
108
+ svg: CATALOG_ICON,
104
109
  },
105
110
  ]
106
- : []),
111
+ : homeConfig?.browse
112
+ ? [
113
+ {
114
+ href: homeConfig.browse.external
115
+ ? homeConfig.browse.href
116
+ : getRelativeLocaleUrl(lang, homeConfig.browse.href.replace(/^\//, '')),
117
+ label: loc(homeConfig.browse.label, lang) ?? t('nav.browse'),
118
+ external: homeConfig.browse.external,
119
+ svg: CATALOG_ICON,
120
+ },
121
+ ]
122
+ : []),
107
123
  ...(hasProducts
108
124
  ? [
109
125
  {
package/src/lib/home.ts CHANGED
@@ -45,6 +45,15 @@ export interface HomeConfig {
45
45
  description?: Localized;
46
46
  button?: { label: Localized; href: string; external?: boolean };
47
47
  };
48
+ /** Catalog "Browse" nav link for the cards home. The stacks catalog Browse
49
+ * nav anchors into the catalog home's #categories section, so it's hidden on
50
+ * a cards home — set this to add a header nav item that points at a separate
51
+ * catalog page instead (e.g. a category browse at `/categories/tools/`, or a
52
+ * tag/vendor page). `href` is a locale-less internal path (prefixed per
53
+ * locale at render) or an external URL (`external: true`); `label` defaults
54
+ * to the theme's "Browse" string. Ignored on the catalog home, which keeps
55
+ * its built-in #categories Browse. */
56
+ browse?: { href: string; label?: Localized; external?: boolean };
48
57
  }
49
58
 
50
59
  export const home: HomeConfig | undefined = (site as { home?: HomeConfig }).home;