@rr0/cms 0.3.29 → 0.3.30
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.
|
@@ -65,7 +65,6 @@ export class DataContentVisitor {
|
|
|
65
65
|
const doc = context.file.document;
|
|
66
66
|
const contents = doc.querySelector(".contents");
|
|
67
67
|
if (contents) {
|
|
68
|
-
const side = context.people ? "left" : "right";
|
|
69
68
|
const imgEl = contents.querySelector("img");
|
|
70
69
|
const caption = imageData.name;
|
|
71
70
|
const src = imageData.url;
|
|
@@ -77,7 +76,6 @@ export class DataContentVisitor {
|
|
|
77
76
|
figcaptionEl.innerHTML = caption;
|
|
78
77
|
await this.eventRenderer.renderEnd(context, imageData, figcaptionEl);
|
|
79
78
|
const figureEl = doc.createElement("figure");
|
|
80
|
-
figureEl.classList.add(side, "side");
|
|
81
79
|
figureEl.append(imgEl);
|
|
82
80
|
figureEl.append(figcaptionEl);
|
|
83
81
|
const insertEl = contents.querySelector("*");
|
|
@@ -8,7 +8,9 @@ describe("PeopleReplacer", () => {
|
|
|
8
8
|
const rootDir = rr0TestUtil.filePath("people");
|
|
9
9
|
const files = [
|
|
10
10
|
path.join(rootDir, "b/BeauJerome"),
|
|
11
|
-
path.join(rootDir, "h/HynekJosefAllen")
|
|
11
|
+
path.join(rootDir, "h/HynekJosefAllen"),
|
|
12
|
+
path.join(rootDir, "r/ReaganRonald"),
|
|
13
|
+
path.join(rootDir, "v/VertongenJeanLuc"),
|
|
12
14
|
];
|
|
13
15
|
const peopleFactory = new PeopleFactory(new RR0EventFactory());
|
|
14
16
|
function createPeopleElement(context, content, title) {
|
|
@@ -42,10 +44,15 @@ describe("PeopleReplacer", () => {
|
|
|
42
44
|
const peopleRenderer = new PeopleHtmlRenderer();
|
|
43
45
|
const replacer = new PeopleReplacer(peopleService, peopleRenderer);
|
|
44
46
|
const context = rr0TestUtil.time.newHtmlContext("1/9/9/0/08/index.html", "");
|
|
47
|
+
{
|
|
48
|
+
const peopleWithTitle = createPeopleElement(context, "Jean-Luc Vertongen");
|
|
49
|
+
const replacement = await replacer.replacement(context, peopleWithTitle);
|
|
50
|
+
expect(replacement.outerHTML).toBe(`<span class="peopl" translate="no"><a href="/src/people/v/VertongenJeanLuc/">Jean-Luc Vertongen</a></span>`);
|
|
51
|
+
}
|
|
45
52
|
{
|
|
46
53
|
const peopleWithTitle = createPeopleElement(context, "Ronald Reagan", "Ronald Wilson Reagan");
|
|
47
|
-
|
|
48
|
-
expect(replacement.outerHTML).toBe(`<span translate="no"><a href="/src/people/r/ReaganRonald/">Ronald Reagan</a></span>`);
|
|
54
|
+
const replacement = await replacer.replacement(context, peopleWithTitle);
|
|
55
|
+
expect(replacement.outerHTML).toBe(`<span class="peopl" translate="no"><a href="/src/people/r/ReaganRonald/">Ronald Reagan</a></span>`);
|
|
49
56
|
}
|
|
50
57
|
{
|
|
51
58
|
const peopleWithFullName = createPeopleElement(context, "Jérôme Beau");
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@rr0/cms",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"author": "Jérôme Beau <rr0@rr0.org> (https://rr0.org)",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.30",
|
|
6
6
|
"description": "RR0 Content Management System (CMS)",
|
|
7
7
|
"exports": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"build": "rm -Rf dist && tsc --project tsconfig.prod.json",
|
|
25
25
|
"prepublishOnly": "npm run build",
|
|
26
26
|
"test": "testscript",
|
|
27
|
-
"test-one": "rm -Rf out && tsx src/
|
|
27
|
+
"test-one": "rm -Rf out && tsx src/people/PeopleReplacer.test.ts",
|
|
28
28
|
"test-ci": "rm -Rf out && testscript"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@javarome/fileutil": "^0.3.7",
|
|
32
32
|
"@rr0/common": "^1.1.3",
|
|
33
|
-
"@rr0/data": "^0.3.
|
|
33
|
+
"@rr0/data": "^0.3.27",
|
|
34
34
|
"@rr0/lang": "^0.1.12",
|
|
35
35
|
"@rr0/place": "^0.5.3",
|
|
36
36
|
"@rr0/time": "^0.11.0",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"glob": "^11.0.1",
|
|
40
40
|
"image-size": "^2.0.1",
|
|
41
41
|
"jsdom": "^26.0.0",
|
|
42
|
-
"netlify-cli": "^19.0.3",
|
|
43
42
|
"selenium-webdriver": "^4.30.0",
|
|
44
43
|
"ssg-api": "^1.16.15"
|
|
45
44
|
},
|
|
46
45
|
"devDependencies": {
|
|
46
|
+
"netlify-cli": "^19.1.4",
|
|
47
47
|
"@javarome/testscript": "^0.13.1",
|
|
48
48
|
"@types/jsdom": "^21.1.7",
|
|
49
49
|
"@types/node": "^22.13.11",
|