dpeter99 / dpeter99/archivist

Backlinks Tracking Step

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Context

Users want to see which pages link to the current page (backlinks). This requires tracking all outgoing links and computing the reverse mapping.

## Requirements

1. Create a step that runs after markdown rendering
2. Parse HTML to extract all internal links
3. Build a map of URL → pages that link to it
4. Store in pipeline context for template access

## Acceptance Criteria

- [ ] Each content object has `backlinks` array after step runs
- [ ] Each content object has `outgoingLinks` array
- [ ] Backlinks contain URL and title of linking page
- [ ] Only internal links are tracked (not external URLs)
- [ ] Relative links are resolved correctly
- [ ] Anchor fragments are stripped from URLs

## Test Cases

1. Page A links to Page B → Page B's backlinks includes Page A
2. Page A links to Page B twice → Page B's backlinks includes Page A once
3. Page A links to external site → Not included in backlinks

## Notes

This step needs to parse rendered HTML, so it must run after MarkdownRenderStep. Consider saving the hast html AST from the markdown step, to avoid parsing twice.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.