Skip to content

Improve support for markdown urls#21

Open
amorey wants to merge 4 commits into
corsfix:mainfrom
amorey:patch
Open

Improve support for markdown urls#21
amorey wants to merge 4 commits into
corsfix:mainfrom
amorey:patch

Conversation

@amorey

@amorey amorey commented Feb 23, 2026

Copy link
Copy Markdown

This PR supersedes two previous PRs (#19, #20) and implements the full feature set as three separate commits:

  • A commit to inject markdown link tags into server-side html (5294b6c)
  • A commit to use {url}.md url format when astro config trailingSlash: 'never' (5dc21ec)
  • A commit to add support for {url}.md urls to the link tags (96b21ff)

Overall, the goal of this PR is to add support for {url}.md formatted urls when trailingSlash: 'never' and to embed <link rel="alternante" type="text/markdown"> tags in the server-side HTML to make it easier for bots to discover the markdown endpoints.

Changes

  • The package now looks at the trailingSlash option at initialization time and if trailingSlash: 'never' it injects routes at {url}.md instead of {url}/index.md
  • Introduces a getMarkdownUrl() method that accepts trailingSlash as an option
  • Replaces DEFAULT_ACTIONS constant, with a makeDefaultActions() method to generate the actions at initialization time when the value of trailingSlash is known
  • Introduces a wrapper around the default Starlight Head component to inject <link rel="alternate" type="text/markdown"> tags into server-side html

Signed-off-by: Andres Morey <andres@kubetail.com>
new: Inject *.md routes when trailingSlash is 'never'
new: Add getMarkdownUrl() method
ref: Replace DEFAULT_ACTIONS constant with makeActions() method

Signed-off-by: Andres Morey <andres@kubetail.com>
Signed-off-by: Andres Morey <andres@kubetail.com>
Signed-off-by: Andres Morey <andres@kubetail.com>
@amorey

amorey commented Mar 1, 2026

Copy link
Copy Markdown
Author

We're using this patch live here: https://www.kubetail.com. If you can merge into main we can switch back to the upstream package.

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