@adobe/helix-html-pipeline 6.25.5 → 6.26.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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [6.26.1](https://github.com/adobe/helix-html-pipeline/compare/v6.26.0...v6.26.1) (2025-07-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * also treat self-ref links to index.plain.html correctly ([#732](https://github.com/adobe/helix-html-pipeline/issues/732)) ([cc37a31](https://github.com/adobe/helix-html-pipeline/commit/cc37a3191199660b06977174c33fd61ce582511a))
7
+
8
+ # [6.26.0](https://github.com/adobe/helix-html-pipeline/compare/v6.25.5...v6.26.0) (2025-06-26)
9
+
10
+
11
+ ### Features
12
+
13
+ * add support for canonical and title suffix ([7f07e29](https://github.com/adobe/helix-html-pipeline/commit/7f07e29f2b922a318c2eee4a33729980e085e84a)), closes [#895](https://github.com/adobe/helix-html-pipeline/issues/895)
14
+
1
15
  ## [6.25.5](https://github.com/adobe/helix-html-pipeline/compare/v6.25.4...v6.25.5) (2025-06-18)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "6.25.5",
3
+ "version": "6.26.1",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -70,27 +70,27 @@
70
70
  "unist-util-visit-parents": "6.0.1"
71
71
  },
72
72
  "devDependencies": {
73
- "@adobe/eslint-config-helix": "3.0.4",
74
- "@eslint/config-helpers": "0.2.3",
73
+ "@adobe/eslint-config-helix": "3.0.6",
74
+ "@eslint/config-helpers": "0.3.0",
75
75
  "@markedjs/html-differ": "5.0.2",
76
76
  "@semantic-release/changelog": "6.0.3",
77
77
  "@semantic-release/git": "10.0.1",
78
- "@semantic-release/npm": "12.0.1",
78
+ "@semantic-release/npm": "12.0.2",
79
79
  "c8": "10.1.3",
80
80
  "eslint": "9.4.0",
81
81
  "eslint-import-resolver-exports": "1.0.0-beta.5",
82
82
  "eslint-plugin-header": "3.1.1",
83
- "eslint-plugin-import": "2.31.0",
83
+ "eslint-plugin-import": "2.32.0",
84
84
  "esmock": "2.7.0",
85
85
  "husky": "9.1.7",
86
86
  "js-yaml": "4.1.0",
87
87
  "jsdom": "26.1.0",
88
88
  "junit-report-builder": "5.1.1",
89
89
  "lint-staged": "16.1.2",
90
- "mocha": "11.6.0",
90
+ "mocha": "11.7.1",
91
91
  "mocha-multi-reporters": "1.5.1",
92
- "mocha-suppress-logs": "0.5.1",
93
- "semantic-release": "24.2.5"
92
+ "mocha-suppress-logs": "0.6.0",
93
+ "semantic-release": "24.2.6"
94
94
  },
95
95
  "lint-staged": {
96
96
  "*.js": "eslint",
@@ -233,12 +233,27 @@ export default function extractMetaData(state, req) {
233
233
  }
234
234
  meta.title = content.title;
235
235
  }
236
+ // append the title suffix
237
+ const titleSuffix = metaConfig['title:suffix'];
238
+ delete metaConfig['title:suffix'];
239
+ if (meta.title && titleSuffix && titleSuffix !== '""') {
240
+ meta.title += titleSuffix;
241
+ }
242
+
236
243
  if (!('description' in meta)) {
237
244
  meta.description = extractDescription(hast) || undefined;
238
245
  }
239
246
 
240
247
  // use the req.url and not the state.info.path in case of folder mapping
241
248
  meta.url = makeCanonicalHtmlUrl(getAbsoluteUrl(state, req.url.pathname));
249
+
250
+ // append canonical extension
251
+ const canonicalExt = metaConfig['canonical:extension'];
252
+ delete metaConfig['canonical:extension'];
253
+ if (canonicalExt && !meta.url.endsWith('/')) {
254
+ meta.url = `${meta.url}.${canonicalExt}`;
255
+ }
256
+
242
257
  if (!('canonical' in meta)) {
243
258
  meta.canonical = meta.url;
244
259
  }
@@ -212,10 +212,18 @@ export function rewriteUrl(state, url) {
212
212
  || host === state.previewHost
213
213
  || host === state.liveHost) {
214
214
  if (hash && state.info?.path) {
215
- if (pathname === state.info.path
216
- || (pathname.endsWith('.plain.html') && pathname.substring(0, pathname.length - 11) === state.info.path)) {
215
+ if (pathname === state.info.path) {
217
216
  return hash;
218
217
  }
218
+ if (pathname.endsWith('.plain.html')) {
219
+ let resource = pathname.substring(0, pathname.length - 11);
220
+ if (resource.endsWith('/index')) {
221
+ resource = resource.substring(0, resource.length - 5);
222
+ }
223
+ if (resource === state.info.path) {
224
+ return hash;
225
+ }
226
+ }
219
227
  }
220
228
  return `${pathname}${search}${hash}`;
221
229
  }