@geekity/cms 0.9.0 → 0.11.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/README.md +86 -24
- package/admin/components/admin-bar.njk +26 -0
- package/admin/components/fields.njk +55 -12
- package/admin/components/public-admin-bar.njk +41 -0
- package/admin/layouts/base.njk +6 -1
- package/admin/layouts/settings-page.njk +7 -2
- package/admin/layouts/shell.njk +9 -20
- package/admin/pages/account/forgot.njk +1 -1
- package/admin/pages/account/login.njk +1 -1
- package/admin/pages/account/reset.njk +4 -2
- package/admin/pages/account/setup.njk +1 -1
- package/admin/pages/dashboard/home.njk +1 -0
- package/admin/pages/documents/list.njk +1 -0
- package/admin/pages/documents/taxonomy.njk +1 -0
- package/admin/pages/federation/followers.njk +3 -0
- package/admin/pages/federation/settings.njk +5 -0
- package/admin/pages/media/library.njk +39 -0
- package/admin/pages/navigation/menus.njk +6 -1
- package/admin/pages/settings/discussion.njk +7 -0
- package/admin/pages/settings/email.njk +10 -0
- package/admin/pages/settings/general.njk +7 -0
- package/admin/pages/settings/permalinks.njk +6 -0
- package/admin/pages/settings/reading.njk +7 -0
- package/admin/pages/tools/content-index.njk +1 -0
- package/admin/pages/tools/personal-data.njk +5 -0
- package/admin/pages/users/edit.njk +7 -5
- package/admin/pages/users/list.njk +1 -0
- package/admin/pages/users/new.njk +5 -1
- package/admin/static/admin-bar.css +153 -0
- package/admin/static/admin.css +95 -96
- package/dist/admin/comments.js +2 -1
- package/dist/admin/comments.js.map +1 -1
- package/dist/admin/documents.d.ts.map +1 -1
- package/dist/admin/documents.js +18 -0
- package/dist/admin/documents.js.map +1 -1
- package/dist/admin/index.d.ts +1 -1
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/media.d.ts +13 -2
- package/dist/admin/media.d.ts.map +1 -1
- package/dist/admin/media.js +58 -3
- package/dist/admin/media.js.map +1 -1
- package/dist/admin/personal-data.d.ts.map +1 -1
- package/dist/admin/personal-data.js +5 -1
- package/dist/admin/personal-data.js.map +1 -1
- package/dist/admin/preview.d.ts.map +1 -1
- package/dist/admin/preview.js +1 -1
- package/dist/admin/preview.js.map +1 -1
- package/dist/admin/routes.d.ts.map +1 -1
- package/dist/admin/routes.js +2 -1
- package/dist/admin/routes.js.map +1 -1
- package/dist/admin/store.d.ts +36 -1
- package/dist/admin/store.d.ts.map +1 -1
- package/dist/admin/store.js +63 -1
- package/dist/admin/store.js.map +1 -1
- package/dist/admin/templates.d.ts +1 -0
- package/dist/admin/templates.d.ts.map +1 -1
- package/dist/admin/templates.js +1 -0
- package/dist/admin/templates.js.map +1 -1
- package/dist/admin/tools.d.ts +2 -0
- package/dist/admin/tools.d.ts.map +1 -1
- package/dist/admin/tools.js +3 -2
- package/dist/admin/tools.js.map +1 -1
- package/dist/admin/uploads.d.ts +5 -2
- package/dist/admin/uploads.d.ts.map +1 -1
- package/dist/admin/uploads.js +6 -2
- package/dist/admin/uploads.js.map +1 -1
- package/dist/comments/index.d.ts +2 -2
- package/dist/comments/index.d.ts.map +1 -1
- package/dist/comments/index.js +1 -1
- package/dist/comments/index.js.map +1 -1
- package/dist/comments/records.d.ts +43 -2
- package/dist/comments/records.d.ts.map +1 -1
- package/dist/comments/records.js +201 -54
- package/dist/comments/records.js.map +1 -1
- package/dist/comments/routes.js +1 -1
- package/dist/comments/routes.js.map +1 -1
- package/dist/comments/viewer.d.ts +13 -0
- package/dist/comments/viewer.d.ts.map +1 -1
- package/dist/comments/viewer.js +13 -1
- package/dist/comments/viewer.js.map +1 -1
- package/dist/config.d.ts +21 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/env.d.ts +19 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/federation/article.d.ts.map +1 -1
- package/dist/federation/article.js +37 -1
- package/dist/federation/article.js.map +1 -1
- package/dist/federation/delivery.d.ts +3 -1
- package/dist/federation/delivery.d.ts.map +1 -1
- package/dist/federation/delivery.js +6 -1
- package/dist/federation/delivery.js.map +1 -1
- package/dist/federation/federation.d.ts +3 -0
- package/dist/federation/federation.d.ts.map +1 -1
- package/dist/federation/federation.js.map +1 -1
- package/dist/federation/inbox.d.ts +7 -5
- package/dist/federation/inbox.d.ts.map +1 -1
- package/dist/federation/inbox.js +15 -32
- package/dist/federation/inbox.js.map +1 -1
- package/dist/federation/index.d.ts +2 -0
- package/dist/federation/index.d.ts.map +1 -1
- package/dist/federation/index.js +1 -0
- package/dist/federation/index.js.map +1 -1
- package/dist/federation/mount.js +6 -1
- package/dist/federation/mount.js.map +1 -1
- package/dist/federation/profiles.d.ts +95 -0
- package/dist/federation/profiles.d.ts.map +1 -0
- package/dist/federation/profiles.js +171 -0
- package/dist/federation/profiles.js.map +1 -0
- package/dist/federation/relays.d.ts +3 -1
- package/dist/federation/relays.d.ts.map +1 -1
- package/dist/federation/relays.js +6 -1
- package/dist/federation/relays.js.map +1 -1
- package/dist/federation/replies.d.ts +13 -4
- package/dist/federation/replies.d.ts.map +1 -1
- package/dist/federation/replies.js +25 -6
- package/dist/federation/replies.js.map +1 -1
- package/dist/images/alt-text.d.ts +51 -0
- package/dist/images/alt-text.d.ts.map +1 -0
- package/dist/images/alt-text.js +113 -0
- package/dist/images/alt-text.js.map +1 -0
- package/dist/images/icons.d.ts.map +1 -1
- package/dist/images/icons.js +3 -2
- package/dist/images/icons.js.map +1 -1
- package/dist/images/index.d.ts +2 -2
- package/dist/images/index.d.ts.map +1 -1
- package/dist/images/markup.d.ts +26 -4
- package/dist/images/markup.d.ts.map +1 -1
- package/dist/images/markup.js +36 -15
- package/dist/images/markup.js.map +1 -1
- package/dist/images/paths.d.ts +11 -0
- package/dist/images/paths.d.ts.map +1 -1
- package/dist/images/paths.js +17 -1
- package/dist/images/paths.js.map +1 -1
- package/dist/images/variants.d.ts +13 -3
- package/dist/images/variants.d.ts.map +1 -1
- package/dist/images/variants.js +13 -11
- package/dist/images/variants.js.map +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -11
- package/dist/index.js.map +1 -1
- package/dist/notifications/routes.js +1 -1
- package/dist/notifications/routes.js.map +1 -1
- package/dist/privacy/erase.d.ts.map +1 -1
- package/dist/privacy/erase.js +2 -3
- package/dist/privacy/erase.js.map +1 -1
- package/dist/privacy/retention.js +1 -1
- package/dist/privacy/retention.js.map +1 -1
- package/dist/web/admin-bar.d.ts +21 -0
- package/dist/web/admin-bar.d.ts.map +1 -0
- package/dist/web/admin-bar.js +145 -0
- package/dist/web/admin-bar.js.map +1 -0
- package/dist/web/assets.d.ts +29 -1
- package/dist/web/assets.d.ts.map +1 -1
- package/dist/web/assets.js +48 -3
- package/dist/web/assets.js.map +1 -1
- package/dist/web/compression.d.ts +19 -0
- package/dist/web/compression.d.ts.map +1 -0
- package/dist/web/compression.js +160 -0
- package/dist/web/compression.js.map +1 -0
- package/dist/web/context.d.ts +5 -1
- package/dist/web/context.d.ts.map +1 -1
- package/dist/web/context.js +5 -2
- package/dist/web/context.js.map +1 -1
- package/dist/web/conversation.d.ts.map +1 -1
- package/dist/web/conversation.js +13 -12
- package/dist/web/conversation.js.map +1 -1
- package/dist/web/render.d.ts +27 -0
- package/dist/web/render.d.ts.map +1 -1
- package/dist/web/render.js +77 -38
- package/dist/web/render.js.map +1 -1
- package/dist/web/routes.d.ts.map +1 -1
- package/dist/web/routes.js +63 -28
- package/dist/web/routes.js.map +1 -1
- package/dist/web/templates.d.ts.map +1 -1
- package/dist/web/templates.js +9 -2
- package/dist/web/templates.js.map +1 -1
- package/dist/webmention/service.d.ts.map +1 -1
- package/dist/webmention/service.js +5 -1
- package/dist/webmention/service.js.map +1 -1
- package/package.json +8 -8
- package/themes/default/README.md +176 -19
- package/themes/default/layouts/base.njk +51 -10
- package/themes/default/layouts/post.njk +10 -1
- package/themes/default/partials/comment-form.njk +33 -14
- package/themes/default/partials/contact-form.njk +32 -14
- package/themes/default/static/style.css +109 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/web/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/web/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,UAAU,CAAC;AAMzD,0EAA0E;AAC1E,MAAM,WAAW,gCAAgC;IAC/C;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAC1C,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,gCAAgC,GAAG,WAAW,CAahG;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAiBpF;AAED,kCAAkC;AAClC,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAmFxE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE,MAAyB,GAClC,MAAM,CAqBR"}
|
package/dist/web/templates.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Environment, FileSystemLoader } from 'nunjucks';
|
|
2
2
|
import { calendarDayIn, DEFAULT_TIMEZONE } from '../content/time.js';
|
|
3
|
+
import { themeAssetUrl } from './assets.js';
|
|
3
4
|
import { themeSearchPath } from './themes.js';
|
|
4
5
|
/**
|
|
5
6
|
* A Nunjucks environment whose loader searches the theme directories in the
|
|
@@ -19,7 +20,7 @@ export function createTemplateEnvironment(options) {
|
|
|
19
20
|
trimBlocks: true,
|
|
20
21
|
lstripBlocks: true,
|
|
21
22
|
});
|
|
22
|
-
return addFilters(environment, options.baseUrl);
|
|
23
|
+
return addFilters(environment, options.baseUrl, loader);
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* Point an environment at these theme directories for the renders that follow.
|
|
@@ -65,7 +66,7 @@ export function useThemeDirs(environment, dirs) {
|
|
|
65
66
|
* without a file changing. An Eleventy build of the same content applies the
|
|
66
67
|
* same lens with Luxon and `zone` read from `site.json`.
|
|
67
68
|
*/
|
|
68
|
-
function addFilters(environment, baseUrl) {
|
|
69
|
+
function addFilters(environment, baseUrl, loader) {
|
|
69
70
|
const base = new URL(baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`);
|
|
70
71
|
const basePath = base.pathname === '/' ? '' : base.pathname.replace(/\/$/, '');
|
|
71
72
|
environment.addFilter('date', function (value, format = 'readable', timezone) {
|
|
@@ -78,6 +79,12 @@ function addFilters(environment, baseUrl) {
|
|
|
78
79
|
return pathname.startsWith('/') ? `${basePath}${pathname}` : pathname;
|
|
79
80
|
};
|
|
80
81
|
environment.addFilter('url', withBasePath);
|
|
82
|
+
// A theme file's URL with a hash of its bytes in it, so it can be cached for
|
|
83
|
+
// a year. The directories are the loader's own, read on every call, so a
|
|
84
|
+
// theme switch through `useThemeDirs` moves assets and layouts together.
|
|
85
|
+
// The same cast as `useThemeDirs`, for the same undeclared field.
|
|
86
|
+
const searchPaths = loader;
|
|
87
|
+
environment.addFilter('asset', (value) => withBasePath(themeAssetUrl(typeof value === 'string' ? value : '', searchPaths.searchPaths)));
|
|
81
88
|
// A fully qualified URL, for canonical links, feeds and ActivityPub ids.
|
|
82
89
|
// The base path goes on first, because a root-relative URL resolved against
|
|
83
90
|
// an origin would otherwise throw the subdirectory away.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/web/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA+B9C;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAyC;IACjF,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,eAAe,EAAE,CAAC,CAAC,EAAE;QACjF,OAAO,EAAE,OAAO,CAAC,OAAO,KAAK,IAAI;KAClC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,MAAM,EAAE;QAC1C,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,IAAI;QACtC,gBAAgB,EAAE,KAAK;QACvB,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/web/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA+B9C;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAyC;IACjF,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,S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BAAgB,uBAAuB,CACrC,OAAO,EAAE,8BAA8B,GACtC,iBAAiB,CA0KnB"}
|
|
@@ -30,7 +30,11 @@ export function createWebmentionService(options) {
|
|
|
30
30
|
const { admin, store, config } = options;
|
|
31
31
|
const logger = options.logger ?? console;
|
|
32
32
|
/** The comment files an incoming webmention is written into. */
|
|
33
|
-
const records = {
|
|
33
|
+
const records = {
|
|
34
|
+
admin,
|
|
35
|
+
contentDir: config.contentDir,
|
|
36
|
+
dataDir: config.dataDir,
|
|
37
|
+
};
|
|
34
38
|
// Incoming checks run one after another too, and on a chain of their own: a
|
|
35
39
|
// page of this site's own that is slow to answer must not hold up the check
|
|
36
40
|
// on a webmention somebody is waiting to see appear.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/webmention/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAKxD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD;;;;;;;;;;;;;;;;;GAiBG;AAEH,oEAAoE;AACpE,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AAuEtC,iDAAiD;AACjD,MAAM,UAAU,uBAAuB,CACrC,OAAuC;IAEvC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACzC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC;IAEzC,gEAAgE;IAChE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C,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,MAAM;IACb,sEAAsE;IACtE,sDAAsD;AACxD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekity/cms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A file-first CMS: Markdown content, a SQLite index, a Hono server that is both the editor and the public site.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,27 +28,27 @@
|
|
|
28
28
|
"LICENSE"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@fedify/fedify": "^2.3.
|
|
32
|
-
"@fedify/hono": "^2.3.
|
|
33
|
-
"@fedify/vocab": "^2.3.
|
|
31
|
+
"@fedify/fedify": "^2.3.8",
|
|
32
|
+
"@fedify/hono": "^2.3.8",
|
|
33
|
+
"@fedify/vocab": "^2.3.8",
|
|
34
34
|
"@hono/node-server": "^2.1.1",
|
|
35
35
|
"@js-temporal/polyfill": "^0.5.1",
|
|
36
36
|
"chokidar": "^5.0.0",
|
|
37
37
|
"gray-matter": "^4.0.3",
|
|
38
|
-
"hono": "^4.13.
|
|
38
|
+
"hono": "^4.13.9",
|
|
39
39
|
"js-yaml": "^5.4.2",
|
|
40
40
|
"markdown-it": "^15.0.2",
|
|
41
41
|
"markdown-it-footnote": "^4.0.0",
|
|
42
|
-
"nodemailer": "^10.0.
|
|
42
|
+
"nodemailer": "^10.0.11",
|
|
43
43
|
"nunjucks": "^3.2.4",
|
|
44
44
|
"sharp": "^0.35.4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@11ty/eleventy": "^3.1.6",
|
|
48
48
|
"@codemirror/lang-markdown": "^6.5.2",
|
|
49
|
-
"@fedify/cli": "2.3.
|
|
49
|
+
"@fedify/cli": "2.3.8",
|
|
50
50
|
"@types/markdown-it-footnote": "^3.0.4",
|
|
51
|
-
"@types/node": "^26.6.
|
|
51
|
+
"@types/node": "^26.6.3",
|
|
52
52
|
"@types/nodemailer": "^8.0.2",
|
|
53
53
|
"@types/nunjucks": "^3.2.6",
|
|
54
54
|
"codemirror": "^6.0.2",
|
package/themes/default/README.md
CHANGED
|
@@ -93,7 +93,11 @@ reason rather than quietly left out.
|
|
|
93
93
|
Resolution order for any template is then that theme first, this directory
|
|
94
94
|
second, one file at a time. The theme above replaces the post layout and keeps
|
|
95
95
|
receiving updates to every other template, and `static/style.css` replaces the
|
|
96
|
-
stylesheet the same way — assets under `/theme/` resolve in the same order.
|
|
96
|
+
stylesheet the same way — assets under `/theme/` resolve in the same order.
|
|
97
|
+
Link a theme file with the `asset` filter rather than a literal `/theme/`
|
|
98
|
+
path: `{{ "style.css" | asset }}` puts a hash of the file in the URL, so a
|
|
99
|
+
reader's browser keeps it for a year and still fetches the new one the moment
|
|
100
|
+
it changes. The plain `/theme/style.css` keeps working, cached for an hour. A
|
|
97
101
|
site that has chosen no theme reads this one and nothing else, and a theme
|
|
98
102
|
sitting in `themes/` that the setting does not name is never on the path at
|
|
99
103
|
all. A `theme` naming a folder that is not there, or is not a theme, falls back
|
|
@@ -117,8 +121,9 @@ packaged ones by name:
|
|
|
117
121
|
{% endblock %}
|
|
118
122
|
```
|
|
119
123
|
|
|
120
|
-
`layouts/base.njk` defines the blocks `title`, `
|
|
121
|
-
`
|
|
124
|
+
`layouts/base.njk` defines the blocks `title`, `speculationRules`,
|
|
125
|
+
`viewTransitions`, `head`, `alternates`, `header`, `content`, `footer` and
|
|
126
|
+
`scripts`, so most sites never have to copy it.
|
|
122
127
|
|
|
123
128
|
Two layouts are named for the pages the Reading settings pick:
|
|
124
129
|
|
|
@@ -188,6 +193,71 @@ block:
|
|
|
188
193
|
{% endblock %}
|
|
189
194
|
```
|
|
190
195
|
|
|
196
|
+
### The admin bar
|
|
197
|
+
|
|
198
|
+
When somebody signed in to the admin reads the site, the CMS puts the admin bar
|
|
199
|
+
across the top of every HTML page: the site title linking to the dashboard,
|
|
200
|
+
**+ New**, **Edit Post** or **Edit Page** on a post or a page, and the account
|
|
201
|
+
menu. A theme draws none of it and needs no template for it. The CMS inserts a
|
|
202
|
+
`<geekity-admin-bar>` element straight after the page's `<body>` tag, and an
|
|
203
|
+
anonymous reader's page is unchanged, byte for byte.
|
|
204
|
+
|
|
205
|
+
The bar keeps its markup and its stylesheet in a shadow root, so a theme's CSS
|
|
206
|
+
cannot restyle it and its CSS cannot restyle the theme. The element carries an
|
|
207
|
+
inline style that resets it and fixes it to the top of the window, full width,
|
|
208
|
+
above the page. Padding or margins on `<body>`, and rules such as `body > *` or
|
|
209
|
+
a grid on `<body>`, do not move or resize it. It stays in place while the page
|
|
210
|
+
scrolls.
|
|
211
|
+
|
|
212
|
+
The bar takes no room by itself, so the CMS makes room for it from outside. On
|
|
213
|
+
a page that carries the bar:
|
|
214
|
+
|
|
215
|
+
- `<html>` has the class `geekity-admin-bar`.
|
|
216
|
+
- A stylesheet in `<head>` declares `--geekity-admin-bar-height` on `:root`
|
|
217
|
+
and sets `margin-top: var(--geekity-admin-bar-height) !important` on
|
|
218
|
+
`<html>`, which pushes the whole page down below the bar. The height is
|
|
219
|
+
40px, or 80px on a screen 600px wide or less, where the bar can wrap onto a
|
|
220
|
+
second line. A script in the bar then measures it and sets the real height
|
|
221
|
+
on `<html>`, so the push matches the bar at any width, and is 0 when a theme
|
|
222
|
+
hides the bar.
|
|
223
|
+
- The same stylesheet sets `scroll-padding-top` on `<html>` to the bar's
|
|
224
|
+
height, so a link to an anchor on the page, such as a skip link or a
|
|
225
|
+
footnote, scrolls its target to below the bar. It is declared with no
|
|
226
|
+
specificity, so a theme that sets its own `scroll-padding-top` keeps it.
|
|
227
|
+
|
|
228
|
+
A theme with a sticky or fixed header of its own offsets it by the bar's
|
|
229
|
+
height. The fallback of `0` applies on every page the bar is not on:
|
|
230
|
+
|
|
231
|
+
```css
|
|
232
|
+
.site-header {
|
|
233
|
+
position: sticky;
|
|
234
|
+
top: var(--geekity-admin-bar-height, 0);
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
A theme that sets its own `scroll-padding-top` adds the bar to it the same
|
|
239
|
+
way, for example `calc(var(--geekity-admin-bar-height, 0px) + 4rem)`. Use the
|
|
240
|
+
`geekity-admin-bar` class for any other change, for example
|
|
241
|
+
`.geekity-admin-bar .site-header { ... }`.
|
|
242
|
+
|
|
243
|
+
A theme that must not show the bar can hide it:
|
|
244
|
+
|
|
245
|
+
```css
|
|
246
|
+
geekity-admin-bar {
|
|
247
|
+
display: none !important;
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
The `!important` is needed because it has to beat the element's inline style.
|
|
252
|
+
With script on, the bar then measures 0 and the page moves back up. For a
|
|
253
|
+
reader without script, the theme also removes the margin:
|
|
254
|
+
|
|
255
|
+
```css
|
|
256
|
+
html.geekity-admin-bar {
|
|
257
|
+
margin-top: 0 !important;
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
191
261
|
### An entry
|
|
192
262
|
|
|
193
263
|
`layouts/post.njk` and `layouts/page.njk` draw the same thing, the source
|
|
@@ -233,6 +303,22 @@ later is not news. A post tagged `indienews` opens the line with a
|
|
|
233
303
|
told the post is for it; a page never prints one, and its line is a
|
|
234
304
|
`p.page-meta` rather than a `p.entry-meta`.
|
|
235
305
|
|
|
306
|
+
**Every post's page has one `h1`.** A post with a name of its own is headed by
|
|
307
|
+
it, as above. A note, or a reply without a title, opens on its words instead,
|
|
308
|
+
so it has no `header`; in its place is an `h1` a screen reader and a crawler
|
|
309
|
+
navigate by and a sighted reader never sees, saying what the post is, who wrote
|
|
310
|
+
it and when:
|
|
311
|
+
|
|
312
|
+
```html
|
|
313
|
+
<h1 class="screen-reader-text">Note by Ada Lovelace, 11 September 2026</h1>
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
It says `Reply` for a reply and leaves out the name or the date the post does
|
|
317
|
+
not have. It is not a `p-name`: a parser that found one would take the post
|
|
318
|
+
for an article. The headings under it step down one level at a time: the
|
|
319
|
+
conversation and the comment form are `h2`, and a refused form's error summary
|
|
320
|
+
is an `h3` inside the form's section.
|
|
321
|
+
|
|
236
322
|
What it is filed under is printed under the words and inside the article, so
|
|
237
323
|
that each link is a `p-category` of this entry: the categories first, then the
|
|
238
324
|
tags, each as one `p.post-categories` from `partials/tags.njk`.
|
|
@@ -541,6 +627,59 @@ A site that wants a different graph — more types, an `Organization` publisher,
|
|
|
541
627
|
nothing at all — writes its own `partials/jsonld.njk` and that file replaces
|
|
542
628
|
this one, like any other partial.
|
|
543
629
|
|
|
630
|
+
### Prefetching and page transitions
|
|
631
|
+
|
|
632
|
+
Two tags near the top of `<head>` make moving between pages feel faster. Both
|
|
633
|
+
are progressive enhancement: a browser that does not support one ignores it.
|
|
634
|
+
|
|
635
|
+
**Speculation rules.** The `speculationRules` block prints one `<script
|
|
636
|
+
type="speculationrules">` that asks the browser to prefetch a page the reader
|
|
637
|
+
is about to open. It covers links to this site's own pages, at `moderate`
|
|
638
|
+
eagerness, which in Chrome is a hover of about 200 milliseconds or the start of
|
|
639
|
+
a tap. It never prefetches:
|
|
640
|
+
|
|
641
|
+
- `/admin` and anything under `/admin/`, which includes `/admin/logout`.
|
|
642
|
+
- Any path with `logout` in it.
|
|
643
|
+
- A feed: `/feed/`, `/feed/atom/`, `/feed/json/`, and any other path that has
|
|
644
|
+
a `/feed/` segment, such as a tag's feed or a post's comments feed.
|
|
645
|
+
- A file under `/uploads/`.
|
|
646
|
+
- A URL with a query, such as `/search/?q=words`.
|
|
647
|
+
|
|
648
|
+
Every pattern is written through the `url` filter, so a site served from a
|
|
649
|
+
subdirectory prefetches only its own pages.
|
|
650
|
+
|
|
651
|
+
**No rules reach a signed-in reader.** The CMS removes every `<script
|
|
652
|
+
type="speculationrules">` from a page it draws for somebody signed in, the same
|
|
653
|
+
page that carries [the admin bar](#the-admin-bar). That page is drawn for one
|
|
654
|
+
person and never stored, so a prefetch of it is wasted work. A site theme that
|
|
655
|
+
writes its own rules does not have to check who is reading.
|
|
656
|
+
|
|
657
|
+
**View transitions.** The `viewTransitions` block prints a `<style>` that opts
|
|
658
|
+
into cross-document view transitions. The browser cross-fades from one page of
|
|
659
|
+
the site to the next, with no JavaScript. The rule is inside `@media
|
|
660
|
+
(prefers-reduced-motion: no-preference)`, so a reader who asks for reduced
|
|
661
|
+
motion gets no transition:
|
|
662
|
+
|
|
663
|
+
```css
|
|
664
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
665
|
+
@view-transition {
|
|
666
|
+
navigation: auto;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
```
|
|
670
|
+
|
|
671
|
+
A site theme that wants a different animation adds `::view-transition-*` rules
|
|
672
|
+
to its own stylesheet.
|
|
673
|
+
|
|
674
|
+
**Turning either off.** Override its block with nothing in it:
|
|
675
|
+
|
|
676
|
+
```njk
|
|
677
|
+
{% extends "layouts/base.njk" %}
|
|
678
|
+
|
|
679
|
+
{% block speculationRules %}{% endblock %}
|
|
680
|
+
{% block viewTransitions %}{% endblock %}
|
|
681
|
+
```
|
|
682
|
+
|
|
544
683
|
### Colours
|
|
545
684
|
|
|
546
685
|
`static/style.css` is the source design: a serif body and sans headings at an
|
|
@@ -1100,22 +1239,22 @@ the thread, because it is not an answer.
|
|
|
1100
1239
|
|
|
1101
1240
|
Each entry — a reply, a like or a boost — is:
|
|
1102
1241
|
|
|
1103
|
-
| Key | What it holds
|
|
1104
|
-
| ---------------- |
|
|
1105
|
-
| `id` | What it is called: a reply's own note id, which is what an answer to it names.
|
|
1106
|
-
| `source` | `"activitypub"` for a fediverse reply, `"comment"` for one left on the page, `"webmention"` for another page linking here.
|
|
1107
|
-
| `kind` | `"reply"`, `"like"`, `"boost"`, `"repost"` or `"mention"`. A `repost` comes from a webmention; a `mention` is a webmention or an approved fediverse quote.
|
|
1108
|
-
| `author.name` | The best name available: their display name, else their handle, else their id. For a webmention, the source's `h-card` name, else its host.
|
|
1109
|
-
| `author.handle` | `@user@host`, or `null`. Taken from the follower profile the site holds, else guessed from the actor URL. `null` for a native comment.
|
|
1110
|
-
| `author.url` | Their profile page, the website a commenter typed, or a webmention author's `u-url`. May be `null`, so guard the link.
|
|
1111
|
-
| `author.avatar` | Their avatar, or `null`. The site knows one for
|
|
1112
|
-
| `author.actorId` | Their id, which is what identifies them however they are named. `null` for a native comment.
|
|
1113
|
-
| `url` | Where it can be read: the remote note's `url` for a fediverse reply or quote, the source page for a webmention, and `{permalink}#comment-{id}` — this page's own anchor — for a native comment.
|
|
1114
|
-
| `content` | What it says, **already sanitised**, so print it with `\| safe`. Empty for a like or a boost.
|
|
1115
|
-
| `published` | A `Date`: when it was published, or when it arrived if it did not say. Use the `date` filter.
|
|
1116
|
-
| `inReplyTo` | What it answers — the post's ActivityPub id, or another reply's — and `null` for a reaction.
|
|
1117
|
-
| `status` | `"published"`. On the record for the sources that moderate.
|
|
1118
|
-
| `replies` | The replies to this one, oldest first, nested as deep as the site has seen.
|
|
1242
|
+
| Key | What it holds |
|
|
1243
|
+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1244
|
+
| `id` | What it is called: a reply's own note id, which is what an answer to it names. |
|
|
1245
|
+
| `source` | `"activitypub"` for a fediverse reply, `"comment"` for one left on the page, `"webmention"` for another page linking here. |
|
|
1246
|
+
| `kind` | `"reply"`, `"like"`, `"boost"`, `"repost"` or `"mention"`. A `repost` comes from a webmention; a `mention` is a webmention or an approved fediverse quote. |
|
|
1247
|
+
| `author.name` | The best name available: their display name, else their handle, else their server, else their id. For a webmention, the source's `h-card` name, else its host. |
|
|
1248
|
+
| `author.handle` | `@user@host`, or `null`. Taken from the follower or actor profile the site holds, else guessed from the actor URL unless it ends in a number. `null` for a native comment. |
|
|
1249
|
+
| `author.url` | Their profile page, the website a commenter typed, or a webmention author's `u-url`. May be `null`, so guard the link. |
|
|
1250
|
+
| `author.avatar` | Their avatar, or `null`. The site knows one for a fediverse actor whose profile it holds and for a webmention whose `h-card` carried a `u-photo`. Always a same-origin `/_geekity/avatars/…` path, never the remote URL: see [Avatars](#avatars). |
|
|
1251
|
+
| `author.actorId` | Their id, which is what identifies them however they are named. `null` for a native comment. |
|
|
1252
|
+
| `url` | Where it can be read: the remote note's `url` for a fediverse reply or quote, the source page for a webmention, and `{permalink}#comment-{id}` — this page's own anchor — for a native comment. |
|
|
1253
|
+
| `content` | What it says, **already sanitised**, so print it with `\| safe`. Empty for a like or a boost. |
|
|
1254
|
+
| `published` | A `Date`: when it was published, or when it arrived if it did not say. Use the `date` filter. |
|
|
1255
|
+
| `inReplyTo` | What it answers — the post's ActivityPub id, or another reply's — and `null` for a reaction. |
|
|
1256
|
+
| `status` | `"published"`. On the record for the sources that moderate. |
|
|
1257
|
+
| `replies` | The replies to this one, oldest first, nested as deep as the site has seen. |
|
|
1119
1258
|
|
|
1120
1259
|
Three rules decide what is in the thread, and they are the CMS's rather than a
|
|
1121
1260
|
theme's: a reply whose author deleted it is gone, and its own answers move up to
|
|
@@ -1232,6 +1371,23 @@ technology, and give it `tabindex="-1"` and `autocomplete="off"`. A submission
|
|
|
1232
1371
|
that filled it is dropped. **Do not** remove it from a replacement partial —
|
|
1233
1372
|
it is one of three things standing between the site and a spam queue.
|
|
1234
1373
|
|
|
1374
|
+
### When a submission is refused
|
|
1375
|
+
|
|
1376
|
+
The CMS answers a refused comment with the post again, `problems` and `error`
|
|
1377
|
+
filled in. The packaged partial tells assistive technology about it in two
|
|
1378
|
+
places, and a replacement partial should do the same:
|
|
1379
|
+
|
|
1380
|
+
- **A summary before the form.** One element with `role="alert"`,
|
|
1381
|
+
`tabindex="-1"` and `autofocus`, labelled by a heading that is `error`, or a
|
|
1382
|
+
sentence of your own when there is none, and holding a link to each field in
|
|
1383
|
+
`problems` (`<a href="#comment-name">…</a>`). `autofocus` moves focus to it on
|
|
1384
|
+
load with no script, so it has to be the first `autofocus` on the page.
|
|
1385
|
+
- **On each field in `problems`.** `aria-invalid="true"` and
|
|
1386
|
+
`aria-describedby` naming the element that holds its message, so a screen
|
|
1387
|
+
reader reads the message with the field.
|
|
1388
|
+
|
|
1389
|
+
The contact form below keeps the same contract.
|
|
1390
|
+
|
|
1235
1391
|
### When somebody is signed in
|
|
1236
1392
|
|
|
1237
1393
|
Two more keys are on `commentForm` when — and only when — the request carries a
|
|
@@ -1357,6 +1513,7 @@ the import above carries `with context`: a macro imported without it cannot see
|
|
|
1357
1513
|
| `date(format, zone)` | Formats a `Date` or a date string. `readable` (the default) gives `2 September 2026`, `html` gives `2026-09-02` for a `<time datetime>`, `year` gives `2026`, `month` gives `September 2026`, `iso` gives the full ISO 8601 instant. A date in a file is a UTC instant; every format but `iso` is rendered in the site's `timezone` setting, and `iso` stays the instant. Pass `zone` — an IANA name — to override the setting for one call. A value that is not a date renders as the empty string. |
|
|
1358
1514
|
| `url` | Prefixes a root-relative path with the base URL's path, so a site served from a subdirectory links correctly. Eleventy's filter of the same name. |
|
|
1359
1515
|
| `absoluteUrl` | The same path as a fully qualified URL against the site's `baseUrl`. |
|
|
1516
|
+
| `asset` | The URL of a file in the theme's `static/` directory, with the base path in front and a hash of the file's bytes on the end: `{{ "style.css" \| asset }}` gives `/theme/style.css?v=3f2a9c01b7d4`. The file is found the way `/theme/` finds it, the chosen theme first. A hashed URL is served with `Cache-Control: public, max-age=31536000, immutable`, and editing the file changes the hash on the next render. A file no theme has gets its plain `/theme/` URL. |
|
|
1360
1517
|
|
|
1361
1518
|
`date` reads one word rather than parsing it: `{{ "now" | date("year") }}` is
|
|
1362
1519
|
the year at the moment the page is rendered, in the site's own timezone. It is
|
|
@@ -13,14 +13,19 @@
|
|
|
13
13
|
off an account. The search form is on the search page and nowhere else.
|
|
14
14
|
|
|
15
15
|
Blocks a site can override without copying the whole file:
|
|
16
|
-
title
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
title the contents of <title>
|
|
17
|
+
speculationRules the <script type="speculationrules"> that prefetches the
|
|
18
|
+
site's own pages; empty it to prefetch nothing
|
|
19
|
+
viewTransitions the <style> that opts into cross-document view
|
|
20
|
+
transitions; empty it to turn them off
|
|
21
|
+
head the cards, the icons and the structured data, at the end
|
|
22
|
+
of <head>. Call `super()` from an override that only
|
|
23
|
+
adds to it.
|
|
24
|
+
alternates <link rel="alternate"> tags, where the feeds go
|
|
25
|
+
header the site header, with the site menu
|
|
26
|
+
content the page body
|
|
27
|
+
footer the site footer
|
|
28
|
+
scripts scripts at the end of <body>
|
|
24
29
|
#}{% import "partials/feeds.njk" as feeds %}
|
|
25
30
|
{%- import "partials/menu.njk" as nav %}
|
|
26
31
|
{#- Whether this is the front page, which is the one page the header and the
|
|
@@ -55,7 +60,43 @@
|
|
|
55
60
|
<meta name="description" content="{{ metaDescription }}">
|
|
56
61
|
{% endif %}
|
|
57
62
|
<link rel="canonical" href="{{ (page.url or "/") | absoluteUrl }}">
|
|
58
|
-
<link rel="stylesheet" href="{{ "
|
|
63
|
+
<link rel="stylesheet" href="{{ "style.css" | asset }}">
|
|
64
|
+
{% block speculationRules %}
|
|
65
|
+
{#
|
|
66
|
+
Prefetch the page behind a link the reader is about to follow: a hover
|
|
67
|
+
or a press on one of this site's own pages (TASK-140). Not the admin,
|
|
68
|
+
logout, a feed, an upload or a URL with a query, which are not pages to
|
|
69
|
+
read or not safe to fetch unasked. Every pattern goes through `url`, so
|
|
70
|
+
a site in a subdirectory prefetches only its own pages. The CMS drops
|
|
71
|
+
this script from a page drawn for somebody signed in.
|
|
72
|
+
#}
|
|
73
|
+
{% set speculationRules = { "prefetch": [{
|
|
74
|
+
"source": "document",
|
|
75
|
+
"eagerness": "moderate",
|
|
76
|
+
"where": { "and": [
|
|
77
|
+
{ "href_matches": "/*" | url },
|
|
78
|
+
{ "not": { "href_matches": "/admin" | url } },
|
|
79
|
+
{ "not": { "href_matches": "/admin/*" | url } },
|
|
80
|
+
{ "not": { "href_matches": "/*logout*" | url } },
|
|
81
|
+
{ "not": { "href_matches": "/feed/*" | url } },
|
|
82
|
+
{ "not": { "href_matches": "/*/feed/*" | url } },
|
|
83
|
+
{ "not": { "href_matches": "/uploads/*" | url } },
|
|
84
|
+
{ "not": { "href_matches": "/*\\?(.+)" | url } }
|
|
85
|
+
] }
|
|
86
|
+
}] } %}
|
|
87
|
+
<script type="speculationrules">{{ speculationRules | dump | safe }}</script>
|
|
88
|
+
{% endblock %}
|
|
89
|
+
{% block viewTransitions %}
|
|
90
|
+
{#
|
|
91
|
+
Cross-document view transitions: the default cross-fade between two of
|
|
92
|
+
this site's pages, and none for a reader who asks for reduced motion.
|
|
93
|
+
#}
|
|
94
|
+
<style>
|
|
95
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
96
|
+
@view-transition { navigation: auto; }
|
|
97
|
+
}
|
|
98
|
+
</style>
|
|
99
|
+
{% endblock %}
|
|
59
100
|
{% block alternates %}
|
|
60
101
|
{{ feeds.feedLinks("/", site.title) }}
|
|
61
102
|
{{ feeds.commentsFeedLink("/comments/feed/", site.title + " comments") }}
|
|
@@ -184,7 +225,7 @@
|
|
|
184
225
|
See the theme README.
|
|
185
226
|
#}
|
|
186
227
|
{% if content and "language-" in content %}
|
|
187
|
-
<script src="{{ "
|
|
228
|
+
<script src="{{ "highlight.js" | asset }}" defer></script>
|
|
188
229
|
{% endif %}
|
|
189
230
|
{% endblock %}
|
|
190
231
|
</body>
|
|
@@ -24,11 +24,20 @@
|
|
|
24
24
|
{% set entryUrl = page.url or url %}
|
|
25
25
|
<article class="blog-post h-entry">
|
|
26
26
|
{#- A post with no name of its own (a note, or a reply without a title) is
|
|
27
|
-
its words, so it opens on them
|
|
27
|
+
its words, so it opens on them in sight. Its page still needs one h1 to
|
|
28
|
+
navigate by, so it gets one that says what it is, who wrote it and when,
|
|
29
|
+
hidden from sight. It is no `p-name`: a parser would take that as a
|
|
30
|
+
title and read the note as an article. -#}
|
|
28
31
|
{% if named %}
|
|
29
32
|
<header>
|
|
30
33
|
<h1 class="p-name">{{ title }}</h1>
|
|
31
34
|
</header>
|
|
35
|
+
{% else %}
|
|
36
|
+
<h1 class="screen-reader-text">
|
|
37
|
+
{{- "Reply" if postType == "reply" else "Note" }}
|
|
38
|
+
{%- if bioAuthor.name %} by {{ bioAuthor.name }}{% endif %}
|
|
39
|
+
{%- if date %}, {{ date | date }}{% endif -%}
|
|
40
|
+
</h1>
|
|
32
41
|
{% endif %}
|
|
33
42
|
|
|
34
43
|
{#- A reply cites the post it answers, whose URL is also the link its
|
|
@@ -29,8 +29,27 @@
|
|
|
29
29
|
<p class="comment-notice" role="status">{{ commentNotice }}</p>
|
|
30
30
|
{% endif %}
|
|
31
31
|
|
|
32
|
-
{
|
|
33
|
-
|
|
32
|
+
{#
|
|
33
|
+
A refused submission leads with this: what went wrong, and a link to each
|
|
34
|
+
field to put right. It is an alert and takes focus on load, so a screen
|
|
35
|
+
reader hears it at once and a keyboard starts from it, with no script. A
|
|
36
|
+
field it links to is marked `aria-invalid` and names its message with
|
|
37
|
+
`aria-describedby`, so the message is read with the field.
|
|
38
|
+
#}
|
|
39
|
+
{% set problems = commentForm.problems %}
|
|
40
|
+
{% if commentForm.error or problems.name or problems.email or problems.url or problems.body %}
|
|
41
|
+
<div class="comment-error" role="alert" tabindex="-1" autofocus aria-labelledby="comment-error-heading">
|
|
42
|
+
<h3 id="comment-error-heading">{{ commentForm.error or 'Your comment was not posted. Fix the fields marked below.' }}</h3>
|
|
43
|
+
{% if problems.name or problems.email or problems.url or problems.body %}
|
|
44
|
+
<ul>
|
|
45
|
+
{% for key in ['name', 'email', 'url', 'body'] %}
|
|
46
|
+
{% if problems[key] %}
|
|
47
|
+
<li><a href="#comment-{{ key }}">{{ problems[key] }}</a></li>
|
|
48
|
+
{% endif %}
|
|
49
|
+
{% endfor %}
|
|
50
|
+
</ul>
|
|
51
|
+
{% endif %}
|
|
52
|
+
</div>
|
|
34
53
|
{% endif %}
|
|
35
54
|
|
|
36
55
|
<form method="post" action="{{ commentForm.action }}">
|
|
@@ -83,34 +102,34 @@
|
|
|
83
102
|
|
|
84
103
|
<p class="comment-field">
|
|
85
104
|
<label for="comment-name">Name</label>
|
|
86
|
-
<input id="comment-name" name="{{ commentForm.fields.name }}" type="text" value="{{ commentForm.values.name }}" maxlength="{{ commentForm.nameLength }}" autocomplete="name" required />
|
|
87
|
-
{% if
|
|
88
|
-
<span class="comment-field-error">{{
|
|
105
|
+
<input id="comment-name" name="{{ commentForm.fields.name }}" type="text" value="{{ commentForm.values.name }}" maxlength="{{ commentForm.nameLength }}" autocomplete="name" required{% if problems.name %} aria-invalid="true" aria-describedby="comment-name-error"{% endif %} />
|
|
106
|
+
{% if problems.name %}
|
|
107
|
+
<span class="comment-field-error" id="comment-name-error">{{ problems.name }}</span>
|
|
89
108
|
{% endif %}
|
|
90
109
|
</p>
|
|
91
110
|
|
|
92
111
|
<p class="comment-field">
|
|
93
112
|
<label for="comment-email">Email <span class="comment-optional">(optional, never shown)</span></label>
|
|
94
|
-
<input id="comment-email" name="{{ commentForm.fields.email }}" type="email" value="{{ commentForm.values.email }}" autocomplete="email" />
|
|
95
|
-
{% if
|
|
96
|
-
<span class="comment-field-error">{{
|
|
113
|
+
<input id="comment-email" name="{{ commentForm.fields.email }}" type="email" value="{{ commentForm.values.email }}" autocomplete="email"{% if problems.email %} aria-invalid="true" aria-describedby="comment-email-error"{% endif %} />
|
|
114
|
+
{% if problems.email %}
|
|
115
|
+
<span class="comment-field-error" id="comment-email-error">{{ problems.email }}</span>
|
|
97
116
|
{% endif %}
|
|
98
117
|
</p>
|
|
99
118
|
|
|
100
119
|
<p class="comment-field">
|
|
101
120
|
<label for="comment-url">Your site <span class="comment-optional">(optional)</span></label>
|
|
102
|
-
<input id="comment-url" name="{{ commentForm.fields.url }}" type="text" inputmode="url" value="{{ commentForm.values.url }}" autocomplete="url" />
|
|
103
|
-
{% if
|
|
104
|
-
<span class="comment-field-error">{{
|
|
121
|
+
<input id="comment-url" name="{{ commentForm.fields.url }}" type="text" inputmode="url" value="{{ commentForm.values.url }}" autocomplete="url"{% if problems.url %} aria-invalid="true" aria-describedby="comment-url-error"{% endif %} />
|
|
122
|
+
{% if problems.url %}
|
|
123
|
+
<span class="comment-field-error" id="comment-url-error">{{ problems.url }}</span>
|
|
105
124
|
{% endif %}
|
|
106
125
|
</p>
|
|
107
126
|
{% endif %}
|
|
108
127
|
|
|
109
128
|
<p class="comment-field">
|
|
110
129
|
<label for="comment-body">Comment</label>
|
|
111
|
-
<textarea id="comment-body" name="{{ commentForm.fields.body }}" rows="6" maxlength="{{ commentForm.bodyLength }}" required>{{ commentForm.values.body }}</textarea>
|
|
112
|
-
{% if
|
|
113
|
-
<span class="comment-field-error">{{
|
|
130
|
+
<textarea id="comment-body" name="{{ commentForm.fields.body }}" rows="6" maxlength="{{ commentForm.bodyLength }}" required{% if problems.body %} aria-invalid="true" aria-describedby="comment-body-error"{% endif %}>{{ commentForm.values.body }}</textarea>
|
|
131
|
+
{% if problems.body %}
|
|
132
|
+
<span class="comment-field-error" id="comment-body-error">{{ problems.body }}</span>
|
|
114
133
|
{% endif %}
|
|
115
134
|
<span class="comment-hint">Markdown works. Links are marked <code>nofollow ugc</code>; HTML is not.</span>
|
|
116
135
|
</p>
|