Init
This commit is contained in:
11
themes/hextra/layouts/_shortcodes/filetree/container.html
Normal file
11
themes/hextra/layouts/_shortcodes/filetree/container.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{- /*
|
||||
A file tree container.
|
||||
|
||||
@example {{< filetree/container >}}{{< /filetree/container >}}
|
||||
*/ -}}
|
||||
|
||||
<div class="hextra-filetree hx:mt-6 hx:select-none hx:text-sm hx:text-gray-800 hx:dark:text-gray-300 not-prose">
|
||||
<div class="hx:inline-block hx:rounded-lg hx:px-4 hx:py-2 hx:border hx:border-gray-200 hx:dark:border-neutral-800">
|
||||
{{- .InnerDeindent -}}
|
||||
</div>
|
||||
</div>
|
||||
16
themes/hextra/layouts/_shortcodes/filetree/file.html
Normal file
16
themes/hextra/layouts/_shortcodes/filetree/file.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{{- /*
|
||||
A file in a file tree.
|
||||
|
||||
@param {string} name The name of the file.
|
||||
|
||||
@example {{< filetree/file name="_index.md" >}}
|
||||
*/ -}}
|
||||
|
||||
{{- $name := .Get "name" -}}
|
||||
|
||||
<li class="hx:flex hx:list-none">
|
||||
<span class="hx:inline-flex hx:cursor-default hx:items-center hx:py-1">
|
||||
{{- partial "utils/icon" (dict "name" "document-text" "attributes" "width=1em") -}}
|
||||
<span class="hx:ltr:ml-1 hx:rtl:mr-1">{{ $name | markdownify }}</span>
|
||||
</span>
|
||||
</li>
|
||||
26
themes/hextra/layouts/_shortcodes/filetree/folder.html
Normal file
26
themes/hextra/layouts/_shortcodes/filetree/folder.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{{- /*
|
||||
A folder in a file tree.
|
||||
|
||||
@param {string} name The name of the folder.
|
||||
@param {string} state The state of the folder.
|
||||
|
||||
@example {{< filetree/folder name="docs" state="closed" >}}
|
||||
*/ -}}
|
||||
|
||||
{{- $name := .Get "name" -}}
|
||||
{{- $state := .Get "state" | default "open" }}
|
||||
|
||||
<li class="hx:group hx:flex hx:list-none hx:flex-col">
|
||||
<button class="hextra-filetree-folder hx:inline-flex hx:cursor-pointer hx:items-center hx:py-1 hx:hover:opacity-60">
|
||||
<span data-state="{{ $state }}" class="hx:data-[state=open]:hidden">
|
||||
{{- partial "utils/icon" (dict "name" "folder" "attributes" "width=1em") -}}
|
||||
</span>
|
||||
<span data-state="{{ $state }}" class="hx:data-[state=closed]:hidden">
|
||||
{{- partial "utils/icon" (dict "name" "folder-open" "attributes" "width=1em") -}}
|
||||
</span>
|
||||
<span class="hx:ltr:ml-1 hx:rtl:mr-1">{{ $name }}</span>
|
||||
</button>
|
||||
<ul data-state="{{ $state }}" class="hx:ltr:pl-5 hx:rtl:pr-5 hx:data-[state=closed]:hidden">
|
||||
{{- .InnerDeindent -}}
|
||||
</ul>
|
||||
</li>
|
||||
Reference in New Issue
Block a user