Skip to content

chore: skip home.md and index.md files in root export#87

Merged
hthai2201 merged 1 commit into
refactor/nextjs-blog-enginefrom
chore/remove-home-export
Apr 1, 2025
Merged

chore: skip home.md and index.md files in root export#87
hthai2201 merged 1 commit into
refactor/nextjs-blog-enginefrom
chore/remove-home-export

Conversation

@monotykamary

@monotykamary monotykamary commented Apr 1, 2025

Copy link
Copy Markdown
Collaborator

Purpose

This PR enhances the export process by skipping home.md and index.md files that would be created at the root level of the export path.

Changes

  • Added logic to check if a file would export as home.md or index.md at the root level
  • Implemented a skip mechanism for these files with appropriate logging
  • Added cache entries for skipped files to prevent repeated processing

Why

Having home.md or index.md at the root level can cause conflicts with the NextJS blog engine, which has its own handling for these files. This change ensures a cleaner export that works better with the NextJS architecture.

Testing

Export process successfully skips root-level home.md and index.md files while continuing to process all other files normally.

@monotykamary monotykamary force-pushed the chore/remove-home-export branch from 9bffd9e to 6bba821 Compare April 1, 2025 09:41
@hthai2201 hthai2201 merged commit 00ed9e6 into refactor/nextjs-blog-engine Apr 1, 2025
monotykamary added a commit that referenced this pull request Apr 1, 2025
* chore: clean up and remove hugo and prep for next.js

* chore: instantiate next.js and move compiler to lib

* feat: add markdown plugins

* chore: add first example compile

* feat: implement dynamic slug md gen

* feat: add hyparquet and add pattern for mentioned-in/backlinks

* chore: remove mix deps and build

* chore: update make and gitignore

* refactor: compartmentalize utility functions

* chore: prep for incremental builds and allow embedding regen

* chore: update vault duckdb

* chore: prep for incremental markdown builds

* chore: prep for incremental builds p2

* feat: add incremental relative path builds

* feat: cache asset folders and format

* chore: remove cache log

* chore: add back watch-run with dual compilation

* chore: add pnpm

* fix: make builds work

* chore: remove app router version

* fix: default to pages router to prep for incremnetal builds

* chore: add make run

* chore: remove mdx and refresh next config and tailwind

* feat: move compilation to public folder for easy access

* fix: backlinks logic and paths

* feat: add submodule caching to git-fetch script

- Added a caching mechanism to git-fetch.sh that checks timestamps
- Created .submodule_update_cache file to track last update time
- Set update interval to 1 hour to reduce unnecessary pulls
- Added support for --force flag to bypass cache
- Added .submodule_update_cache to .gitignore

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: add force option for git fetch

* feat: import base Hugo styling into Next.js components

First draft of migrating our memo styles from Hugo to Next.js. This commit adds:
- Layout components (RootLayout, ContentLayout, Sidebar, CommandPalette)
- Base styling with Tailwind CSS
- Initial command palette implementation
- Updated homepage to match Hugo design

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: update styling foundations to latest changes

* fix: resolve ESLint errors in Next.js components

- Fix unused variables warnings
- Fix dependency array warnings with useCallback
- Reorder function declaration to prevent ReferenceError
- Replace 'any' type with 'unknown' for better type safety

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* style: make it absolute for now

* fix: eslint errors and theme endless loop

* chore: update pnpm

* chore: cherry-pick arweave columns

* feat: improve Hugo compatibility with _index.md support

- Support directory index pages with _index.md files
- Add handling for Hugo's content structure in path resolution
- Configure pnpm built dependencies for sharp

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: continue aligning styles

* chore: cherry-pick dispatch workflow

* chore: cherry-pick autogen _index

* chore: format

* feat: add contributor file generation from main

- Cherry-picked the contributor file generation functionality from main branch
- Added function to create contributor pages based on authors data from DuckDB
- Removed @doc comments from private functions to maintain consistent style

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: wrong func def

* fix: handle README.md to _index.md conversion properly and prevent conflicts with existing _index.md files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: update submodule

* chore: move index/readme logic to next.js path resolution

* chore: update vault

* refactor: migrate layout components to NextJS with Tailwind

- Convert Hugo template layout components to React components
- Convert SCSS styles to Tailwind CSS
- Implement theme switching, reading mode, and command palette
- Fix layout issues with sidebars and duplicated components
- Implement responsive design for all viewports

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: align Next.js implementation with Hugo design

- Fixed font families to better match Hugo implementation
- Corrected content font to Charter (serif) for main content and headers
- Fixed UI components to use Public Sans consistently
- Added proper styling for content and tags
- Included assets folder from Hugo site

* chore: remove artifacts from hugo

* feat: add markdown table support

Added remark-gfm to process GitHub Flavored Markdown including tables, and configured rehype-sanitize schema to allow table HTML elements.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: improve theme toggling for consistent text rendering

- Updated theme system to consistently apply both class and data-attribute
- Ensured CSS variables are properly applied in both light and dark modes
- Fixed immediate theme changes without requiring page refresh

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: remove system theme

* fix: improve search bar for consistent behavior

- Use React Portal to render search modal outside of normal DOM flow
- Fix scrolling issues when opening and closing search
- Center and properly style the search palette
- Add proper z-index to ensure visibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: remove bottom border from header

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: align header controls to the right

- Added container for sidebar toggle and mobile logo
- Applied ml-auto to controls to push them to the right side

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: remove text centering for title and description

- Removed conditional text-center class when hideFrontmatter is true
- Maintained consistent left-aligned styling regardless of frontmatter visibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: add menu and search utilities

* chore: add prettier and format command

* chore: run format

* chore: add husky and prettier as dependencies

* chore: update theme config (#74)

* chore: remove docs and fix build

* feat: add rss generator

* feat: layout (#75)

* fix: theme context

* feat: sidebar

* feat: menu

* feat: metadata

* feat: metadata

* fix: overlay

* feat: directory tree (#77)

* feat: home

* feat: pinned and tags

* fix: use session storage

* fix: directory tree title

* feat: single page (#79)

* fix: init

* feat: img zoom

* feat: katex

* fix: katex

* feat: single page widgets (#80)

* feat: single page widgets

* fix: toast style

* fix: toast ui 2

* fix: remove log and fallback backlink title

* feat: search (#81)

* feat: init

* fix: preview content

* fix: keyboard navigate

* fix: responsive

* fix: nav prev

* fix: break file

* fix: search

* fix: search not found ui

* fix: search content

* feat: home page (#83)

* feat: 404 page

* feat: home

* fix: comment error

* fix: single page style

* fix: ensure embeddings arrays always have correct size for DuckDB export

- Fix empty embedding arrays in AIUtils with appropriate zero-filled arrays
- Improve serialize_array to handle empty arrays in ExportDuckDB
- Ensure embeddings match expected dimensions (1024 for Jina, 1536 for OpenAI)
- Resolves 'Cannot cast list with length 0 to array with length 1024' error

* feat: tags, contributors and listing page (#85)

* feat: tags page

* feat: tag detail

* feat: contributors

* fix: path and contributor detail page

* feat: listing page

* fix: limit

* fix: slug

* fix: truncate

* fix: tag dot

* feat: update favicon (#86)

* chore: remove home.md and index.md from being exported (#87)

* perf(command-palette): static gen index and resolve navigation issues (#84)

* chore: update workflow name

* chore: update pnpm and build

* fix: make sure we install frozen

* perf: build search index separately

* fix(command-palette): resolve navigation issues and prevent browser tab closure

* fix(markdown): handle empty tags in frontmatter to prevent build errors

* chore: yolo the lockfile

* chore: update publish_dir to next.js export out

* fix(build): optimize page data and fix date serialization

- Add excludeContent option to reduce page data size

- Fix date serialization for undefined dates

- Apply optimizations to tags and contributor pages

* fix(build): handle case-insensitive contributor paths

- Store contributor paths in lowercase to avoid case sensitivity issues

- Add case-insensitive path filtering in catch-all route

- Preserve original contributor name case for display

* fix(build): handle case-insensitive tag paths

- Store tags in lowercase and normalize paths

- Add case-insensitive path filtering for tags

- Preserve original tag case for display

- Exclude tag paths from catch-all route

* fix(build): normalize tag URLs in UI

- Update tag links to use lowercase and hyphenated paths

- Preserve original tag case for display

* chore: reintroduce files from merge and update packages + submodules

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Thanh Hai <hthai2201@gmail.com>
Co-authored-by: hthai2201 <56551188+hthai2201@users.noreply.github.com>
Co-authored-by: Thanh Pham <zlatan.pham@gmail.com>
@tieubao tieubao deleted the chore/remove-home-export branch April 3, 2025 06:57
tieubao pushed a commit that referenced this pull request Apr 3, 2025
* chore: clean up and remove hugo and prep for next.js

* chore: instantiate next.js and move compiler to lib

* feat: add markdown plugins

* chore: add first example compile

* feat: implement dynamic slug md gen

* feat: add hyparquet and add pattern for mentioned-in/backlinks

* chore: remove mix deps and build

* chore: update make and gitignore

* refactor: compartmentalize utility functions

* chore: prep for incremental builds and allow embedding regen

* chore: update vault duckdb

* chore: prep for incremental markdown builds

* chore: prep for incremental builds p2

* feat: add incremental relative path builds

* feat: cache asset folders and format

* chore: remove cache log

* chore: add back watch-run with dual compilation

* chore: add pnpm

* fix: make builds work

* chore: remove app router version

* fix: default to pages router to prep for incremnetal builds

* chore: add make run

* chore: remove mdx and refresh next config and tailwind

* feat: move compilation to public folder for easy access

* fix: backlinks logic and paths

* feat: add submodule caching to git-fetch script

- Added a caching mechanism to git-fetch.sh that checks timestamps
- Created .submodule_update_cache file to track last update time
- Set update interval to 1 hour to reduce unnecessary pulls
- Added support for --force flag to bypass cache
- Added .submodule_update_cache to .gitignore

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: add force option for git fetch

* feat: import base Hugo styling into Next.js components

First draft of migrating our memo styles from Hugo to Next.js. This commit adds:
- Layout components (RootLayout, ContentLayout, Sidebar, CommandPalette)
- Base styling with Tailwind CSS
- Initial command palette implementation
- Updated homepage to match Hugo design

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: update styling foundations to latest changes

* fix: resolve ESLint errors in Next.js components

- Fix unused variables warnings
- Fix dependency array warnings with useCallback
- Reorder function declaration to prevent ReferenceError
- Replace 'any' type with 'unknown' for better type safety

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* style: make it absolute for now

* fix: eslint errors and theme endless loop

* chore: update pnpm

* chore: cherry-pick arweave columns

* feat: improve Hugo compatibility with _index.md support

- Support directory index pages with _index.md files
- Add handling for Hugo's content structure in path resolution
- Configure pnpm built dependencies for sharp

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: continue aligning styles

* chore: cherry-pick dispatch workflow

* chore: cherry-pick autogen _index

* chore: format

* feat: add contributor file generation from main

- Cherry-picked the contributor file generation functionality from main branch
- Added function to create contributor pages based on authors data from DuckDB
- Removed @doc comments from private functions to maintain consistent style

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: wrong func def

* fix: handle README.md to _index.md conversion properly and prevent conflicts with existing _index.md files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: update submodule

* chore: move index/readme logic to next.js path resolution

* chore: update vault

* refactor: migrate layout components to NextJS with Tailwind

- Convert Hugo template layout components to React components
- Convert SCSS styles to Tailwind CSS
- Implement theme switching, reading mode, and command palette
- Fix layout issues with sidebars and duplicated components
- Implement responsive design for all viewports

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: align Next.js implementation with Hugo design

- Fixed font families to better match Hugo implementation
- Corrected content font to Charter (serif) for main content and headers
- Fixed UI components to use Public Sans consistently
- Added proper styling for content and tags
- Included assets folder from Hugo site

* chore: remove artifacts from hugo

* feat: add markdown table support

Added remark-gfm to process GitHub Flavored Markdown including tables, and configured rehype-sanitize schema to allow table HTML elements.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: improve theme toggling for consistent text rendering

- Updated theme system to consistently apply both class and data-attribute
- Ensured CSS variables are properly applied in both light and dark modes
- Fixed immediate theme changes without requiring page refresh

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: remove system theme

* fix: improve search bar for consistent behavior

- Use React Portal to render search modal outside of normal DOM flow
- Fix scrolling issues when opening and closing search
- Center and properly style the search palette
- Add proper z-index to ensure visibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: remove bottom border from header

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: align header controls to the right

- Added container for sidebar toggle and mobile logo
- Applied ml-auto to controls to push them to the right side

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: remove text centering for title and description

- Removed conditional text-center class when hideFrontmatter is true
- Maintained consistent left-aligned styling regardless of frontmatter visibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: add menu and search utilities

* chore: add prettier and format command

* chore: run format

* chore: add husky and prettier as dependencies

* chore: update theme config (#74)

* chore: remove docs and fix build

* feat: add rss generator

* feat: layout (#75)

* fix: theme context

* feat: sidebar

* feat: menu

* feat: metadata

* feat: metadata

* fix: overlay

* feat: directory tree (#77)

* feat: home

* feat: pinned and tags

* fix: use session storage

* fix: directory tree title

* feat: single page (#79)

* fix: init

* feat: img zoom

* feat: katex

* fix: katex

* feat: single page widgets (#80)

* feat: single page widgets

* fix: toast style

* fix: toast ui 2

* fix: remove log and fallback backlink title

* feat: search (#81)

* feat: init

* fix: preview content

* fix: keyboard navigate

* fix: responsive

* fix: nav prev

* fix: break file

* fix: search

* fix: search not found ui

* fix: search content

* feat: home page (#83)

* feat: 404 page

* feat: home

* fix: comment error

* fix: single page style

* fix: ensure embeddings arrays always have correct size for DuckDB export

- Fix empty embedding arrays in AIUtils with appropriate zero-filled arrays
- Improve serialize_array to handle empty arrays in ExportDuckDB
- Ensure embeddings match expected dimensions (1024 for Jina, 1536 for OpenAI)
- Resolves 'Cannot cast list with length 0 to array with length 1024' error

* feat: tags, contributors and listing page (#85)

* feat: tags page

* feat: tag detail

* feat: contributors

* fix: path and contributor detail page

* feat: listing page

* fix: limit

* fix: slug

* fix: truncate

* fix: tag dot

* feat: update favicon (#86)

* chore: remove home.md and index.md from being exported (#87)

* perf(command-palette): static gen index and resolve navigation issues (#84)

* chore: update workflow name

* chore: update pnpm and build

* fix: make sure we install frozen

* perf: build search index separately

* fix(command-palette): resolve navigation issues and prevent browser tab closure

* fix(markdown): handle empty tags in frontmatter to prevent build errors

* chore: yolo the lockfile

* chore: update publish_dir to next.js export out

* fix(build): optimize page data and fix date serialization

- Add excludeContent option to reduce page data size

- Fix date serialization for undefined dates

- Apply optimizations to tags and contributor pages

* fix(build): handle case-insensitive contributor paths

- Store contributor paths in lowercase to avoid case sensitivity issues

- Add case-insensitive path filtering in catch-all route

- Preserve original contributor name case for display

* fix(build): handle case-insensitive tag paths

- Store tags in lowercase and normalize paths

- Add case-insensitive path filtering for tags

- Preserve original tag case for display

- Exclude tag paths from catch-all route

* fix(build): normalize tag URLs in UI

- Update tag links to use lowercase and hyphenated paths

- Preserve original tag case for display

* chore: reintroduce files from merge and update packages + submodules

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Thanh Hai <hthai2201@gmail.com>
Co-authored-by: hthai2201 <56551188+hthai2201@users.noreply.github.com>
Co-authored-by: Thanh Pham <zlatan.pham@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants