Files
arkanum/docs/.vitepress/theme/components/Posts.vue
OCram85 04a741bcea
All checks were successful
ci/woodpecker/push/docs Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful
update blog + bump golang (#108)
### 📖 Summary

- bump used golang version
- use blog section title as slot.
- remove draft post	2
- fix typo
- add faq content

### 📑 Test Plan

 CI pipeline tests (Default)

### 💬 Details

_No response_

### 📚 Additional Notes

_No response_

Reviewed-on: #108
2024-06-11 16:07:10 +02:00

58 lines
1.2 KiB
Vue

<script setup>
import { data } from './posts.data.js'
import Post from './Post.vue'
const props = defineProps({
tagFilter: {
type: String,
default: 'none',
},
featured: {
type: Boolean,
default: false,
},
})
const posts = data.filter((el) => {
if (!props.featured) {
if (props.tagFilter.toLowerCase() === 'none') {
return true
} else if (props.tagFilter.toLowerCase() === el.frontmatter.tag.toLowerCase()) {
return true
} else {
return false
}
} else {
if (el.frontmatter.featured) {
return true
} else return false
}
})
</script>
<template>
<slot v-if="posts.length">
<h2 v-if="posts.length > 0">All Posts</h2>
</slot>
<section class="card-container">
<Post
:image="post.frontmatter.image"
:title="post.frontmatter.title"
:tag="post.frontmatter.tag"
:url="post.url"
:date="post.frontmatter.date"
:author="post.frontmatter.author"
v-for="post in posts"
/>
</section>
</template>
<style scoped>
.card-container {
display: flex;
justify-content: center;
flex-wrap: wrap;
flex-direction: row;
}
</style>