Skip to content

Commit

Permalink
Dynamic Tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jphetphoumy committed May 6, 2024
1 parent a6275be commit 6705ef0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
1 change: 0 additions & 1 deletion assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ a:hover {
/* Header and Navigation Styling */
header {
padding: 10px 20px;
background-color: #000; /* maintain the background across all major elements */
text-align: center;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
draft: false
date: 06-05-2024
tag: LLM
---

# Creating a simple chatbot with Langchain and Ollama
Expand Down
9 changes: 0 additions & 9 deletions content/articles/index.md

This file was deleted.

31 changes: 31 additions & 0 deletions pages/articles.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<script setup lang="ts">
import { computed } from 'vue'
const { data } = await useAsyncData('articles', () => queryContent('/articles').find())
const tags = computed(() => data.value.map((article) => article.tag).filter((tag) => tag !== undefined))
const LLMArticles = (tag) => data.value.filter((article) => article.tag === tag).sort((a, b) => a.date > b.date ? -1 : 1)
console.log(LLMArticles('LLM'))
</script>
<template>
<section class="articles">
<article>
<h1>Latest Articles</h1>
<ul>
<li v-for="tag in tags" :key="tag">
<h2>{{ tag }}</h2>
<ul>
<li v-for="article in LLMArticles(tag)" :key="article.id">
<router-link :to="`${article._path}`">{{ article.title }} - [Published {{article.date}}]</router-link>
</li>
</ul>
</li>
</ul>
</article>
</section>
</template>

<style scoped>
ul {
list-style-type: none;
padding: 0;
}
</style>

0 comments on commit 6705ef0

Please sign in to comment.