feat(backlinks): improve backlink search patterns by monotykamary · Pull Request #95 · dwarvesf/memo.d.foundation · GitHub
Skip to content

feat(backlinks): improve backlink search patterns#95

Merged
monotykamary merged 1 commit into
mainfrom
feat/improve-backlinks-search
Apr 3, 2025
Merged

feat(backlinks): improve backlink search patterns#95
monotykamary merged 1 commit into
mainfrom
feat/improve-backlinks-search

Conversation

@monotykamary

@monotykamary monotykamary commented Apr 3, 2025

Copy link
Copy Markdown
Collaborator

Description

This PR improves the backlink search functionality in the memo.d.foundation platform by enhancing the pattern matching and filtering logic.

Changes

  • Added support for both original and slugified path matching in backlink detection
  • Enhanced regex patterns for more accurate backlink detection
  • Improved filtering logic for backlink entries to ensure better quality results

Technical Details

The changes focus on the getBacklinks function in src/lib/content/backlinks.ts, where we:

  1. Now handle both original and slugified versions of paths and slugs
  2. Improved the regex patterns to better match memo.d.foundation URLs
  3. Enhanced the filtering logic to ensure we only return valid backlinks

Testing

The changes have been tested with various scenarios including:

  • URLs with and without trailing slashes
  • Paths with special characters that need slugification
  • Different variations of markdown links and direct URLs

Impact

These improvements will result in:

  • More accurate backlink detection
  • Better handling of special characters in URLs
  • Reduced false positives in backlink matching

Additional Notes

This is a non-breaking change that enhances the existing functionality without modifying the API contract.

- Add support for both original and slugified path matching
- Enhance regex patterns for more accurate backlink detection
- Improve filtering logic for backlink entries
@monotykamary monotykamary force-pushed the feat/improve-backlinks-search branch from f5814d2 to 19feed2 Compare April 3, 2025 02:48
@monotykamary

Copy link
Copy Markdown
Collaborator Author

@monotykamary monotykamary merged commit 214ff5c into main Apr 3, 2025
tieubao pushed a commit that referenced this pull request Apr 3, 2025
- Add support for both original and slugified path matching
- Enhance regex patterns for more accurate backlink detection
- Improve filtering logic for backlink entries
@monotykamary monotykamary deleted the feat/improve-backlinks-search 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