feat: add filetree component for shortcode

chore: update tailwind config and move hugo_stats
This commit is contained in:
Xin
2023-08-16 15:11:03 +01:00
parent 87ea9db336
commit db8374a724
10 changed files with 637 additions and 172 deletions

View 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>

View 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>

View 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>