mirror of https://github.com/mitchell/mjfs-us.git
Handle no JS case better, and refactor deploy script
This commit is contained in:
parent
a9c69c47bc
commit
f1efbde335
|
@ -1,54 +1,70 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { VPButton } from "vitepress/theme";
|
import { VPButton, VPHomeFeatures } from "vitepress/theme";
|
||||||
import { useClipboard } from "@vueuse/core";
|
import { useClipboard } from "@vueuse/core";
|
||||||
|
|
||||||
const email = "m@mjfs.us";
|
const email = "m@mjfs.us";
|
||||||
const discord = "zettam";
|
const discord = "zettam";
|
||||||
const formattedDiscord = "zettam on Discord";
|
|
||||||
const discordLink = "https://discord.com/users/145338365133193226/";
|
|
||||||
|
|
||||||
const { text, copy, isSupported } = useClipboard();
|
const { text, copy, isSupported } = useClipboard();
|
||||||
|
|
||||||
const copiedMsg = (text: string) => `Copied ${text} to clipboard`;
|
const copiedMsg = (text: string) => `Copied ${text} to clipboard`;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="isSupported" class="container">
|
<div v-if="isSupported" class="contact-buttons">
|
||||||
<VPButton
|
<div class="container">
|
||||||
theme="brand"
|
<div class="buttons">
|
||||||
class="button"
|
<VPButton
|
||||||
:text="text === email ? copiedMsg(email) : 'E-mail'"
|
theme="brand"
|
||||||
@click="copy(email)"
|
class="button"
|
||||||
/>
|
:text="text === email ? copiedMsg(email) : 'E-mail'"
|
||||||
<VPButton
|
@click="copy(email)"
|
||||||
theme="alt"
|
/>
|
||||||
class="button"
|
<VPButton
|
||||||
:text="text === discord ? copiedMsg(discord) : 'Discord'"
|
theme="alt"
|
||||||
@click="copy(discord)"
|
class="button"
|
||||||
/>
|
:text="text === discord ? copiedMsg(discord) : 'Discord'"
|
||||||
</div>
|
@click="copy(discord)"
|
||||||
<div v-else class="container">
|
/>
|
||||||
<VPButton
|
</div>
|
||||||
theme="brand"
|
</div>
|
||||||
class="button"
|
|
||||||
:href="`mailto:${email}`"
|
|
||||||
:text="email"
|
|
||||||
/>
|
|
||||||
<VPButton
|
|
||||||
theme="alt"
|
|
||||||
class="button"
|
|
||||||
:href="discordLink"
|
|
||||||
:text="formattedDiscord"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
<VPHomeFeatures v-else />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.contact-buttons {
|
||||||
|
position: relative;
|
||||||
|
padding: 0 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 640px) {
|
||||||
|
.contact-buttons {
|
||||||
|
padding: 0 48px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 960px) {
|
||||||
|
.contact-buttons {
|
||||||
|
padding: 0 64px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
margin: 0 auto;
|
||||||
|
max-width: 1152px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin: -6px;
|
||||||
|
}
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
|
flex-shrink: 0;
|
||||||
margin: 6px;
|
margin: 6px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
.container {
|
|
||||||
margin: -6px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,16 +1,11 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { VPButton } from "vitepress/theme";
|
import { VPButton } from "vitepress/theme";
|
||||||
const props = defineProps<{ href: string }>();
|
const { href } = defineProps<{ href: string }>();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<VPButton
|
<VPButton theme="brand" text="Repository" class="button" :href />
|
||||||
theme="brand"
|
|
||||||
text="Repository"
|
|
||||||
class="button"
|
|
||||||
:href="props.href"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
11
contact.md
11
contact.md
|
@ -1,14 +1,23 @@
|
||||||
---
|
---
|
||||||
layout: home
|
layout: page
|
||||||
|
sidebar: false
|
||||||
|
|
||||||
hero:
|
hero:
|
||||||
name: "Mitchell Simon"
|
name: "Mitchell Simon"
|
||||||
text: "Software Engineer"
|
text: "Software Engineer"
|
||||||
tagline: Specializing in web, mobile, and dev-ops
|
tagline: Specializing in web, mobile, and dev-ops
|
||||||
|
|
||||||
|
features:
|
||||||
|
- title: Enable JavaScript
|
||||||
|
details:
|
||||||
|
Please, enable JS to show contact info. This is to prevent malicious bots from scraping
|
||||||
|
the info.
|
||||||
---
|
---
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { VPHomeHero } from 'vitepress/theme';
|
||||||
import ContactButtons from './components/ContactButtons.vue';
|
import ContactButtons from './components/ContactButtons.vue';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<VPHomeHero />
|
||||||
<ContactButtons />
|
<ContactButtons />
|
||||||
|
|
22
deploy.ts
22
deploy.ts
|
@ -1,11 +1,21 @@
|
||||||
#!/usr/bin/env bun
|
#!/usr/bin/env bun
|
||||||
import { $ } from "bun";
|
import { $ } from "bun";
|
||||||
|
|
||||||
await $`bun run clean`;
|
async function main() {
|
||||||
await $`bun run build`;
|
const profile = process.env.MJFS_PROFILE;
|
||||||
|
const distId = process.env.MJFS_DIST_ID;
|
||||||
|
|
||||||
const profile = prompt("Profile:");
|
if (
|
||||||
const distId = prompt("Distribution Id:");
|
!confirm(`Deploy to distribution "${distId}" with profile "${profile}"?`)
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await $`aws s3 sync ./.vitepress/dist/ s3://mjfs.us --acl public-read --delete --profile ${profile} --region us-west-1`;
|
await $`bun run clean`;
|
||||||
await $`aws cloudfront create-invalidation --distribution-id ${distId} --paths '/*' --profile ${profile}`;
|
await $`bun run build`;
|
||||||
|
|
||||||
|
await $`aws s3 sync ./.vitepress/dist/ s3://mjfs.us --acl public-read --delete --profile ${profile} --region us-west-1`;
|
||||||
|
await $`aws cloudfront create-invalidation --distribution-id ${distId} --paths '/*' --profile ${profile}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
await main();
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "bunx --bun vitepress dev",
|
"dev": "bunx --bun vitepress dev",
|
||||||
"build": "bunx --bun vitepress build",
|
"build": "bunx --bun vitepress build",
|
||||||
"preview": "bunx --bun vitepress preview",
|
"preview": "caddy file-server --listen :5173 --root ./.vitepress/dist/",
|
||||||
"typecheck": "bunx --bun vue-tsc",
|
"typecheck": "bunx --bun vue-tsc",
|
||||||
"format": "bunx --bun prettier -w .",
|
"format": "bunx --bun prettier -w .",
|
||||||
"lint": "bunx --bun eslint .",
|
"lint": "bunx --bun eslint .",
|
||||||
|
|
Loading…
Reference in New Issue