diff --git a/app/pages/projects/index.vue b/app/pages/projects/index.vue index 76af390..b67c618 100644 --- a/app/pages/projects/index.vue +++ b/app/pages/projects/index.vue @@ -73,15 +73,10 @@ const { data: projects } = await useAsyncData('all-projects', () => { -
- -

{{ TAGS.find(color => color.label.toLowerCase() === tag)?.label }}

-
+ {{ TAGS.find(color => color.label.toLowerCase() === tag)?.label }}
diff --git a/app/pages/writings/index.vue b/app/pages/writings/index.vue index cb508fb..f88b42d 100644 --- a/app/pages/writings/index.vue +++ b/app/pages/writings/index.vue @@ -14,10 +14,23 @@ const { data: writings } = await useAsyncData('all-writings', () => { .order('publishedAt', 'DESC') .all() }) + +// Group writings by year +const groupedWritings = computed(() => { + const grouped: Record = {} + writings.value!.forEach((writing: any) => { + const year = new Date(writing.publishedAt).getFullYear().toString() + if (!grouped[year]) { + grouped[year] = [] + } + grouped[year].push(writing) + }) + return Object.entries(grouped).reverse() +}) diff --git a/types/index.ts b/types/index.ts index ce70dee..5c2d3b3 100644 --- a/types/index.ts +++ b/types/index.ts @@ -107,8 +107,6 @@ export const activityMessages = { export interface Tag { label: string - icon: string - color: string title?: string translation: string } @@ -116,38 +114,26 @@ export interface Tag { export const TAGS: Array = [ { label: 'R', - icon: 'i-vscode-icons-file-type-r', - color: 'orange', translation: 'tags.r', }, { label: 'AI', - icon: 'i-ph-brain-duotone', - color: 'green', translation: 'tags.ai', }, { label: 'Data', - icon: 'i-ph-database-duotone', - color: 'purple', translation: 'tags.data', }, { label: 'Web', - icon: 'i-ph-globe-duotone', - color: 'cyan', translation: 'tags.web', }, { label: 'Python', - icon: 'i-vscode-icons-file-type-python', - color: 'amber', translation: 'tags.python', }, { label: 'Maths', - icon: 'i-ph-calculator-duotone', - color: 'pink', translation: 'tags.maths', }, ]