stack-site-builder 1.13.0 → 1.14.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +51 -0
  3. package/index.mjs +9 -0
  4. package/package.json +1 -1
  5. package/src/components/ArticleCard.astro +9 -3
  6. package/src/components/ArticleLink.astro +7 -2
  7. package/src/components/BlogIndex.astro +2 -0
  8. package/src/components/CategoryIndex.astro +2 -0
  9. package/src/components/CodeSamples.astro +6 -1
  10. package/src/components/ConceptCard.astro +9 -3
  11. package/src/components/ConceptIndex.astro +2 -0
  12. package/src/components/ConceptLink.astro +7 -2
  13. package/src/components/DeckView.astro +17 -2
  14. package/src/components/DetailTabs.astro +6 -1
  15. package/src/components/Home.astro +2 -0
  16. package/src/components/MermaidLoader.astro +3 -1
  17. package/src/components/PricingSection.astro +4 -1
  18. package/src/components/PrivateGate.astro +135 -0
  19. package/src/components/ProjectViewer.astro +24 -13
  20. package/src/components/SlidesIndex.astro +8 -2
  21. package/src/components/StackCard.astro +15 -3
  22. package/src/components/StackDetail.astro +9 -0
  23. package/src/components/TagIndex.astro +2 -0
  24. package/src/components/TocRail.astro +12 -6
  25. package/src/components/VendorIndex.astro +2 -0
  26. package/src/content.ts +21 -0
  27. package/src/i18n/ui.ts +14 -0
  28. package/src/layouts/BaseLayout.astro +10 -4
  29. package/src/lib/private-client.ts +160 -0
  30. package/src/lib/private.ts +129 -0
  31. package/src/lib/reinit.ts +12 -0
  32. package/src/pages/[...lang]/[page].astro +7 -2
  33. package/src/pages/[...lang]/article/[...id].astro +7 -2
  34. package/src/pages/[...lang]/concept/[...id].astro +7 -2
  35. package/src/pages/[...lang]/stack/[...id].astro +7 -2
@@ -4,6 +4,7 @@ import type { GetStaticPaths } from 'astro';
4
4
  import { getRelativeLocaleUrl } from 'astro:i18n';
5
5
  import BaseLayout from '../../../layouts/BaseLayout.astro';
6
6
  import StackDetail from '../../../components/StackDetail.astro';
7
+ import PrivateGate from '../../../components/PrivateGate.astro';
7
8
  import { getStacks, getStackAliases, slugOf, type StackEntry } from '../../../lib/stacks';
8
9
  import { allLocales, langParam } from '../../../lib/locales';
9
10
 
@@ -28,6 +29,7 @@ const { lang, entry, redirectTo } = Astro.props as {
28
29
  redirectTo: string | null;
29
30
  };
30
31
  const target = redirectTo ? getRelativeLocaleUrl(lang, `stack/${redirectTo}/`) : null;
32
+ const priv = entry?.data.private ?? false;
31
33
  ---
32
34
 
33
35
  {
@@ -48,11 +50,14 @@ const target = redirectTo ? getRelativeLocaleUrl(lang, `stack/${redirectTo}/`) :
48
50
  ) : (
49
51
  <BaseLayout
50
52
  title={`${entry!.data.name} — ${site.name}`}
51
- description={entry!.data.description}
53
+ description={priv ? entry!.data.teaser : entry!.data.description}
52
54
  lang={lang}
53
55
  path={`stack/${slugOf(entry!)}/`}
56
+ noindex={priv}
54
57
  >
55
- <StackDetail entry={entry!} lang={lang} />
58
+ <PrivateGate enabled={priv} lang={lang} title={entry!.data.name} teaser={entry!.data.teaser}>
59
+ <StackDetail entry={entry!} lang={lang} />
60
+ </PrivateGate>
56
61
  </BaseLayout>
57
62
  )
58
63
  }