@janga/norna 0.7.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 (77) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +109 -0
  3. package/astro.config.mjs +17 -0
  4. package/bin/norna.mjs +170 -0
  5. package/docs/README.md +48 -0
  6. package/docs/command-organization.md +402 -0
  7. package/docs/commands.md +152 -0
  8. package/docs/configuration.md +376 -0
  9. package/docs/content.md +384 -0
  10. package/docs/engine-development.md +164 -0
  11. package/docs/getting-started.md +96 -0
  12. package/docs/images-and-metadata.md +88 -0
  13. package/docs/local-development.md +61 -0
  14. package/docs/publishing.md +81 -0
  15. package/docs/site-examples-structure-note.md +105 -0
  16. package/docs/site-structure.md +81 -0
  17. package/fixtures/basic/site/.norna/generated-images.json +1 -0
  18. package/fixtures/basic/site/config.mjs +59 -0
  19. package/fixtures/basic/site/content.md +17 -0
  20. package/fixtures/basic/site/images/work/.gitkeep +1 -0
  21. package/fixtures/basic/site/public/robots.txt +2 -0
  22. package/fixtures/basic/site/theme.md +7 -0
  23. package/package.json +90 -0
  24. package/scripts/build-site.mjs +16 -0
  25. package/scripts/check-config.mjs +37 -0
  26. package/scripts/deploy-site.mjs +389 -0
  27. package/scripts/dev-local.mjs +313 -0
  28. package/scripts/doctor.mjs +38 -0
  29. package/scripts/engine-version.mjs +137 -0
  30. package/scripts/generate-images.mjs +369 -0
  31. package/scripts/init-site.mjs +249 -0
  32. package/scripts/lib/astro-command.mjs +34 -0
  33. package/scripts/lib/ci-lockfile.mjs +34 -0
  34. package/scripts/lib/image-dimensions.mjs +78 -0
  35. package/scripts/lib/presentation.mjs +72 -0
  36. package/scripts/lib/project-config.mjs +322 -0
  37. package/scripts/lib/run-command.mjs +21 -0
  38. package/scripts/lib/site-content.mjs +392 -0
  39. package/scripts/lib/site-paths.mjs +127 -0
  40. package/scripts/lib/typography.mjs +166 -0
  41. package/scripts/release.mjs +77 -0
  42. package/scripts/show-typography.mjs +210 -0
  43. package/scripts/sync-content-sections.mjs +610 -0
  44. package/scripts/sync-site-public.mjs +42 -0
  45. package/scripts/test-ci-lockfile.mjs +65 -0
  46. package/scripts/test-content-check.mjs +364 -0
  47. package/scripts/test-engine-commands.mjs +128 -0
  48. package/scripts/test-navigation-preview.mjs +108 -0
  49. package/scripts/test-navigation.mjs +116 -0
  50. package/scripts/test-package-check.mjs +394 -0
  51. package/scripts/test-site-public.mjs +85 -0
  52. package/scripts/test-temporary-visibility.mjs +99 -0
  53. package/scripts/update-engine.mjs +127 -0
  54. package/scripts/watch-pages-deploy.mjs +430 -0
  55. package/src/components/GalleryGrid.astro +221 -0
  56. package/src/components/SiteNavigation.astro +410 -0
  57. package/src/components/SitePage.astro +69 -0
  58. package/src/components/SiteSection.astro +174 -0
  59. package/src/content.config.ts +171 -0
  60. package/src/layouts/BaseLayout.astro +90 -0
  61. package/src/lib/generatedImages.ts +63 -0
  62. package/src/lib/sectionContent.ts +125 -0
  63. package/src/lib/sitePages.ts +80 -0
  64. package/src/lib/sitePublicAssets.ts +39 -0
  65. package/src/lib/visibility.ts +35 -0
  66. package/src/pages/[slug].astro +31 -0
  67. package/src/pages/index.astro +16 -0
  68. package/src/styles/global.css +872 -0
  69. package/starters/basic/.github/workflows/deploy.yml +65 -0
  70. package/starters/basic/README.md +55 -0
  71. package/starters/basic/package.json +35 -0
  72. package/starters/basic/site/config.mjs +60 -0
  73. package/starters/basic/site/content.md +21 -0
  74. package/starters/basic/site/images/work/.gitkeep +1 -0
  75. package/starters/basic/site/public/robots.txt +2 -0
  76. package/starters/basic/site/theme.md +53 -0
  77. package/tsconfig.json +5 -0
@@ -0,0 +1,65 @@
1
+ name: Deploy to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+ pages: write
12
+ id-token: write
13
+
14
+ concurrency:
15
+ group: github-pages
16
+ cancel-in-progress: false
17
+
18
+ jobs:
19
+ build:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@v4
24
+
25
+ - name: Setup Node
26
+ uses: actions/setup-node@v4
27
+ with:
28
+ node-version: 24.18.0
29
+ cache: npm
30
+
31
+ - name: Install image tools
32
+ run: sudo apt-get update && sudo apt-get install -y imagemagick
33
+
34
+ - name: Restore generated images
35
+ uses: actions/cache@v4
36
+ with:
37
+ path: site/.cli-gallery/public/images/generated
38
+ key: cli-gallery-images-${{ hashFiles('site/.cli-gallery/generated-images.json') }}
39
+ restore-keys: |
40
+ cli-gallery-images-
41
+
42
+ - name: Install dependencies
43
+ run: npm ci
44
+
45
+ - name: Build
46
+ run: npm run build
47
+
48
+ - name: Configure Pages
49
+ uses: actions/configure-pages@v5
50
+
51
+ - name: Upload Pages artifact
52
+ uses: actions/upload-pages-artifact@v3
53
+ with:
54
+ path: dist
55
+
56
+ deploy:
57
+ needs: build
58
+ runs-on: ubuntu-latest
59
+ environment:
60
+ name: github-pages
61
+ url: ${{ steps.deployment.outputs.page_url }}
62
+ steps:
63
+ - name: Deploy to GitHub Pages
64
+ id: deployment
65
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,55 @@
1
+ # norna Starter
2
+
3
+ This is a minimal site repository starter for `@janga/norna`.
4
+
5
+ ## Setup
6
+
7
+ ```sh
8
+ npm install
9
+ npm run norna:dev
10
+ ```
11
+
12
+ Edit site-wide theme defaults in `site/theme.md`, homepage content and section
13
+ overrides in `site/content.md`, technical settings such as URL, layout, font,
14
+ and locale labels in `site/config.mjs`, source images under
15
+ `site/images/<section-id>/`, and static public files under `site/public/`.
16
+
17
+ The page width is configured with `layout.pageWidth`; gallery width is
18
+ configured with `gallery.width`. Side margins are configured with
19
+ `layout.gutter`; image height is limited with
20
+ `gallery.maxAvailableHeightPercent`.
21
+
22
+ The site font is configured with `typography.fontFamily` in `site/config.mjs`.
23
+ Site-wide text presentation is configured with typography presets and overrides
24
+ in `site/theme.md`; page and section overrides live in `site/content.md`.
25
+
26
+ Commit `package-lock.json` after the first install so GitHub Actions can use
27
+ `npm ci`.
28
+
29
+ Use `norna:*` scripts for norna-specific work:
30
+
31
+ ```sh
32
+ npm run norna:content:check
33
+ npm run norna:sync
34
+ npm run norna:typography:presets
35
+ npm run norna:typography:show
36
+ npm run norna:build
37
+ ```
38
+
39
+ This keeps gallery commands separate from repository-specific build or
40
+ publishing commands in projects that embed a gallery inside a larger GitHub
41
+ project. This pure starter also keeps `npm run build` as an alias for
42
+ `npm run norna:build`.
43
+
44
+ Use `npm run norna:engine:version` to inspect the installed engine and
45
+ `npm run norna:engine:update` to update it.
46
+
47
+ Generic documentation lives in the `norna` repository:
48
+
49
+ - `docs/getting-started.md`
50
+ - `docs/site-structure.md`
51
+ - `docs/content.md`
52
+ - `docs/configuration.md`
53
+ - `docs/commands.md`
54
+ - `docs/images-and-metadata.md`
55
+ - `docs/publishing.md`
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "norna-site",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "npm run norna:dev",
7
+ "norna:dev": "norna dev:local",
8
+ "norna:dev:lan": "norna dev:lan",
9
+ "norna:dev:restart": "norna dev:restart",
10
+ "norna:dev:status": "norna dev:status",
11
+ "norna:dev:logs": "norna dev:logs",
12
+ "norna:dev:stop": "norna dev:stop",
13
+ "norna:check": "npm run norna:config:check && npm run norna:content:check",
14
+ "norna:config:check": "norna config:check",
15
+ "norna:content:check": "norna content:check",
16
+ "norna:sync": "norna content:sync",
17
+ "norna:typography:presets": "norna typography:presets",
18
+ "norna:typography:show": "norna typography:show",
19
+ "norna:public": "norna site:public",
20
+ "norna:images": "norna images",
21
+ "norna:build": "norna build",
22
+ "norna:build:local": "norna build:local",
23
+ "norna:deploy": "norna deploy",
24
+ "norna:deploy:commit": "norna deploy:commit",
25
+ "norna:deploy:watch": "norna deploy:watch",
26
+ "norna:doctor": "norna doctor",
27
+ "norna:preview": "norna preview",
28
+ "norna:engine:update": "norna engine:update",
29
+ "norna:engine:version": "norna engine:version",
30
+ "build": "npm run norna:build"
31
+ },
32
+ "dependencies": {
33
+ "@janga/norna": "0.1.16"
34
+ }
35
+ }
@@ -0,0 +1,60 @@
1
+ export default {
2
+ site: {
3
+ url: 'https://example.com/',
4
+ },
5
+ layout: {
6
+ pageWidth: '1180px',
7
+ gutter: {
8
+ desktop: 'clamp(1.25rem, 4vw, 3rem)',
9
+ mobile: '1rem',
10
+ },
11
+ },
12
+ gallery: {
13
+ width: '900px',
14
+ maxAvailableWidthPercent: {
15
+ desktop: 100,
16
+ mobile: 100,
17
+ },
18
+ maxAvailableHeightPercent: {
19
+ desktop: 74,
20
+ mobile: 68,
21
+ },
22
+ },
23
+ typography: {
24
+ fontFamily: "Arial, 'Helvetica Neue', Helvetica, sans-serif",
25
+ },
26
+ navigation: {
27
+ smoothScroll: {
28
+ enabled: true,
29
+ minimumDurationMs: 600,
30
+ maximumDurationMs: 1_200,
31
+ durationPerPixelMs: 0.2,
32
+ },
33
+ },
34
+ locale: {
35
+ lang: 'en',
36
+ labels: {
37
+ skipToContent: 'Skip to content',
38
+ sectionNavigation: 'Sections',
39
+ gallery: 'Gallery',
40
+ },
41
+ },
42
+ footer: {
43
+ copyrightMessage: '(c) Example Artist.',
44
+ buildInfo: {
45
+ enabled: true,
46
+ text: 'Built',
47
+ dateTimeFormat: {
48
+ locale: 'en-GB',
49
+ timeZone: 'UTC',
50
+ dateStyle: 'short',
51
+ timeStyle: 'short',
52
+ },
53
+ },
54
+ },
55
+ github: {
56
+ repo: 'owner/example-gallery',
57
+ branch: 'main',
58
+ pagesWorkflow: 'Deploy to GitHub Pages',
59
+ },
60
+ };
@@ -0,0 +1,21 @@
1
+ ---
2
+ title: Example Gallery
3
+ description: Minimal norna starter site.
4
+ sections:
5
+ - id: intro
6
+ presentation:
7
+ typography:
8
+ preset: statement
9
+ gallery: []
10
+ - id: work
11
+ gallery: []
12
+
13
+ ---
14
+ ## Intro {#intro}
15
+
16
+ This is a minimal starter site for norna. Use
17
+ [highlighted inline text]{.highlight} when a short phrase needs emphasis.
18
+
19
+ ## Work {#work}
20
+
21
+ Add gallery rows in frontmatter and matching source images under images/work/.
@@ -0,0 +1,2 @@
1
+ User-agent: *
2
+ Allow: /
@@ -0,0 +1,53 @@
1
+ ---
2
+ # norna:start theme-help
3
+ # Site-wide visual defaults. Remove a value to use the engine default.
4
+ # Active values below are ordinary YAML; this marked comment block is only help text.
5
+ #
6
+ # Available structure:
7
+ # presentation:
8
+ # backgroundColor: quoted hex color, e.g. "#000000"
9
+ # textColor: quoted hex color, e.g. "#f7f4ee"
10
+ # inlineStyles:
11
+ # style-name:
12
+ # color: quoted hex color
13
+ # typography:
14
+ # preset: quiet-gallery | compact-gallery | text-forward | statement
15
+ # overrides:
16
+ # heading:
17
+ # align:
18
+ # desktop: left | center | right
19
+ # mobile: left | center | right
20
+ # size: small | medium | large | xlarge
21
+ # lineHeight: number from 1 through 3
22
+ # spacing: CSS length, e.g. 0.65em
23
+ # body:
24
+ # align:
25
+ # desktop: left | center | right
26
+ # mobile: left | center | right
27
+ # size: small | medium | large | xlarge
28
+ # lineHeight: number from 1 through 3
29
+ # paragraphSpacing: CSS length, e.g. 0.85em
30
+ # caption:
31
+ # align:
32
+ # desktop: left | center | right
33
+ # mobile: left | center | right
34
+ # size: small | medium | large | xlarge
35
+ # lineHeight: number from 1 through 3
36
+ # spacing: CSS length, e.g. 0.5em
37
+ # frame:
38
+ # colors: presentation | theme
39
+ # colors:
40
+ # backgroundColor: quoted hex color
41
+ # textColor: quoted hex color
42
+ # norna:end theme-help
43
+ presentation:
44
+ backgroundColor: "#000000"
45
+ textColor: "#f7f4ee"
46
+ inlineStyles:
47
+ highlight:
48
+ color: "#ffd84d"
49
+ typography:
50
+ preset: quiet-gallery
51
+ frame:
52
+ colors: presentation
53
+ ---
package/tsconfig.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "astro/tsconfigs/strict",
3
+ "include": [".astro/types.d.ts", "**/*"],
4
+ "exclude": ["dist"]
5
+ }