fix(content): adjust backlink path and title logic by monotykamary · Pull Request #99 · dwarvesf/memo.d.foundation · GitHub
Skip to content

fix(content): adjust backlink path and title logic#99

Merged
monotykamary merged 1 commit into
mainfrom
fix/backlink-readme-title
Apr 3, 2025
Merged

fix(content): adjust backlink path and title logic#99
monotykamary merged 1 commit into
mainfrom
fix/backlink-readme-title

Conversation

@monotykamary

Copy link
Copy Markdown
Collaborator

This PR addresses two issues in the backlink generation logic within src/lib/content/backlinks.ts:

  1. Incorrect Path for README Files: Backlinks pointing to files named README.md (or similar variations like readme.md) were incorrectly including /readme in the final path (e.g., /careers/hiring/readme). This change ensures that such paths are correctly resolved to the parent directory (e.g., /careers/hiring).
  2. Incorrect Title Display: The title for some backlinks was defaulting to the filename component (e.g., "readme") instead of using the actual title defined in the markdown frontmatter or the database. The logic has been updated to prioritize the title fetched from the vault.parquet database first, then fall back to the markdown frontmatter title, and only use the path component as a last resort.

These changes improve the accuracy and presentation of backlinks in the "MENTIONED IN" section.

@monotykamary monotykamary merged commit 1085693 into main Apr 3, 2025
@monotykamary monotykamary deleted the fix/backlink-readme-title branch April 18, 2025 10:10
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.

1 participant