@janga/norna 0.7.0 → 0.7.2

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 (63) hide show
  1. package/README.md +18 -4
  2. package/astro.config.mjs +2 -0
  3. package/bin/norna-cli.mjs +170 -0
  4. package/bin/norna.mjs +149 -150
  5. package/docs/README.md +36 -16
  6. package/docs/commands.md +18 -5
  7. package/docs/configuration.md +37 -2
  8. package/docs/content.md +98 -257
  9. package/docs/{command-organization.md → design/command-organization.md} +9 -5
  10. package/docs/{site-examples-structure-note.md → design/site-examples-structure.md} +17 -22
  11. package/docs/engine-development.md +33 -5
  12. package/docs/getting-started.md +40 -4
  13. package/docs/local-development.md +13 -0
  14. package/docs/publishing.md +23 -0
  15. package/docs/routes.md +90 -0
  16. package/docs/site-structure.md +15 -8
  17. package/docs/theme.md +150 -0
  18. package/docs/typography.md +125 -0
  19. package/examples/dog-gallery/site/.norna/generated-images.json +226 -0
  20. package/examples/dog-gallery/site/config.mjs +97 -0
  21. package/examples/dog-gallery/site/content.md +146 -0
  22. package/examples/dog-gallery/site/images/black-dogs/black-puppy-meadow.png +0 -0
  23. package/examples/dog-gallery/site/images/black-dogs/photo-of-a-black-dog.jpg +0 -0
  24. package/examples/dog-gallery/site/images/brown-dogs/brown-dog.jpg +0 -0
  25. package/examples/dog-gallery/site/images/brown-dogs/dog-accompanies-master.jpg +0 -0
  26. package/examples/dog-gallery/site/images/golden-dogs/golden-retriever.jpg +0 -0
  27. package/examples/dog-gallery/site/images/golden-dogs/toller-puppy.jpg +0 -0
  28. package/examples/dog-gallery/site/images/white-dogs/white-cute-dog.jpg +0 -0
  29. package/examples/dog-gallery/site/images/white-dogs/white-puppy-garden.png +0 -0
  30. package/examples/dog-gallery/site/public/favicon.svg +7 -0
  31. package/examples/dog-gallery/site/public/robots.txt +2 -0
  32. package/examples/dog-gallery/site/routes/dog-care/route-content.md +35 -0
  33. package/examples/dog-gallery/site/theme.md +55 -0
  34. package/fixtures/basic/site/config.mjs +1 -0
  35. package/package.json +8 -7
  36. package/scripts/check-config.mjs +1 -0
  37. package/scripts/dev-local.mjs +64 -15
  38. package/scripts/init-site.mjs +1 -1
  39. package/scripts/lib/project-config.mjs +22 -0
  40. package/scripts/lib/site-content.mjs +2 -1
  41. package/scripts/lib/site-paths.mjs +18 -3
  42. package/scripts/lib/typography.mjs +5 -5
  43. package/scripts/show-typography.mjs +252 -29
  44. package/scripts/test-cli-discovery.mjs +124 -0
  45. package/scripts/test-engine-commands.mjs +18 -4
  46. package/scripts/test-navigation.mjs +10 -6
  47. package/scripts/test-package-check.mjs +32 -4
  48. package/src/components/SiteNavigation.astro +7 -5
  49. package/src/components/SitePage.astro +3 -0
  50. package/src/components/SiteSection.astro +24 -24
  51. package/src/content.config.ts +4 -0
  52. package/src/layouts/BaseLayout.astro +2 -1
  53. package/src/lib/basePath.ts +21 -0
  54. package/src/lib/generatedImages.ts +8 -4
  55. package/src/lib/sectionContent.ts +6 -1
  56. package/src/lib/sitePublicAssets.ts +8 -1
  57. package/src/styles/global.css +8 -8
  58. package/starters/basic/.github/workflows/deploy.yml +3 -3
  59. package/starters/basic/README.md +21 -0
  60. package/starters/basic/package.json +1 -1
  61. package/starters/basic/site/config.mjs +1 -0
  62. package/starters/basic/site/content.md +5 -3
  63. package/starters/basic/site/theme.md +4 -0
@@ -342,7 +342,7 @@ h1,
342
342
  h2 {
343
343
  margin-bottom: 0;
344
344
  color: inherit;
345
- font-size: var(--section-heading-font-size-desktop, clamp(1.4rem, 3.1vw, 3.2rem));
345
+ font-size: var(--section-heading-font-size-desktop, clamp(1.35rem, 1.1rem + 0.9vw, 2rem));
346
346
  font-weight: 400;
347
347
  letter-spacing: 0;
348
348
  line-height: var(--section-heading-line-height, 1.04);
@@ -351,7 +351,7 @@ h2 {
351
351
  }
352
352
 
353
353
  .site-section-primary h1 {
354
- font-size: var(--section-heading-font-size-desktop, clamp(1.65rem, 4.6vw, 5.65rem));
354
+ font-size: var(--section-heading-font-size-desktop, clamp(1.6rem, 1.22rem + 1.45vw, 2.75rem));
355
355
  font-weight: 700;
356
356
  }
357
357
 
@@ -360,13 +360,13 @@ h2 {
360
360
  margin: 0 auto;
361
361
  color: inherit;
362
362
  font-family: var(--font-sans);
363
- font-size: clamp(1rem, 0.96rem + 0.18vw, 1.125rem);
363
+ font-size: clamp(0.96rem, 0.94rem + 0.08vw, 1rem);
364
364
  }
365
365
 
366
366
  .section-markdown {
367
367
  width: min(100%, var(--section-body-width-desktop, var(--text-width)));
368
368
  margin: 0 auto var(--space-section-body-to-gallery);
369
- font-size: var(--section-body-font-size-desktop, clamp(1rem, 0.96rem + 0.18vw, 1.125rem));
369
+ font-size: var(--section-body-font-size-desktop, clamp(0.96rem, 0.94rem + 0.08vw, 1rem));
370
370
  line-height: var(--section-body-line-height, 1.78);
371
371
  text-align: var(--section-body-align-desktop, center);
372
372
  }
@@ -402,7 +402,7 @@ h2 {
402
402
  .section-markdown h4 {
403
403
  margin: 0 0 0.85rem;
404
404
  color: inherit;
405
- font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.08rem);
405
+ font-size: clamp(0.96rem, 0.94rem + 0.08vw, 1rem);
406
406
  font-weight: 400;
407
407
  letter-spacing: 0.02em;
408
408
  line-height: 1.5;
@@ -784,14 +784,14 @@ h2 {
784
784
  h2 {
785
785
  font-size: var(
786
786
  --section-heading-font-size-mobile,
787
- var(--section-heading-font-size-desktop, clamp(1.4rem, 3.1vw, 3.2rem))
787
+ var(--section-heading-font-size-desktop, clamp(1.3rem, 1.05rem + 1.35vw, 1.75rem))
788
788
  );
789
789
  }
790
790
 
791
791
  .site-section-primary h1 {
792
792
  font-size: var(
793
793
  --section-heading-font-size-mobile,
794
- var(--section-heading-font-size-desktop, clamp(1.9rem, 8vw, 3.2rem))
794
+ var(--section-heading-font-size-desktop, clamp(1.5rem, 1.12rem + 2vw, 2.25rem))
795
795
  );
796
796
  }
797
797
 
@@ -804,7 +804,7 @@ h2 {
804
804
  width: min(100%, var(--section-body-width-mobile, var(--section-body-width-desktop, var(--text-width))));
805
805
  font-size: var(
806
806
  --section-body-font-size-mobile,
807
- var(--section-body-font-size-desktop, clamp(1rem, 0.96rem + 0.18vw, 1.125rem))
807
+ var(--section-body-font-size-desktop, clamp(0.96rem, 0.94rem + 0.08vw, 1rem))
808
808
  );
809
809
  text-align: var(--section-body-align-mobile, var(--section-body-align-desktop, left));
810
810
  }
@@ -34,10 +34,10 @@ jobs:
34
34
  - name: Restore generated images
35
35
  uses: actions/cache@v4
36
36
  with:
37
- path: site/.cli-gallery/public/images/generated
38
- key: cli-gallery-images-${{ hashFiles('site/.cli-gallery/generated-images.json') }}
37
+ path: site/.norna/public/images/generated
38
+ key: norna-images-${{ hashFiles('site/.norna/generated-images.json') }}
39
39
  restore-keys: |
40
- cli-gallery-images-
40
+ norna-images-
41
41
 
42
42
  - name: Install dependencies
43
43
  run: npm ci
@@ -9,11 +9,29 @@ npm install
9
9
  npm run norna:dev
10
10
  ```
11
11
 
12
+ If the standard local port is blocked, start with:
13
+
14
+ ```sh
15
+ npm run dev -- --kill
16
+ ```
17
+
12
18
  Edit site-wide theme defaults in `site/theme.md`, homepage content and section
13
19
  overrides in `site/content.md`, technical settings such as URL, layout, font,
14
20
  and locale labels in `site/config.mjs`, source images under
15
21
  `site/images/<section-id>/`, and static public files under `site/public/`.
16
22
 
23
+ Use `site.basePath: '/'` for a custom domain or root-hosted site. For a GitHub
24
+ Pages project site without a custom domain, set both values:
25
+
26
+ ```js
27
+ site: {
28
+ url: 'https://owner.github.io/repository-name/',
29
+ basePath: '/repository-name/',
30
+ }
31
+ ```
32
+
33
+ In GitHub repository settings, configure Pages to build from GitHub Actions.
34
+
17
35
  The page width is configured with `layout.pageWidth`; gallery width is
18
36
  configured with `gallery.width`. Side margins are configured with
19
37
  `layout.gutter`; image height is limited with
@@ -49,6 +67,9 @@ Generic documentation lives in the `norna` repository:
49
67
  - `docs/getting-started.md`
50
68
  - `docs/site-structure.md`
51
69
  - `docs/content.md`
70
+ - `docs/theme.md`
71
+ - `docs/typography.md`
72
+ - `docs/routes.md`
52
73
  - `docs/configuration.md`
53
74
  - `docs/commands.md`
54
75
  - `docs/images-and-metadata.md`
@@ -3,7 +3,7 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "scripts": {
6
- "dev": "npm run norna:dev",
6
+ "dev": "npm run norna:dev --",
7
7
  "norna:dev": "norna dev:local",
8
8
  "norna:dev:lan": "norna dev:lan",
9
9
  "norna:dev:restart": "norna dev:restart",
@@ -1,6 +1,7 @@
1
1
  export default {
2
2
  site: {
3
3
  url: 'https://example.com/',
4
+ basePath: '/',
4
5
  },
5
6
  layout: {
6
7
  pageWidth: '1180px',
@@ -9,12 +9,14 @@ sections:
9
9
  gallery: []
10
10
  - id: work
11
11
  gallery: []
12
-
13
12
  ---
13
+
14
14
  ## Intro {#intro}
15
15
 
16
- This is a minimal starter site for norna. Use
17
- [highlighted inline text]{.highlight} when a short phrase needs emphasis.
16
+ This is a minimal starter site for norna. Since this site doesn't have any
17
+ routes defined, the navigation menu will be a sticky bar with anchor links for
18
+ ease of use on phones etc. [Highlighted inline text]{.highlight} when a short
19
+ phrase needs emphasis
18
20
 
19
21
  ## Work {#work}
20
22
 
@@ -4,6 +4,8 @@
4
4
  # Active values below are ordinary YAML; this marked comment block is only help text.
5
5
  #
6
6
  # Available structure:
7
+ # navigation:
8
+ # brand: site-wide brand/home text; defaults to the homepage title
7
9
  # presentation:
8
10
  # backgroundColor: quoted hex color, e.g. "#000000"
9
11
  # textColor: quoted hex color, e.g. "#f7f4ee"
@@ -40,6 +42,8 @@
40
42
  # backgroundColor: quoted hex color
41
43
  # textColor: quoted hex color
42
44
  # norna:end theme-help
45
+ navigation:
46
+ brand: Example Gallery
43
47
  presentation:
44
48
  backgroundColor: "#000000"
45
49
  textColor: "#f7f4ee"