{{ message }}
feat: auto-generate blank _index.md files for Hugo#63
Merged
Conversation
Add functionality to automatically create blank _index.md files in directories that don't have them in the export path, excluding asset folders. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
tieubao
pushed a commit
that referenced
this pull request
Apr 3, 2025
Add functionality to automatically create blank _index.md files in directories that don't have them in the export path, excluding asset folders. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
This PR implements a new feature to automatically generate blank
_index.mdfiles in directories that don't have them in the export path. This helps Hugo properly render content nested in subdirectories without requiring manual creation of these index files.Changes
generate_missing_index_filesfunction that is called at the end of the directory processing inExportMarkdown.runget_all_directorieshelper function to recursively find all directories in the export path_index.mdfile includes basic frontmatter with a title derived from the directory nameWhy
Hugo requires
_index.mdfiles in directories to properly render nested content and list pages. Previously, these files had to be created manually, which could be error-prone and time-consuming.Testing
_index.mdfiles are generated in directories that didn't have them_index.mdfiles are generated in asset folders_index.mdfiles are preserved🤖 Generated with Claude Code