-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add twitter card images * Add MarkdownContent component * Twitter cards and data * Change markdown file to yaml file * Convert html in _data to yaml * rm marked * use nuxt markdown lib (for now) * enable componentIslands * use component islands to render markdown on server * rebuild pnpm-lock * flatten props * use carbon twitter icon * squish imgs --------- Co-authored-by: cw <[email protected]>
- Loading branch information
Showing
73 changed files
with
231 additions
and
1,919 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script setup lang="ts"> | ||
// @ts-expect-error avoid lint error | ||
import markdownParser from '@nuxt/content/transformers/markdown' | ||
export interface MarkdownRenderProps { | ||
content?: string | ||
cid?: string | ||
} | ||
const props = withDefaults(defineProps<MarkdownRenderProps>(), { content: '', cid: '<some-id>' }) | ||
const parsedMarkdown = await markdownParser.parse(props.cid, props.content) | ||
</script> | ||
|
||
<template> | ||
<ContentRenderer :value="parsedMarkdown" v-bind="$attrs" /> | ||
</template> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<script setup lang="ts"> | ||
interface Props { | ||
name?: string | ||
handle?: string | ||
post?: string | ||
image?: string | ||
time?: string | ||
date?: string | ||
retweet?: { | ||
name?: string | ||
handle?: string | ||
post?: string | ||
image?: string | ||
time?: string | ||
date?: string | ||
} | ||
} | ||
defineProps<Props>() | ||
</script> | ||
|
||
<template> | ||
<div class="twitter-card mb-8 break-inside-avoid rounded-xl bg-brand-light p-4"> | ||
<div class="mb-4 w-full flex items-center gap-2"> | ||
<img :src="`/images/twitter-profile-${handle}.jpg`" :alt="handle" class="h-9 w-9 flex-none rounded-full"> | ||
<div class="flex-1"> | ||
<p class="font-bold"> | ||
{{ name }} | ||
</p> | ||
<p>@{{ handle }}</p> | ||
</div> | ||
<div alt="twitter-bird" class="i-carbon-logo-twitter h-7 w-8 flex-none fill-current color-[#2aa9e0]" /> | ||
</div> | ||
<div class="twitter-post mb-4"> | ||
<MarkdownContent v-if="post" :content="post" /> | ||
</div> | ||
<img v-if="image" :src="`/images/${image}`" class="mb-4 w-full"> | ||
<div v-if="retweet" class="mb-4 border rounded-md p-3"> | ||
<div class="mb-2 w-full flex items-center gap-1"> | ||
<img :src="`/images/twitter-profile-${handle}.jpg`" :alt="handle" class="h-5 w-5 flex-none rounded-full"> | ||
<p class="flex-1"> | ||
<span class="font-bold">{{ retweet.name }}</span> @{{ retweet.handle }}, {{ retweet.date }} | ||
</p> | ||
</div> | ||
<div class="twitter-post"> | ||
<MarkdownContent v-if="retweet.post" :content="retweet.post" /> | ||
</div> | ||
<img v-if="retweet.image" :src="`/images/${retweet.image}`" class="mt-4 w-full"> | ||
</div> | ||
<p> | ||
{{ time }} • {{ date }} | ||
</p> | ||
</div> | ||
</template> | ||
|
||
<style lang="postcss"> | ||
.twitter-card { | ||
@apply text-xs; | ||
} | ||
.twitter-card p { | ||
@apply mb-0 text-xs; | ||
} | ||
.twitter-post p { | ||
@apply text-xs mb-3; | ||
} | ||
.twitter-post p:last-child { | ||
@apply mb-0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.