@riebeckite/plugin-folder-pages 0.1.0 → 0.2.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.
Files changed (2) hide show
  1. package/dist/index.js +4 -9
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  // src/folder_pages.ts
8
8
  import {
9
9
  escapeRegExp,
10
+ isExcludedSlugPath,
10
11
  resolveEntryCalendarDate,
11
12
  resolveGeneratedFolderLocation
12
13
  } from "@riebeckite/core";
@@ -56,7 +57,7 @@ function buildFolderPages(manifest, excludedSlugs = []) {
56
57
  const routableBySlug = /* @__PURE__ */ new Map();
57
58
  const routablePermalinks = /* @__PURE__ */ new Set();
58
59
  for (const entry of manifest.publicEntries) {
59
- if (isExcludedEntry(entry, excludedSlugs)) continue;
60
+ if (isExcludedSlugPath(entry.slug, excludedSlugs)) continue;
60
61
  routableBySlug.set(entry.slug, entry);
61
62
  routablePermalinks.add(stripTrailingSlash(entry.permalink));
62
63
  }
@@ -90,7 +91,7 @@ function buildFolderPages(manifest, excludedSlugs = []) {
90
91
  else byLanguage.set(language, /* @__PURE__ */ new Set([child]));
91
92
  };
92
93
  for (const entry of manifest.discoverableEntries) {
93
- if (isExcludedEntry(entry, excludedSlugs)) continue;
94
+ if (isExcludedSlugPath(entry.slug, excludedSlugs)) continue;
94
95
  const language = entry.publicLocation.language;
95
96
  const folder = parentFolder(entry.slug);
96
97
  allFolders.add(folder);
@@ -106,7 +107,7 @@ function buildFolderPages(manifest, excludedSlugs = []) {
106
107
  }
107
108
  const owners = /* @__PURE__ */ new Map();
108
109
  for (const entry of manifest.publicEntries) {
109
- if (isExcludedEntry(entry, excludedSlugs)) continue;
110
+ if (isExcludedSlugPath(entry.slug, excludedSlugs)) continue;
110
111
  const language = entry.publicLocation.language;
111
112
  const basename = entryBaseSegment(entry.slug, language);
112
113
  if (!isEntryBasename(basename)) continue;
@@ -212,12 +213,6 @@ function buildFolderPages(manifest, excludedSlugs = []) {
212
213
  function languageKey(folder, language) {
213
214
  return `${folder}\0${language ?? ""}`;
214
215
  }
215
- function isExcludedEntry(entry, excludedSlugs) {
216
- const slug = entry.slug;
217
- return excludedSlugs.some(
218
- (excluded) => slug === excluded || slug.startsWith(`${excluded}/`)
219
- );
220
- }
221
216
  function entryBaseSegment(slug, language) {
222
217
  const segment = lastSegment(slug);
223
218
  if (!language) return segment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-folder-pages",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -15,13 +15,13 @@
15
15
  "./style.css": "./style.css"
16
16
  },
17
17
  "peerDependencies": {
18
- "@riebeckite/core": "^0.1.0"
18
+ "@riebeckite/core": "^0.2.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "tsx": "^4.22.4",
22
- "@riebeckite/core": "0.1.0",
23
- "@riebeckite/plugin-l10n": "0.1.0",
24
- "@riebeckite/plugin-taxonomy": "0.1.0"
22
+ "@riebeckite/plugin-l10n": "0.2.0",
23
+ "@riebeckite/core": "0.2.0",
24
+ "@riebeckite/plugin-taxonomy": "0.2.0"
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public"