-
Notifications
You must be signed in to change notification settings - Fork 38
Updating theme of the site #436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
781e2b9
550eb9a
b9b7b89
6eede2d
69f425d
5732dc0
19ebb86
14e031f
742a8ab
06aba7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "css.lint.unknownAtRules": "ignore", | ||
| "scss.lint.unknownAtRules": "ignore", | ||
| "less.lint.unknownAtRules": "ignore" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <script setup lang="ts"> | ||
| import { computed, useSlots } from "vue"; | ||
| import VoidZeroTheme from "@voidzero-dev/vitepress-theme"; | ||
|
|
||
| const BaseLayout = VoidZeroTheme.Layout; | ||
| const slots = useSlots(); | ||
| const forwardSlotNames = computed(() => Object.keys(slots) as string[]); | ||
| </script> | ||
|
|
||
| <template> | ||
| <BaseLayout> | ||
| <template v-for="name in forwardSlotNames" :key="name" #[name]="data"> | ||
| <slot :name="name" v-bind="data || {}" /> | ||
| </template> | ||
| </BaseLayout> | ||
| </template> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,27 @@ | ||
| <!-- @format --> | ||
|
|
||
| <script setup> | ||
| import { computed } from "vue"; | ||
| import * as LucideIcons from "lucide-vue-next"; | ||
|
|
||
| const props = defineProps({ | ||
| title: String, | ||
| icon: String, | ||
| /** Doc path or full URL */ | ||
| href: String, | ||
| /** Alias for `href` (common in markdown) */ | ||
| link: String, | ||
| /** When set, used instead of the default slot for body text */ | ||
| description: String, | ||
| /** Bottom link label (shown with →). Home feature cards only. */ | ||
| cta: String, | ||
| }); | ||
|
|
||
| const hasDestination = computed(() => Boolean((props.link || props.href || "").toString().trim())); | ||
|
|
||
| const resolvedHref = computed(() => { | ||
| const h = (props.link || props.href || "").toString().trim(); | ||
| return h; | ||
| }); | ||
|
|
||
| // Custom SVG icons for brands | ||
|
|
@@ -44,18 +60,23 @@ const IconComponent = computed(() => { | |
| </script> | ||
|
|
||
| <template> | ||
| <a :href="href" class="card-link"> | ||
| <div v-if="icon" class="card-icon"> | ||
| <!-- Render custom SVG if available --> | ||
| <component | ||
| :is="hasDestination ? 'a' : 'div'" | ||
| :href="hasDestination ? resolvedHref : undefined" | ||
| class="card-link" | ||
| :class="{ 'card-link--with-cta': cta }" | ||
| > | ||
|
Comment on lines
+63
to
+68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. External links open in same tab without The homepage uses ♻️ Proposed refinement+<script setup>
+// ...existing code...
+const isExternal = computed(() => /^https?:\/\//i.test(resolvedHref.value));
+</script>
<template>
<component
:is="hasDestination ? 'a' : 'div'"
:href="hasDestination ? resolvedHref : undefined"
+ :target="hasDestination && isExternal ? '_blank' : undefined"
+ :rel="hasDestination && isExternal ? 'noopener noreferrer' : undefined"
class="card-link"
:class="{ 'card-link--with-cta': cta }"
>🤖 Prompt for AI Agents |
||
| <div v-if="icon" class="card-icon" aria-hidden="true"> | ||
| <div v-if="customSvgIcons[icon]" v-html="customSvgIcons[icon]"></div> | ||
| <!-- Otherwise render Lucide icon --> | ||
| <component v-else :is="IconComponent" :size="24" /> | ||
| <component v-else :is="IconComponent" :size="24" stroke-width="1.5" /> | ||
| </div> | ||
| <h3 class="card-title"> | ||
| {{ title }} | ||
| </h3> | ||
| <p class="card-description"> | ||
| <h3 class="card-title">{{ title }}</h3> | ||
| <p v-if="description" class="card-description"> | ||
| {{ description }} | ||
| </p> | ||
| <p v-else class="card-description"> | ||
| <slot /> | ||
| </p> | ||
| </a> | ||
| <span v-if="cta" class="card-cta">{{ cta }} →</span> | ||
| </component> | ||
| </template> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
@voidzero-dev/vitepress-theme themeConfig.variant supported values list💡 Result:
The supported values for themeConfig.variant in
@voidzero-dev/vitepress-themeare strings corresponding to VoidZero projects, such as "viteplus", "vite", "vitest". Additional likely values based on project context include "rolldown" and "oxc", as the theme is designed for Vite+, Vite, Vitest, Rolldown, and Oxc. The variant controls branding colors and styling via CSS selectors like :root[data-variant="vite"]. Users import specific variants like '@voidzero-dev/vitepress-theme/src/vite' in the theme entry.Citations:
Change
variant: "voidzero"to a supported value.The
@voidzero-dev/vitepress-themepackage only supports variants:"vite","viteplus","vitest","rolldown", and"oxc". The variant"voidzero"is not recognized and will cause incorrect theme rendering or build failures. Use one of the supported variants that matches your target project.🤖 Prompt for AI Agents