mirror of
https://github.com/imfing/hextra.git
synced 2025-06-20 04:31:25 -04:00
feat: add filetree component for shortcode
chore: update tailwind config and move hugo_stats
This commit is contained in:
@ -1,10 +1,11 @@
|
||||
{{- $jsTheme := resources.Get "js/theme.js" -}}
|
||||
{{- $jsMenu := resources.Get "js/menu.js" -}}
|
||||
{{- $jsCodeCopy := resources.Get "js/code-copy.js" -}}
|
||||
{{- $jsTabs := resources.Get "js/tabs.js" -}}
|
||||
{{- $jsLang := resources.Get "js/lang.js" -}}
|
||||
{{- $jsCodeCopy := resources.Get "js/code-copy.js" -}}
|
||||
{{- $jsFileTree := resources.Get "js/filetree.js" -}}
|
||||
|
||||
{{- $scripts := slice $jsTheme $jsMenu $jsCodeCopy $jsTabs $jsLang | resources.Concat "js/main.js" -}}
|
||||
{{- $scripts := slice $jsTheme $jsMenu $jsCodeCopy $jsTabs $jsLang $jsFileTree | resources.Concat "js/main.js" -}}
|
||||
{{- if hugo.IsProduction -}}
|
||||
{{- $scripts = $scripts | minify | fingerprint -}}
|
||||
{{- end -}}
|
||||
|
5
layouts/shortcodes/filetree/container.html
Normal file
5
layouts/shortcodes/filetree/container.html
Normal file
@ -0,0 +1,5 @@
|
||||
<div class="hextra-filetree mt-6 select-none text-sm text-gray-800 dark:text-gray-300 not-prose">
|
||||
<div class="inline-block rounded-lg border px-4 py-2 dark:border-neutral-800">
|
||||
{{- .Inner -}}
|
||||
</div>
|
||||
</div>
|
9
layouts/shortcodes/filetree/file.html
Normal file
9
layouts/shortcodes/filetree/file.html
Normal file
@ -0,0 +1,9 @@
|
||||
{{- $name := .Get "name" -}}
|
||||
|
||||
|
||||
<li class="flex list-none">
|
||||
<span class="inline-flex cursor-default items-center py-1">
|
||||
{{- partial "utils/icon" (dict "name" "document-text" "attributes" "width=1em") -}}
|
||||
<span class="ml-1">{{ $name }}</span>
|
||||
</span>
|
||||
</li>
|
17
layouts/shortcodes/filetree/folder.html
Normal file
17
layouts/shortcodes/filetree/folder.html
Normal file
@ -0,0 +1,17 @@
|
||||
{{- $name := .Get "name" -}}
|
||||
{{- $state := .Get "state" | default "open" }}
|
||||
|
||||
<li class="group flex list-none flex-col">
|
||||
<button class="hextra-filetree-folder inline-flex cursor-pointer items-center py-1 hover:opacity-60">
|
||||
<span data-state="{{ $state }}" class="data-[state=open]:hidden">
|
||||
{{- partial "utils/icon" (dict "name" "folder" "attributes" "width=1em") -}}
|
||||
</span>
|
||||
<span data-state="{{ $state }}" class="data-[state=closed]:hidden">
|
||||
{{- partial "utils/icon" (dict "name" "folder-open" "attributes" "width=1em") -}}
|
||||
</span>
|
||||
<span class="ml-1">{{ $name }}</span>
|
||||
</button>
|
||||
<ul data-state="{{ $state }}" class="pl-5 data-[state=closed]:hidden">
|
||||
{{- .Inner -}}
|
||||
</ul>
|
||||
</li>
|
Reference in New Issue
Block a user