Skip to content

Commit

Permalink
feat: social link config
Browse files Browse the repository at this point in the history
bump: drizzle-kit
  • Loading branch information
michaelpayne02 committed May 12, 2024
1 parent 6d3f777 commit f0cf0f6
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 65 deletions.
11 changes: 4 additions & 7 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,18 @@ import remarkUnwrapImages from 'remark-unwrap-images'
import arraybuffer from 'vite-plugin-arraybuffer'
import { remarkReadingTime } from './src/lib/remark-reading-time'
import { expressiveCodeOptions } from './src/site.config'
import { AstroIntegration } from 'astro'

// https://astro.build/config
export default defineConfig({
site: 'https://mikepayne.me',
integrations: [
expressiveCode(expressiveCodeOptions),
tailwind({
applyBaseStyles: false
}) as AstroIntegration,
sitemap(),
pagefind() as AstroIntegration,
mdx() as AstroIntegration,
pagefind(),
mdx(),
icon(),
react()
react(),
tailwind({ applyBaseStyles: false })
],
vite: {
// @ts-ignore
Expand Down
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if (!process.env.TURSO_DATABASE_URL || !process.env.TURSO_AUTH_TOKEN) {
export default defineConfig({
schema: 'src/schema.ts',
driver: 'turso',
dialect: 'sqlite',
out: './drizzle',
dbCredentials: {
url: process.env.TURSO_DATABASE_URL,
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "portfolio",
"version": "1.0.6",
"type": "module",
"scripts": {
"dev": "wrangler types && astro dev",
"start": "wrangler types && astro dev",
Expand Down Expand Up @@ -36,11 +37,12 @@
},
"devDependencies": {
"@astrojs/react": "^3.3.2",
"@astrojs/ts-plugin": "^1.6.1",
"@astrojs/ts-plugin": "^1.7.0",
"@cloudflare/workers-types": "^4.20240423.0",
"@dotenvx/dotenvx": "^0.37.1",
"@iconify-json/fa6-brands": "^1.1.19",
"@iconify-json/heroicons": "^1.1.21",
"@iconify-json/ri": "^1.1.20",
"@resvg/resvg-wasm": "^2.6.2",
"@rive-app/canvas-single": "^2.15.5",
"@silvia-odwyer/photon-node": "^0.3.3",
Expand All @@ -52,7 +54,7 @@
"astro-icon": "^1.1.0",
"canvas-confetti": "^1.9.3",
"debug": "^4.3.4",
"drizzle-kit": "^0.20.17",
"drizzle-kit": "latest",
"esbuild-runner": "^2.2.2",
"eslint": "^8.57.0",
"eslint-plugin-astro": "^1.1.1",
Expand All @@ -76,4 +78,4 @@
"vite-plugin-arraybuffer": "^0.0.7",
"wrangler": "^3.53.0"
}
}
}
1 change: 0 additions & 1 deletion prettier.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/** @type {import("prettier").Config} */
module.exports = {
// i am just using the standard config, change if you need something else
...require('prettier-config-standard'),
pluginSearchDirs: [__dirname],
plugins: ['prettier-plugin-astro', 'prettier-plugin-tailwindcss'],
Expand Down
62 changes: 13 additions & 49 deletions src/components/layout/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
import ViewCount from '@/components/ViewCount.astro'
import { Icon } from 'astro-icon/components'
import { siteConfig } from '@/site-config'
import type { SocialItem } from '@/types'
import { siteConfig, socialLinks } from '@/site-config'
import SocialLink from './SocialLink.astro'
const { showViewCount = false } = Astro.props
---
Expand All @@ -20,53 +21,16 @@ const { showViewCount = false } = Astro.props
<div class='flex items-center justify-between'>
<!-- Social Brands -->
<div class='flex items-center gap-x-4'>
<!-- Snapchat -->
<a
class='inline-block text-muted-foreground transition-all hover:text-muted-foreground/75'
aria-label='Snapchat'
href='https://snapchat.com/t/uMm9JFth'
target='_blank'
>
<Icon name='fa6-brands:snapchat' class='size-5 flex-shrink-0' />
</a>
<!-- Instagram -->
<a
class='inline-block text-muted-foreground transition-all hover:text-muted-foreground/75'
aria-label='Instagram'
href='https://www.instagram.com/michaelpayne02/'
target='_blank'
>
<Icon name='fa6-brands:instagram' class='size-5 flex-shrink-0' />
</a>
<!-- GitHub -->
<a
class='inline-block text-muted-foreground transition-all hover:text-muted-foreground/75'
aria-label='Github'
rel='me'
href='https://github.com/michaelpayne02'
target='_blank'
>
<Icon name='fa6-brands:github' class='size-5 flex-shrink-0' />
</a>
<!-- Linkedin -->
<a
class='inline-block text-muted-foreground transition-all hover:text-muted-foreground/75'
aria-label='LinkedIn'
target='_blank'
href='https://www.linkedin.com/in/michaelpayne02/'
>
<Icon name='fa6-brands:linkedin' class='size-5 flex-shrink-0' />
</a>
<!-- Email -->
<a
class='inline-block text-muted-foreground transition-all hover:text-muted-foreground/75'
rel='me'
aria-label='Email'
target='_blank'
href='mailto:michael@payne.cx'
>
<Icon name='heroicons:envelope' class='size-5 flex-shrink-0' />
</a>
{
socialLinks.map((social: SocialItem) => (
<SocialLink
href={social.href}
label={social.label}
icon={social.icon}
target={social.target}
/>
))
}
</div>
<!-- End Social Brands -->
</div>
Expand Down
15 changes: 15 additions & 0 deletions src/components/layout/SocialLink.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
import type { SocialItem } from '@/types'
const { href, label, icon, target = '_blank' } = Astro.props as SocialItem
import { Icon } from 'astro-icon/components'
---

<a
class='inline-block text-muted-foreground transition-all hover:text-muted-foreground/75'
aria-label={label}
rel='me'
href={href}
target={target}
>
<Icon name={icon} class='size-5 flex-shrink-0' />
</a>
5 changes: 2 additions & 3 deletions src/layouts/Base.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
import type { SiteMeta } from '@/types'
import BaseHead from '@/components/Head.astro'
import Footer from '@/components/layout/Footer.astro'
import Header from '@/components/layout/Header.astro'
Expand All @@ -27,7 +26,7 @@ const {

<body class='flex justify-center bg-background'>
<div class='absolute -z-10 h-screen w-full overflow-hidden'>
<div id='gradient' class='absolute start-1/2 size-[35rem] -translate-x-1/2'></div>
<div id='gradient' class='absolute start-1/2 size-[70rem] -translate-x-1/2'></div>
</div>
<ThemeProvider />
<SkipLink />
Expand All @@ -45,7 +44,7 @@ const {
background: radial-gradient(
circle at top,
hsl(var(--primary-foreground)) 0%,
transparent 40%
transparent 35%
);
}
</style>
Expand Down
35 changes: 34 additions & 1 deletion src/site.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SiteConfig } from '@/types'
import type { SiteConfig, SocialItem } from '@/types'
import type { AstroExpressiveCodeOptions } from 'astro-expressive-code'

export const siteConfig: SiteConfig = {
Expand Down Expand Up @@ -41,6 +41,39 @@ export const menuLinks: Array<{ title: string; path: string }> = [
}
]

export const socialLinks: Array<SocialItem> = [
{
label: 'Snapchat',
href: 'https://snapchat.com/t/uMm9JFth',
icon: 'fa6-brands:snapchat'
},
{
label: 'Instagram',
href: 'https://www.instagram.com/michaelpayne02/',
icon: 'fa6-brands:instagram'
},
{
label: 'Github',
href: 'https://github.com/michaelpayne02',
icon: 'fa6-brands:github'
},
{
label: 'LinkedIn',
href: 'https://www.linkedin.com/in/michaelpayne02/',
icon: 'fa6-brands:linkedin'
},
{
label: 'Ethereum',
href: 'https://etherscan.io/address/0x964D98dfa07549cB7571a4D6A161D825d76f9070',
icon: 'ri:eth-fill'
},
{
label: 'Email',
href: 'mailto:michael@payne.cx',
icon: 'heroicons:envelope'
}
]

// https://expressive-code.com/reference/configuration/
export const expressiveCodeOptions: AstroExpressiveCodeOptions = {
// One dark, one light theme => https://expressive-code.com/guides/themes/#available-themes
Expand Down
7 changes: 7 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ export type SiteMeta = {
articleDate?: string | undefined
}

export type SocialItem = {
href: string
label?: string
icon: string
target?: '_blank' | '_self' | '_parent' | '_top'
}

/** Webmentions */
export type WebmentionsFeed = {
type: string
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"name": "@astrojs/ts-plugin"
}
],
"verbatimModuleSyntax": true,
"jsx": "react-jsx",
"jsxImportSource": "react"
},
Expand Down

0 comments on commit f0cf0f6

Please sign in to comment.