mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-02 01:18:30 +02:00
Improve rendering of Markdownified docs (#2420)
* Improve rendering of Markdownified docs * Make frontmatter title rendering conditional
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
# {{ .Title }}
|
||||
|
||||
{{- $content := .RenderShortcodes -}}
|
||||
{{- /* Rewrite internal absolute links: ](/path/to/page/) → ](/path/to/page/index.md) */}}
|
||||
{{- $content = replaceRE `\]\((/[^):]*/)([\)#?])` `](${1}index.md${2}` $content -}}
|
||||
{{- if not (strings.TrimSpace $content) }}# {{ .Title }}
|
||||
{{ end -}}
|
||||
{{- /* Rewrite internal absolute links: ](/path/to/page/) → ](https://qdrant.tech/path/to/page/index.md) */}}
|
||||
{{- $content = replaceRE `\]\((/[^):]*/)([\)#?])` `](https://qdrant.tech${1}index.md${2}` $content -}}
|
||||
{{- /* Rewrite internal relative links: ](../page/) or (./page/) → same with index.md */}}
|
||||
{{- $content = replaceRE `\]\((\.\.?/[^):]*/)([\)#?])` `](${1}index.md${2}` $content -}}
|
||||
{{- $content = replaceRE `\]\((\.\.?/[^):]*/)([\)#?])` `](https://qdrant.tech/${1}index.md${2}` $content -}}
|
||||
{{ $content }}
|
||||
@@ -1,8 +1,8 @@
|
||||
# {{ .Title }}
|
||||
|
||||
{{- $content := .RenderShortcodes -}}
|
||||
{{- /* Rewrite internal absolute links: ](/path/to/page/) → ](/path/to/page/index.md) */}}
|
||||
{{- $content = replaceRE `\]\((/[^):]*/)([\)#?])` `](${1}index.md${2}` $content -}}
|
||||
{{- if not (strings.TrimSpace $content) }}# {{ .Title }}
|
||||
{{ end -}}
|
||||
{{- /* Rewrite internal absolute links: ](/path/to/page/) → ](https://qdrant.tech/path/to/page/index.md) */}}
|
||||
{{- $content = replaceRE `\]\((/[^):]*/)([\)#?])` `](https://qdrant.tech${1}index.md${2}` $content -}}
|
||||
{{- /* Rewrite internal relative links: ](../page/) or (./page/) → same with index.md */}}
|
||||
{{- $content = replaceRE `\]\((\.\.?/[^):]*/)([\)#?])` `](${1}index.md${2}` $content -}}
|
||||
{{- $content = replaceRE `\]\((\.\.?/[^):]*/)([\)#?])` `](https://qdrant.tech/${1}index.md${2}` $content -}}
|
||||
{{ $content }}
|
||||
Reference in New Issue
Block a user