mirror of
https://github.com/rustdesk/doc.rustdesk.com.git
synced 2026-04-11 10:16:04 +00:00
new theme
This commit is contained in:
26
layouts/shortcodes/children.html
Normal file
26
layouts/shortcodes/children.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{{/* Children shortcode - simple top-level cards with titles only */}}
|
||||
{{- $showhidden := .Get "showhidden" | default false -}}
|
||||
{{- $cols := (.Get "cols" | default "2") | int -}}
|
||||
|
||||
{{/* Get direct children only */}}
|
||||
{{- $pages := .Page.Pages -}}
|
||||
{{- if not $showhidden -}}
|
||||
{{- $pages = where .Page.Pages "Params.hidden" "!=" true -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Sort by weight */}}
|
||||
{{- $pages = sort $pages "Weight" -}}
|
||||
|
||||
{{- if $pages -}}
|
||||
{{/* Create Hextra cards container */}}
|
||||
<div class="hextra-cards hx:mt-4 hx:gap-4 hx:grid not-prose" style="--hextra-cards-grid-cols: {{ $cols }};">
|
||||
{{- range $pages -}}
|
||||
{{/* Use Hextra's card partial - title only, no subtitle */}}
|
||||
{{- partial "shortcodes/card.html" (dict
|
||||
"link" .RelPermalink
|
||||
"title" .Title
|
||||
"icon" (.Params.icon | default "document-text")
|
||||
) -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
17
layouts/shortcodes/notice.html
Normal file
17
layouts/shortcodes/notice.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{/*
|
||||
Notice shortcode for alerts/callouts (replacement for Learn theme)
|
||||
Uses Hextra's native GitHub-style alert system
|
||||
*/}}
|
||||
{{- $type := .Get 0 | default "note" -}}
|
||||
{{- $content := .Inner | strings.TrimSpace -}}
|
||||
|
||||
{{/* Map Learn theme notice types to Hextra alert types */}}
|
||||
{{- $alertType := $type -}}
|
||||
{{- if eq $type "info" -}}
|
||||
{{- $alertType = "note" -}}
|
||||
{{- else if eq $type "danger" -}}
|
||||
{{- $alertType = "caution" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Use Hextra's GitHub-style alert component */}}
|
||||
{{- partial "components/github-style-alert.html" (dict "content" ($content | markdownify) "alertType" $alertType "alertTitle" "") -}}
|
||||
Reference in New Issue
Block a user