mirror of
https://github.com/rustdesk/doc.rustdesk.com.git
synced 2026-04-03 06:16:08 +00:00
22 lines
819 B
HTML
22 lines
819 B
HTML
{{- $page := . -}}
|
|
{{- $items := slice -}}
|
|
{{- $raw := $page.RawContent | default "" -}}
|
|
{{- if and (or $page.IsPage $page.IsSection) $raw -}}
|
|
{{- $raw = replaceRE "(?ms)```.*?```" "\n" $raw -}}
|
|
{{- range findRE `(?m)^#{2,3}\s+.+$` $raw -}}
|
|
{{- if lt (len $items) 12 -}}
|
|
{{- $rawLine := replaceRE `^#{2,3}\s+` "" . | markdownify | plainify | htmlUnescape | replaceRE "\\s+" " " | chomp -}}
|
|
{{- $line := partial "utils/clean-structured-label.html" $rawLine -}}
|
|
{{- if gt (len $line) 2 -}}
|
|
{{- $items = $items | append (dict
|
|
"@type" "ListItem"
|
|
"position" (add (len $items) 1)
|
|
"name" $line
|
|
"url" (printf "%s#%s" $page.Permalink ($rawLine | anchorize))
|
|
) -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- return $items -}}
|