Skip to content

Add folder posts#1027

Open
davidmerfield wants to merge 15 commits into
masterfrom
codex/implement-multi-folder-build-system
Open

Add folder posts#1027
davidmerfield wants to merge 15 commits into
masterfrom
codex/implement-multi-folder-build-system

Conversation

@davidmerfield

@davidmerfield davidmerfield commented Oct 20, 2025

Copy link
Copy Markdown
Owner
  • Some kind of markup structure that makes it possible to build a slideshow? e.g. <section class="multi-file-post"><section data-source="{{path}}">...
  • This should work recursively for subfolders? up to a limit of say 50 files? if there are too many files, don't build the post at all. sort all the paths alphabetically before concatentating
  • Ignored files (e.g. _1.jpg) are still added to multi file posts
  • Do we think about injecting a title for posts without one? maybe with a class so it could easily be hidden in CSS?
  • Resolve bug with folder '[Blog]+'
    • add test for this
  • Dashboard file viewer needs to handle multi-file posts properly
    • add test for this
    • change the icon for the folder to include the checkmark


https://chatgpt.com/codex/tasks/task_e_68f618afe9188329b32153d161c70a5b

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/sync/update/index.js
Comment on lines 60 to +75
} else if (stat && stat.isDirectory()) {
maybeEnableInjectTitle(blog, path, function () {
// there is nothing else to do for directories
done();
var multiInfo = build.findMultiFolder(path);

if (multiInfo) {
var targetPath = multiInfo.folderPath;

log(path, "Saving multi-folder in database");

set(blog, targetPath, function (err) {
if (err) {
log(targetPath, "Error saving multi-folder in database", err);
} else {
log(targetPath, "Saving multi-folder in database succeeded");
}
done(err);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Drop multi-folder entry when directory is removed

This branch builds aggregated content when a + directory exists, but the ENOENT branch above still drops only the directory path (/album+). The published entry for that folder lives at the plus-stripped entryPath, so deleting the folder leaves /album and its preview in the database because nothing ever removes it or rebuilds dependents. Consider also dropping multiInfo.entryPath when the folder disappears so that multi-folder deletions clean up their synthesized entry.

Useful? React with 👍 / 👎.

@davidmerfield

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/sync/update/index.js
Comment on lines 49 to +80
fs.stat(localPath(blog.id, path), function (err, stat) {
if (err && err.code === "ENOENT") {
log(path, "Dropping from database");
drop(blog.id, path, function (err) {
if (err) {
log(path, "Error dropping from database", err);
} else {
log(path, "Dropping from database succeeded");
}
done(err);
});
var dropTargets = [path];
var multiInfo = build.findMultiFolder(path);

if (
multiInfo &&
multiInfo.folderPath === path &&
multiInfo.entryPath &&
dropTargets.indexOf(multiInfo.entryPath) === -1
) {
dropTargets.push(multiInfo.entryPath);
}

var dropError = null;

(function nextDrop(index) {
if (index >= dropTargets.length) return done(dropError);

var target = dropTargets[index];
log(target, "Dropping from database");
drop(blog.id, target, function (err) {
if (err) {
log(target, "Error dropping from database", err);
if (!dropError) dropError = err;
} else {
log(target, "Dropping from database succeeded");
}

nextDrop(index + 1);
});
})(0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Rebuild multi-folder entry when a child file is removed

The delete branch only drops path and, if the removed path is the +/ folder, its aggregate. When a single file inside a multi-folder is deleted (e.g. /album+/two.md), this branch does not rebuild or drop /album, so the published entry continues to contain content from the deleted file until some other change touches the folder. Nothing elsewhere schedules a rebuild for /album on child deletion, so multi-folder posts can display stale content after a source file is removed. Consider triggering a rebuild of the aggregated entry whenever any path under the multi-folder disappears.

Useful? React with 👍 / 👎.

@davidmerfield

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@davidmerfield davidmerfield changed the title Add multi-folder aggregation support Multi-file posts Oct 21, 2025
@davidmerfield davidmerfield changed the title Multi-file posts Folder posts Oct 21, 2025
@davidmerfield

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@davidmerfield

Copy link
Copy Markdown
Owner Author

@codex files which should be ignored (e.g. _1.jpg or _images/1.jpg) are still added to multi file posts. Please revise to prevent these files from inclusion in these posts

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • ⚠️ npm test -- app/sync/tests/multi-folders.js (fails: scripts/tests/test.env missing in container)

View task →

@davidmerfield

Copy link
Copy Markdown
Owner Author

@codex This should work recursively for subfolders? up to a limit of say 50 files? if there are too many files, don't build the post at all. sort all the paths alphabetically before concatenating, e.g. 1.jpg, 2/a.jpg, 2/b.jpg, 3.jpg etc. implement please

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • ⚠️ npm test -- app/sync/tests/multi-folders.js (fails: ./scripts/tests/test.env does not exist in the tests directory)

View task →

@davidmerfield

Copy link
Copy Markdown
Owner Author

@codex Can we inject a title based on the folder name into the post HTML when a title tag doesn't exist in the post html? Add a classname, e.g. multi-file-title to the h1 so it can easily be hidden if so desired

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Injected a derived folder-based <h1 class="multi-file-title"> heading into multi-file posts whenever no existing heading is present, including safe escaping and titlecase handling for folder names. app/build/multiple.jsL10-L358
  • Added a regression test confirming that heading injection occurs for multi-folder posts lacking their own titles. app/build/tests/multiple.jsL75-L91

Testing

  • ⚠️ npm test -- app/build/tests/multiple.js (fails: ./scripts/tests/test.env does not exist in the tests directory.)

View task →

@davidmerfield

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@davidmerfield davidmerfield changed the title Folder posts Add folder posts Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant