Skip to content

Commit

Permalink
feat: Loads markdown on project detail page
Browse files Browse the repository at this point in the history
Uses Nuxt Content to load markdown using MDC syntax on project detail page.
  • Loading branch information
mohsin committed Dec 27, 2022
1 parent 2454c86 commit 9c16438
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
14 changes: 9 additions & 5 deletions components/Masonry/detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ const item = props.data
<span></span>
</h3>
</div>
<img v-if="item.isThumb" loading="lazy" class="w-full" :src="item.src" />
<div class="p-2.5 pb-1">
<img class="w-1/2 mt-0 mr-2.5 mb-2.5 ml-0 float-left" v-if="item.src && !item.isThumb" :src="item.src">
<p class="pb-2.5">{{ item.description }}</p>
</div>
<ContentDoc class="p-3" :path="'/data/projects/' + item.slug">
<template #not-found>
<img v-if="item.isThumb" loading="lazy" class="w-full" :src="item.src" />
<div class="p-2.5 pb-1">
<img class="w-1/2 mt-0 mr-2.5 mb-2.5 ml-0 float-left" v-if="item.src && !item.isThumb" :src="item.src">
<p class="pb-2.5">{{ item.description }}</p>
</div>
</template>
</ContentDoc>
</div>
</template>
1 change: 1 addition & 0 deletions components/Masonry/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export type MasonryItem = {
title: string,
slug: string,
src: string,
duration: string,
isThumb: boolean,
Expand Down
13 changes: 13 additions & 0 deletions content/data/projects/triptantra.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: 'Project: TripTantra'
description: 'Some description'
---

# This is an example MDC rendered text and a list.

- [ ] This
- [x] is
- [x] a
- [x] checklist
- [ ] that
- [ ] works.

0 comments on commit 9c16438

Please sign in to comment.