Improve Markdown autodiscovery (#2186)

* Add HTTP response header

* Add HTML <head> link

* Add 'View as Markdown' link
This commit is contained in:
Abdon Pijpelink
2026-04-01 17:14:26 +02:00
committed by GitHub
parent a8ed107b87
commit 95d38aabfe
4 changed files with 15 additions and 0 deletions
@@ -53,6 +53,10 @@
<link href="{{ .RelPermalink }}" rel="feed" type="{{ .MediaType.Type }}" title="{{ $.Site.Title }}" />
{{ end }}
{{ with .OutputFormats.Get "Markdown" }}
<link rel="alternate" type="{{ .MediaType.Type }}" href="{{ .Permalink }}" title="{{ $.Page.Title }}" />
{{ end }}
{{ partial "seo_schema" . }}
{{ partial "js-head" . }}
</head>
@@ -24,6 +24,12 @@
{{ else }}
<ul class="table-of-contents__external-links">
{{ if or (eq .Section "documentation") (eq .Section "articles") }}
<li class="table-of-contents__link">
<a href="{{ .Permalink }}index.md" target="_blank">
{{ partial "svg" "markdown.svg" }}
View as Markdown
</a>
</li>
<li class="table-of-contents__link">
<a href="{{ .Site.Params.githubDocPrefix }}{{ path.Clean .File.Path }}" target="_blank">
{{ partial "svg" "github.svg" }}