@nera-static/nera 1.15.0 → 1.16.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/README.md +1 -1
- package/package.json +1 -1
- package/skills/nera/recipes/business-site.md +7 -4
- package/src/scaffold.js +8 -0
- package/template/AGENTS.md +6 -6
- package/template/config/app.yaml +3 -0
- package/template/pages/imprint.md +21 -0
- package/template/pages/privacy.md +23 -0
- package/template/theme/views/layouts/layout.pug +8 -0
- package/template/theme/views/pages/default.pug +1 -1
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ and its scripts call the CLI:
|
|
|
45
45
|
"dev": "nera dev", "build": "nera build", "serve": "nera serve",
|
|
46
46
|
"validate": "nera validate", "check": "nera build --check"
|
|
47
47
|
},
|
|
48
|
-
"dependencies": { "@nera-static/nera": "^1.
|
|
48
|
+
"dependencies": { "@nera-static/nera": "^1.16.0" }
|
|
49
49
|
}
|
|
50
50
|
```
|
|
51
51
|
|
package/package.json
CHANGED
|
@@ -11,12 +11,15 @@ imprint and privacy, with a menu on every page.
|
|
|
11
11
|
live URL, e.g. `https://example.com`) once the domain is known.
|
|
12
12
|
3. Write one Markdown page per topic, each with `layout: pages/default.pug`,
|
|
13
13
|
a `title` and a `description`: `pages/index.md`, `pages/about.md`,
|
|
14
|
-
`pages/services.md`, `pages/opening-hours.md`, `pages/contact.md
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
`pages/services.md`, `pages/opening-hours.md`, `pages/contact.md`.
|
|
15
|
+
Opening hours fit a Markdown table. A new site already has
|
|
16
|
+
`pages/imprint.md` and `pages/privacy.md` as placeholders, linked from
|
|
17
|
+
the layout's footer: replace their text, or write them if they are
|
|
18
|
+
missing.
|
|
17
19
|
4. Menu: `npm install @nera-static/plugin-navigation`, list the pages in
|
|
18
20
|
`config/navigation.yaml` (`href` ending in `.html`, `name`; groups such
|
|
19
|
-
as `main:` and `footer
|
|
21
|
+
as `main:` and `footer:`; a footer menu replaces the layout's own
|
|
22
|
+
imprint and privacy links, so keep only one of the two), run
|
|
20
23
|
`npx nera-navigation` and include a menu in
|
|
21
24
|
`theme/views/layouts/layout.pug` (see the plugin README for the mixins).
|
|
22
25
|
5. Contact form: follow [contact-form](contact-form.md).
|
package/src/scaffold.js
CHANGED
|
@@ -197,6 +197,14 @@ async function applyTheme(targetDir, theme) {
|
|
|
197
197
|
await fs.writeFile(pkgPath, `${JSON.stringify(pkg, null, 4)}\n`)
|
|
198
198
|
}
|
|
199
199
|
console.log(` ✓ Using theme "${theme}"${pkgName ? ` (${pkgName})` : ''}`)
|
|
200
|
+
// The scaffold's footer, which links the imprint and privacy
|
|
201
|
+
// placeholders, is a starter template and so left out with a theme.
|
|
202
|
+
console.log(
|
|
203
|
+
' • pages/imprint.md and pages/privacy.md are placeholders: link them ' +
|
|
204
|
+
'from the theme\'s layout (theme-blog and theme-business take ' +
|
|
205
|
+
'`footer_links` in config/theme.yaml), or `nera build --check` ' +
|
|
206
|
+
'keeps warning legal-imprint-link and legal-privacy-link.'
|
|
207
|
+
)
|
|
200
208
|
}
|
|
201
209
|
|
|
202
210
|
// `--name`: any non-empty text without line breaks. It is written as a JSON
|
package/template/AGENTS.md
CHANGED
|
@@ -61,10 +61,9 @@ finds pages the build would skip silently. Run it first.
|
|
|
61
61
|
says nothing; `nera validate` warns (`layout-missing`). Renaming or deleting
|
|
62
62
|
a layout breaks every page that uses it.
|
|
63
63
|
- **The page body.** The rendered Markdown reaches the template as `content`.
|
|
64
|
-
Without a theme, `theme/views/pages/default.pug` prints it
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
layout and the page template before adding one.
|
|
64
|
+
Without a theme, `theme/views/pages/default.pug` prints it in a `main`
|
|
65
|
+
element inside `block content`; with a theme, the theme's layout may hold
|
|
66
|
+
the `<main>`. A page has exactly one `<main>`: check before adding one.
|
|
68
67
|
- **`public/` is wiped on every build.** Put source files in `pages/`,
|
|
69
68
|
`theme/` or `config/`; anything written into `public/` by hand is lost.
|
|
70
69
|
- **Site files override theme files.** If `config/app.yaml` sets `theme:`,
|
|
@@ -114,8 +113,9 @@ the URL.
|
|
|
114
113
|
|
|
115
114
|
## Getting online
|
|
116
115
|
|
|
117
|
-
`npm run build` writes the
|
|
118
|
-
|
|
116
|
+
`npm run build` writes the site into `public/`: upload its contents to any
|
|
117
|
+
static web host. Replace the imprint and privacy placeholders in `pages/`
|
|
118
|
+
first, if any; `legal-*` warnings are expected until they are filled and linked.
|
|
119
119
|
|
|
120
120
|
<!-- nera:site-notes — everything below this line belongs to the site owner; `nera update` keeps it as it is -->
|
|
121
121
|
## Notes for this site
|
package/template/config/app.yaml
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: pages/default.pug
|
|
3
|
+
title: Imprint
|
|
4
|
+
description: Imprint placeholder — replace it with your own legal notice
|
|
5
|
+
---
|
|
6
|
+
# Imprint
|
|
7
|
+
|
|
8
|
+
**This is a placeholder.** It is not a legal notice. Replace this page with your
|
|
9
|
+
own imprint before you publish the site; if you are unsure what you need, ask a
|
|
10
|
+
lawyer.
|
|
11
|
+
|
|
12
|
+
## To do
|
|
13
|
+
|
|
14
|
+
What an imprint typically names (the exact duty depends on your country and on
|
|
15
|
+
what the site does):
|
|
16
|
+
|
|
17
|
+
- who runs the site: full name, or company name and legal form
|
|
18
|
+
- a postal address where you can be reached
|
|
19
|
+
- fast ways to contact you: email address, and often a phone number
|
|
20
|
+
- the person responsible for the content, if the law asks for one
|
|
21
|
+
- register entries and VAT ID, if your business has them
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: pages/default.pug
|
|
3
|
+
title: Privacy
|
|
4
|
+
description: Privacy policy placeholder — replace it with your own privacy policy
|
|
5
|
+
---
|
|
6
|
+
# Privacy
|
|
7
|
+
|
|
8
|
+
**This is a placeholder.** It is not a privacy policy. Replace this page with
|
|
9
|
+
your own privacy policy before you publish the site; if you are unsure what you
|
|
10
|
+
need, ask a lawyer.
|
|
11
|
+
|
|
12
|
+
## To do
|
|
13
|
+
|
|
14
|
+
What a privacy policy typically covers (the exact duty depends on your country
|
|
15
|
+
and on what the site does):
|
|
16
|
+
|
|
17
|
+
- who is responsible for the data processing, and how to contact them
|
|
18
|
+
- what your hosting provider logs (such as IP addresses) and for how long
|
|
19
|
+
- every plugin, form, font, embed or analytics tool that processes visitor
|
|
20
|
+
data, its purpose and legal basis
|
|
21
|
+
- how long data is kept
|
|
22
|
+
- the visitor's rights (access, correction, deletion, objection) and where to
|
|
23
|
+
complain
|
|
@@ -9,6 +9,14 @@ html(lang=app.lang)
|
|
|
9
9
|
meta(name="keywords", content=`${ meta.keywords || t('app_keywords') }`)
|
|
10
10
|
meta(name="generator" content="nera")
|
|
11
11
|
meta(name="robots" content=`${ meta.robots || app.robots }`)
|
|
12
|
+
style.
|
|
13
|
+
.skip-link { position: absolute; left: -9999px; }
|
|
14
|
+
.skip-link:focus { position: static; }
|
|
12
15
|
|
|
13
16
|
body
|
|
17
|
+
a.skip-link(href="#main") #{ t('skip_to_content') }
|
|
14
18
|
block content
|
|
19
|
+
footer
|
|
20
|
+
a(href="/imprint.html") #{ t('imprint') }
|
|
21
|
+
= ' · '
|
|
22
|
+
a(href="/privacy.html") #{ t('privacy') }
|