-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #690 from nblackburn/blog
Blog
- Loading branch information
Showing
41 changed files
with
2,159 additions
and
291 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 |
---|---|---|
@@ -1,25 +1,31 @@ | ||
import vue from '@astrojs/vue'; | ||
import vercel from '@astrojs/vercel'; | ||
import sitemap from '@astrojs/sitemap'; | ||
import { defineConfig } from 'astro/config'; | ||
import vercel from '@astrojs/vercel'; | ||
import { readTime } from './src/plugins/readTime.mjs'; | ||
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'; | ||
|
||
export default defineConfig({ | ||
compressHTML: true, | ||
site: 'https://nblackburn.uk/', | ||
integrations: [vue(), sitemap()], | ||
|
||
markdown: { | ||
shikiConfig: { | ||
themes: { | ||
light: 'github-light', | ||
dark: 'github-dark' | ||
} | ||
}, | ||
|
||
remarkPlugins: [readTime] | ||
}, | ||
|
||
adapter: vercel({ | ||
imageService: true | ||
}), | ||
|
||
vite: { | ||
plugins: [vanillaExtractPlugin()], | ||
|
||
define: { | ||
'import.meta.env.PUBLIC_VERCEL_ANALYTICS_ID': JSON.stringify( | ||
process.env.VERCEL_ANALYTICS_ID | ||
) | ||
} | ||
plugins: [vanillaExtractPlugin()] | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<template> | ||
<time :datetime="isoDate">{{ pubDate }}</time> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { format, formatISO } from 'date-fns'; | ||
interface Props { | ||
date: Date; | ||
formatString?: string; | ||
} | ||
const props = withDefaults(defineProps<Props>(), { | ||
formatString: 'do MMM, yyyy' | ||
}); | ||
const isoDate = formatISO(props.date); | ||
const pubDate = format(props.date, props.formatString); | ||
</script> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/components/projectCard.css.ts → src/components/listCard.css.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<template> | ||
<article :class="styles.listCard"> | ||
<div :class="styles.thumbnail"> | ||
<slot name="thumbnail" /> | ||
</div> | ||
<div :class="styles.content"> | ||
<div :class="styles.meta"> | ||
<TagList :tags="tags" :active="activeTag" :baseURL="baseURL" /> | ||
<div :class="styles.publishDate"> | ||
<FormattedDate :date="createdAt" /> | ||
</div> | ||
</div> | ||
<div :class="styles.details"> | ||
<div :class="styles.info"> | ||
<h3 :class="styles.title"> | ||
{{ title }} | ||
</h3> | ||
<p :class="styles.description" v-if="description"> | ||
{{ description }} | ||
</p> | ||
</div> | ||
<NavLink | ||
:href="url" | ||
:class="styles.projectLink" | ||
:aria-label="ariaLabel" | ||
> | ||
<svg | ||
width="18" | ||
height="18" | ||
role="img" | ||
:class="styles.externalIcon" | ||
v-if="isExternalLink(url)" | ||
> | ||
<use :href="'#external'" /> | ||
</svg> | ||
<span>{{ linkLabel }}</span> | ||
</NavLink> | ||
</div> | ||
</div> | ||
</article> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { computed } from 'vue'; | ||
import TagList from './tagList.vue'; | ||
import * as styles from './listCard.css'; | ||
import NavLink from '@components/navLink.vue'; | ||
import FormattedDate from './formattedDate.vue'; | ||
import { isExternalLink } from '@utilities/refLink'; | ||
interface Props { | ||
title: string; | ||
description?: string; | ||
url: string; | ||
tags: string[]; | ||
createdAt: Date; | ||
baseURL: string; | ||
activeTag?: string; | ||
linkLabel?: string; | ||
} | ||
const { url, createdAt, linkLabel, baseURL } = withDefaults( | ||
defineProps<Props>(), | ||
{ | ||
linkLabel: 'View', | ||
tags: () => [] | ||
} | ||
); | ||
const ariaLabel = computed(() => { | ||
if (isExternalLink(url)) { | ||
return `${linkLabel} (External link)`; | ||
} | ||
return linkLabel; | ||
}); | ||
</script> |
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 was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.
fa6f1e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
website – ./
website-git-main-nmblackburn.vercel.app
www.nblackburn.uk
website-nmblackburn.vercel.app
nblackburn.uk