class

Hwaro::Services::InternalLinkIndex

Inherits Reference < Object

The @/ link targets a default hwaro build resolves.

The build rewrites href="@/posts/hello.md" by looking posts/hello.md up in its content-path → page map (InternalLinkResolver.resolve over build_pages_by_path, through InternalLinkResolver.page_for). That lookup is exact apart from percent-decoding: Markd encodes a destination, so @/my%20post.md is tried as my post.md first, then as written. It is case-sensitive, does no ./ or ../ normalization, no guessing of an extension or an _index.md, and the map only holds pages and sections that survived draft, future and expired filtering. The tools used to test file existence instead, so they passed @/draft.md, @/UPPER.md (on a case-insensitive filesystem), @/./x.md and @/../README.md — every one a link the build leaves unresolved.

The keys come from ContentLister, the publish-state source of truth for authored files, plus the planned [[content.generate]] pages.

Constructors

new(content_dir : String)
Source

Class methods

describe(reason : String) : String

Human wording for an unresolved_reason.

Source
key(destination : String) : String | Nil

The content path an @/ destination looks up: the part before #, then before ?, split exactly as InternalLinkResolver does. nil when destination is not an @/ link.

Source

Instance methods

unresolved_reason(key : String) : String | Nil

nil when a default build resolves key. Otherwise why it does not: "empty link", "not found", or the target's publish state ("draft", "future", "expired").

Source