Skip to content

Commit

Permalink
Merge pull request #44 from zernonia/43-improvement-obtain-showcase-c…
Browse files Browse the repository at this point in the history
…ard-metadata-from-docs

chore: obtain showcase card metadata from docs
  • Loading branch information
zernonia authored Jun 5, 2023
2 parents 7f710d9 + 19d9e70 commit 16805ff
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 80 deletions.
9 changes: 1 addition & 8 deletions website/components/AuthUi/Showcase.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts"></script>

<template>
<ShowcaseCard class="group" to="/docs/components/auth-ui">
<ShowcaseCard slug="auth-ui">
<template #image>
<div>
<div
Expand Down Expand Up @@ -31,12 +31,5 @@
</div>
</div>
</template>

<h5 class="font-semibold">
Auth UI
</h5>
<p class="text-sm mt-1 text-gray-400">
Primitive Auth UI with Social Providers and Native Form.
</p>
</ShowcaseCard>
</template>
9 changes: 1 addition & 8 deletions website/components/MarqueeBanner/Showcase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
</script>

<template>
<ShowcaseCard to="/docs/components/marquee-banner">
<ShowcaseCard slug="marquee-banner">
<template #image>
<div class="overflow-hidden absolute fade-edge w-full">
<div class="flex">
Expand All @@ -18,12 +18,5 @@
</div>
</div>
</template>

<h5 class="font-semibold">
Marquee Banner
</h5>
<p class="text-sm mt-1 text-gray-400">
Simple and easy marquee effect.
</p>
</ShowcaseCard>
</template>
9 changes: 1 addition & 8 deletions website/components/PageProgress/Showcase.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts"></script>

<template>
<ShowcaseCard to="/docs/components/page-progress">
<ShowcaseCard slug="page-progress">
<template #image>
<div>
<div class="absolute top-10 right-8 font-bold text-4xl text-blue-300">
Expand All @@ -10,12 +10,5 @@
<div class="bg-white mt-10 w-64 h-28 border rounded-xl" />
</div>
</template>

<h5 class="font-semibold">
Page progress
</h5>
<p class="text-sm mt-1 text-gray-400">
Progress bar based on window scroll or element scroll.
</p>
</ShowcaseCard>
</template>
20 changes: 1 addition & 19 deletions website/components/Preview/Showcase.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<script setup lang="ts">
// TODO: move these into Showcase Card
const componentSlug = 'preview'
const { data } = await useAsyncData(`showcase-${componentSlug}`, () => queryContent(`/docs/components/${componentSlug}`).only(['title', 'description', '_path', 'new']).findOne())
</script>

<template>
<ShowcaseCard :to="data._path">
<ShowcaseCard slug="preview">
<template #image>
<div>
<div class="relative bg-white transition-all w-32 h-20 group-hover:scale-120 flex items-center justify-center text-gray-200 text-3xl border rounded-xl">
Expand All @@ -18,19 +14,5 @@ const { data } = await useAsyncData(`showcase-${componentSlug}`, () => queryCont
</div>
</div>
</template>

<h5 class="font-semibold">
{{ data.title }}
</h5>
<p class="text-sm mt-1 text-gray-400">
{{ data.description }}
</p>

<span
v-if="data.new"
class="absolute top-4 right-4 text-xs px-2 flex items-center rounded-full bg-blue-50 text-blue-400"
>
New
</span>
</ShowcaseCard>
</template>
23 changes: 19 additions & 4 deletions website/components/ShowcaseCard.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<script setup lang="ts">
defineProps<{
to: string
const props = defineProps<{
slug: string
}>()
const { slug } = toRefs(props)
const { data } = await useAsyncData(`showcase-${slug.value}`, () => queryContent(`/docs/components/${slug.value}`).only(['title', 'description', '_path', 'new']).findOne())
</script>

<template>
<NuxtLink :to="to">
<NuxtLink :to="data._path">
<div class="group relative border hover:border-blue-400 transition rounded-xl overflow-hidden h-full">
<div
class="h-48 relative flex items-center justify-center bg-grid bg-no-repeat bg-cover"
Expand All @@ -17,7 +20,19 @@ defineProps<{
</div>

<div class="p-4">
<slot> text </slot>
<h5 class="font-semibold">
{{ data.title }}
</h5>
<p class="text-sm mt-1 text-gray-400">
{{ data.description }}
</p>

<span
v-if="data.new"
class="absolute top-4 right-4 text-xs px-2 flex items-center rounded-full bg-blue-50 text-blue-400"
>
New
</span>
</div>
</div>
</NuxtLink>
Expand Down
10 changes: 1 addition & 9 deletions website/components/SocialShare/Showcase.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts"></script>

<template>
<ShowcaseCard to="/docs/components/social-share">
<ShowcaseCard slug="social-share">
<template #image>
<div class="text-blue-300 text-4xl flex space-x-2">
<Icon name="mdi:twitter" />
Expand All @@ -11,13 +11,5 @@
<Icon name="mdi:reddit" />
</div>
</template>

<h5 class="font-semibold">
Social Share
</h5>
<p class="text-sm mt-1 text-gray-400">
Primitive component to allow easy sharing for different social media
providers.
</p>
</ShowcaseCard>
</template>
9 changes: 1 addition & 8 deletions website/components/StaticTweet/Showcase.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts"></script>

<template>
<ShowcaseCard to="/docs/components/static-tweet">
<ShowcaseCard slug="static-tweet">
<template #image>
<div class="w-64 p-4 mt-12 border bg-white rounded-xl">
<div class="flex justify-between items-center">
Expand All @@ -21,12 +21,5 @@
<div class="h-12 w-full" />
</div>
</template>

<h5 class="font-semibold">
Static Tweet
</h5>
<p class="text-sm mt-1 text-gray-400">
Primitive component to render static tweet.
</p>
</ShowcaseCard>
</template>
9 changes: 1 addition & 8 deletions website/components/Toc/Showcase.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts"></script>

<template>
<ShowcaseCard to="/docs/components/table-of-contents">
<ShowcaseCard slug="table-of-contents">
<template #image>
<div class="px-4 py-6 flex flex-col space-y-2">
<div class="h-2 w-36 rounded-full bg-gray-100" />
Expand All @@ -11,12 +11,5 @@
<div class="ml-4 h-2 w-36 rounded-full bg-gray-100" />
</div>
</template>

<h5 class="font-semibold">
Table of Contents
</h5>
<p class="text-sm mt-1 text-gray-400">
Primitive component to build your own table of content easily.
</p>
</ShowcaseCard>
</template>
9 changes: 1 addition & 8 deletions website/components/WebsiteCard/Showcase.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts"></script>

<template>
<ShowcaseCard to="/docs/components/website-card">
<ShowcaseCard slug="website-card">
<template #image>
<div
class="mt-4 h-22 flex items-center border rounded-xl overflow-hidden"
Expand All @@ -19,12 +19,5 @@
</div>
</div>
</template>

<h5 class="font-semibold">
Website Card
</h5>
<p class="text-sm mt-1 text-gray-400">
Render website card similar to Notion Bookmark.
</p>
</ShowcaseCard>
</template>

1 comment on commit 16805ff

@vercel
Copy link

@vercel vercel bot commented on 16805ff Jun 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nuxt-lego – ./

nuxt-lego-git-main-zernonia.vercel.app
nuxt-lego.vercel.app
nuxt-lego-zernonia.vercel.app

Please sign in to comment.