feat: details shortcode (#28)

* feat: details shortcode

* docs: add details shortcode page

* chore: update shortcodes page

* docs: update

* Revert "chore: update shortcodes page"

This reverts commit c005ad4cb1.
This commit is contained in:
Xin
2023-09-02 11:01:34 -04:00
committed by GitHub
parent 8e8f7f23c9
commit 3bcdf84ad4
5 changed files with 118 additions and 2 deletions

View File

@ -13,6 +13,7 @@ Hextra provides a collection of beautiful shortcodes to enhance your content.
{{< cards >}}
{{< card link="callout" title="Callout" icon="warning" >}}
{{< card link="cards" title="Cards" icon="card" >}}
{{< card link="details" title="Details" icon="chevron-right" >}}
{{< card link="filetree" title="FileTree" icon="folder-tree" >}}
{{< card link="icon" title="Icon" icon="badge-check" >}}
{{< card link="steps" title="Steps" icon="one" >}}

View File

@ -0,0 +1,43 @@
---
title: Details
---
A built-in component to display a collapsible content.
<!--more-->
## Example
{{% details title="Details" %}}
This is the content of the details.
Markdown is **supported**.
{{% /details %}}
{{% details title="Click me to reveal" closed="true" %}}
This will be hidden by default.
{{% /details %}}
## Usage
````
{{%/* details title="Details" */%}}
This is the content of the details.
Markdown is **supported**.
{{%/* /details */%}}
````
````
{{%/* details title="Click me to reveal" closed="true" */%}}
This will be hidden by default.
{{%/* /details */%}}
````

View File

@ -11,6 +11,7 @@
"cite",
"code",
"del",
"details",
"div",
"em",
"figcaption",
@ -44,6 +45,7 @@
"strong",
"style",
"sub",
"summary",
"sup",
"svg",
"table",
@ -80,10 +82,14 @@
"before:bg-gray-200",
"before:content-[\"\"]",
"before:content-['#']",
"before:content-['']",
"before:inline-block",
"before:inset-0",
"before:inset-y-1",
"before:mr-1",
"before:opacity-25",
"before:pointer-events-none",
"before:transition-transform",
"before:w-px",
"bg-black/[.05]",
"bg-blue-100",
@ -91,6 +97,7 @@
"bg-gradient-to-b",
"bg-gradient-to-r",
"bg-gray-100",
"bg-neutral-50",
"bg-orange-50",
"bg-primary-100",
"bg-primary-400",
@ -150,6 +157,7 @@
"cursor-default",
"cursor-pointer",
"dark:before:bg-neutral-800",
"dark:before:invert",
"dark:bg-blue-900/30",
"dark:bg-dark",
"dark:bg-dark/50",
@ -178,6 +186,7 @@
"dark:hidden",
"dark:hover:bg-gray-100/5",
"dark:hover:bg-neutral-700",
"dark:hover:bg-neutral-800",
"dark:hover:bg-neutral-900",
"dark:hover:bg-primary-100/5",
"dark:hover:bg-primary-700",
@ -250,6 +259,7 @@
"group-data-[theme=dark]:hidden",
"group-data-[theme=light]:hidden",
"group-hover/code:opacity-100",
"group-open:before:rotate-90",
"group/code",
"group/copybtn",
"grow",
@ -305,6 +315,7 @@
"justify-start",
"language-options",
"language-switcher",
"last-of-type:mb-0",
"leading-5",
"leading-6",
"leading-7",
@ -412,6 +423,7 @@
"overflow-y-auto",
"overscroll-contain",
"p-0.5",
"p-1",
"p-1.5",
"p-2",
"p-4",
@ -461,6 +473,7 @@
"rtl:-ml-4",
"rtl:-rotate-180",
"rtl:before:right-0",
"rtl:before:rotate-180",
"rtl:left-1.5",
"rtl:left-3",
"rtl:md:right-auto",
@ -523,6 +536,7 @@
"text-gray-800",
"text-gray-900",
"text-left",
"text-lg",
"text-orange-800",
"text-primary-800",
"text-red-900",