mdorigin 0.5.0 → 0.5.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.
@@ -19,6 +19,7 @@ export async function buildDirectoryIndexes(options) {
19
19
  const updatedFile = await updateSingleDirectoryIndex(directoryPath, {
20
20
  createIfMissing: false,
21
21
  plugins: options.plugins ?? [],
22
+ excludedDirectories: options.excludedDirectories,
22
23
  });
23
24
  return {
24
25
  updatedFiles: updatedFile ? [updatedFile] : [],
@@ -33,6 +34,7 @@ export async function buildDirectoryIndexes(options) {
33
34
  const updatedFile = await updateSingleDirectoryIndex(directoryPath, {
34
35
  createIfMissing: false,
35
36
  plugins: options.plugins ?? [],
37
+ excludedDirectories: options.excludedDirectories,
36
38
  });
37
39
  if (updatedFile) {
38
40
  updatedFiles.push(updatedFile);
@@ -59,7 +61,7 @@ async function updateSingleDirectoryIndex(directoryPath, options) {
59
61
  const existingContent = indexFilePath
60
62
  ? await readFile(indexFilePath, 'utf8')
61
63
  : '';
62
- const block = await buildManagedIndexBlock(directoryPath, options.plugins);
64
+ const block = await buildManagedIndexBlock(directoryPath, options.plugins, options.excludedDirectories);
63
65
  const nextContent = upsertManagedIndexBlock(existingContent, block, {
64
66
  directoryPath,
65
67
  });
@@ -68,10 +70,11 @@ async function updateSingleDirectoryIndex(directoryPath, options) {
68
70
  }
69
71
  return targetFilePath;
70
72
  }
71
- export async function buildManagedIndexBlock(directoryPath, plugins = []) {
73
+ export async function buildManagedIndexBlock(directoryPath, plugins = [], excludedDirectories) {
72
74
  const entries = await readdir(directoryPath, { withFileTypes: true });
73
75
  const directories = [];
74
76
  const articles = [];
77
+ const excluded = new Set(excludedDirectories ?? []);
75
78
  for (const entry of entries) {
76
79
  if (isIgnoredContentName(entry.name)) {
77
80
  continue;
@@ -79,6 +82,9 @@ export async function buildManagedIndexBlock(directoryPath, plugins = []) {
79
82
  const fullPath = path.join(directoryPath, entry.name);
80
83
  const entryStats = await stat(fullPath);
81
84
  if (entryStats.isDirectory()) {
85
+ if (excluded.has(entry.name)) {
86
+ continue;
87
+ }
82
88
  if (!(await hasMeaningfulDirectoryContent(fullPath))) {
83
89
  continue;
84
90
  }
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "mdorigin",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "description": "Markdown-first publishing for humans and agents.",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/jolestar/mdorigin.git"
8
+ "url": "git+https://github.com/holon-run/mdorigin.git"
9
9
  },
10
- "homepage": "https://mdorigin.jolestar.workers.dev",
10
+ "homepage": "https://mdorigin.holon.run",
11
11
  "bugs": {
12
- "url": "https://github.com/jolestar/mdorigin/issues"
12
+ "url": "https://github.com/holon-run/mdorigin/issues"
13
13
  },
14
14
  "keywords": [
15
15
  "markdown",