Skip to content

Commit

Permalink
Synth pages
Browse files Browse the repository at this point in the history
  • Loading branch information
davay42 committed Oct 22, 2023
1 parent b0ace9f commit 92d36b9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
5 changes: 1 addition & 4 deletions [slug]/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ page_type: projects

<script setup>
import { useData } from 'vitepress'
import { computed } from 'vue'
const { params: p, frontmatter: f } = useData()

</script>

# {{ p.title }}
<SynthPage v-bind="p" />

<!-- @content -->

<pre class="text-xs">{{ p }}</pre>
2 changes: 1 addition & 1 deletion components/SynthCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ button.w-full.flex.flex-wrap.items-stretch.text-left.relative.bg-light-300.shado
.flex-1
.flex-1.flex.items-end.flex.flex-wrap.gap-2(v-if="tags?.length>0")
.px-2.py-1.text-sm.bg-light-800.dark-bg-dark-500.rounded-lg(v-for="tag in tags" :key="tag") {{ tag }}
a.p-1.bg-dark-300.absolute.bottom-2.right-2.rounded-full.opacity-10.hover-opacity-80.transition(@click.stop :href="`/${slug}/`")
</template>

<style scoped lang="postcss">
Expand Down
27 changes: 27 additions & 0 deletions components/SynthPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<script setup>
const props = defineProps({
title: { type: String, default: '' },
description: { type: String, default: '' },
author: { type: String, default: '' },
author_link: { type: String, default: '' },
cover: { type: String, default: '' },
slug: { type: String, default: '' },
url: { type: String, default: '' },
})
</script>

<template lang='pug'>
.flex.flex-col.gap-4
.p-0
img(:src="`/cover/${slug}.webp`")
.flex.flex-col
.text-4xl.font-bold {{ title }}
component.text-xl(
v-if="author"
:is="author_link ? 'a' : 'div'"
:href="author_link") by {{ author }}
a(:href="url" target="_blank") {{ url }}
.p-0(v-if="description") {{ description }}
.p-0
slot
</template>

0 comments on commit 92d36b9

Please sign in to comment.