Commit 304ac1badc
Unsigned
Layout: unified · split
docs/.vitepress/theme/components/Collapsible.vue +2 −31
| @@ -1,19 +1,11 @@ | |||
| 1 | <script setup lang="ts"> | 1 | <script setup lang="ts"> |
| 2 | import { computed, ref } from 'vue' | 2 | import { ref } from 'vue' |
| 3 | 3 | ||
| 4 | const props = defineProps<{ | 4 | const props = defineProps<{ |
| 5 | title?: string | 5 | title?: string |
| 6 | }>() | 6 | }>() |
| 7 | 7 | ||
| 8 | const open = ref(false) | 8 | const open = ref(false) |
| 9 | |||
| 10 | const slug = computed(() => { | ||
| 11 | const text = props.title || 'Details' | ||
| 12 | return text | ||
| 13 | .toLowerCase() | ||
| 14 | .replace(/\s+/g, '-') | ||
| 15 | .replace(/[^\w-]/g, '') | ||
| 16 | }) | ||
| 17 | </script> | 9 | </script> |
| 18 | 10 | ||
| 19 | <template> | 11 | <template> |
| @@ -21,10 +13,7 @@ const slug = computed(() => { | |||
| 21 | <summary> | 13 | <summary> |
| 22 | <span v-if="open" class="i-iconoir-nav-arrow-down collapsible-icon" /> | 14 | <span v-if="open" class="i-iconoir-nav-arrow-down collapsible-icon" /> |
| 23 | <span v-else class="i-iconoir-nav-arrow-right collapsible-icon" /> | 15 | <span v-else class="i-iconoir-nav-arrow-right collapsible-icon" /> |
| 24 | <h3 :id="slug" class="collapsible-title"> | 16 | {{ title || 'Details' }} |
| 25 | <a :href="`#${slug}`" class="header-anchor" aria-hidden="true"></a> | ||
| 26 | {{ title || 'Details' }} | ||
| 27 | </h3> | ||
| 28 | </summary> | 17 | </summary> |
| 29 | <slot /> | 18 | <slot /> |
| 30 | </details> | 19 | </details> |
| @@ -48,22 +37,4 @@ summary::-webkit-details-marker { | |||
| 48 | height: 1em; | 37 | height: 1em; |
| 49 | flex-shrink: 0; | 38 | flex-shrink: 0; |
| 50 | } | 39 | } |
| 51 | |||
| 52 | .collapsible-title { | ||
| 53 | margin: 0; | ||
| 54 | padding: 0; | ||
| 55 | font-size: inherit; | ||
| 56 | font-weight: inherit; | ||
| 57 | line-height: inherit; | ||
| 58 | color: inherit; | ||
| 59 | letter-spacing: inherit; | ||
| 60 | border: none; | ||
| 61 | text-decoration: none; | ||
| 62 | display: inline; | ||
| 63 | } | ||
| 64 | |||
| 65 | /* Hide the anchor icon VitePress would normally show on hover */ | ||
| 66 | .collapsible-title .header-anchor { | ||
| 67 | display: none; | ||
| 68 | } | ||
| 69 | </style>\ No newline at end of file | 40 | </style>\ No newline at end of file |
docs/websites.md +1 −1
| @@ -79,7 +79,7 @@ outline: 1 | |||
| 79 | 79 | ||
| 80 | <Collapsible title="Misc"> | 80 | <Collapsible title="Misc"> |
| 81 | 81 | ||
| 82 | ### Misc | 82 | <h3 style="display:none" id="more">More</h3> |
| 83 | 83 | ||
| 84 | | Category | Websites | | 84 | | Category | Websites | |
| 85 | | :--- | :--- | | 85 | | :--- | :--- | |