@riebeckite/plugin-archive 0.0.35 → 0.0.37

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 (2) hide show
  1. package/dist/index.js +19 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -158,6 +158,25 @@ function archive(options = {}) {
158
158
  language: normalizeArchiveLocale(locale),
159
159
  body: page.html
160
160
  };
161
+ },
162
+ resolveRoute: ({ manifest, pathname, config }) => {
163
+ if (resolved.basePath === "") return null;
164
+ const locale = resolveLocale(config, resolved);
165
+ const collection = buildArchiveCollections(
166
+ manifest.discoverableEntries,
167
+ resolved,
168
+ locale
169
+ ).find((candidate) => candidate.path === pathname);
170
+ if (!collection) return null;
171
+ const page = renderArchivePage(collection, resolved, locale);
172
+ return {
173
+ type: "archive",
174
+ pathname: collection.path,
175
+ title: page.title,
176
+ description: config ? buildArchiveDescription(config.site.title, page.title, locale) : void 0,
177
+ language: normalizeArchiveLocale(locale),
178
+ body: page.html
179
+ };
161
180
  }
162
181
  }
163
182
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-archive",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -15,7 +15,7 @@
15
15
  "./style.css": "./style.css"
16
16
  },
17
17
  "dependencies": {
18
- "@riebeckite/core": "0.0.35"
18
+ "@riebeckite/core": "0.0.37"
19
19
  },
20
20
  "devDependencies": {
21
21
  "tsx": "^4.22.4"