feat: try to fix the prod deployment
This commit is contained in:
parent
ca70d878fb
commit
63fc4373b2
4 changed files with 40 additions and 5 deletions
|
|
@ -4,6 +4,10 @@ import remarkMath from "remark-math";
|
||||||
import rehypeKatex from "rehype-katex";
|
import rehypeKatex from "rehype-katex";
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
trailingSlash: "always",
|
||||||
|
build: {
|
||||||
|
format: "directory",
|
||||||
|
},
|
||||||
integrations: [
|
integrations: [
|
||||||
mdx({
|
mdx({
|
||||||
remarkPlugins: [remarkMath],
|
remarkPlugins: [remarkMath],
|
||||||
|
|
|
||||||
0
scripts/deploy.sh
Normal file → Executable file
0
scripts/deploy.sh
Normal file → Executable file
|
|
@ -2,8 +2,11 @@
|
||||||
const path = Astro.url.pathname;
|
const path = Astro.url.pathname;
|
||||||
const isHome = path === "/" || path === "/index.html";
|
const isHome = path === "/" || path === "/index.html";
|
||||||
|
|
||||||
// Determine topic from path
|
|
||||||
function getTopic() {
|
function getTopic() {
|
||||||
|
if (path.startsWith("/about")) {
|
||||||
|
return "/about";
|
||||||
|
}
|
||||||
|
|
||||||
const pathname = path.split("/");
|
const pathname = path.split("/");
|
||||||
|
|
||||||
if (pathname.length === 2 && pathname[1].endsWith(".html")) {
|
if (pathname.length === 2 && pathname[1].endsWith(".html")) {
|
||||||
|
|
@ -28,16 +31,14 @@ const promptText = topic ? `barrett@ruth:~$ ${topic}` : "barrett@ruth:~$";
|
||||||
<div class="header-links">
|
<div class="header-links">
|
||||||
<a target="_blank" href="/resume.pdf">resume</a>
|
<a target="_blank" href="/resume.pdf">resume</a>
|
||||||
<a target="_blank" href="/transcript.pdf">transcript</a>
|
<a target="_blank" href="/transcript.pdf">transcript</a>
|
||||||
<a href="/about">about</a>
|
<a href="/about/">about</a>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Terminal functionality
|
|
||||||
const TERMINAL_PROMPT = "barrett@ruth:~$ ";
|
const TERMINAL_PROMPT = "barrett@ruth:~$ ";
|
||||||
let clearing = false;
|
let clearing = false;
|
||||||
|
|
||||||
// Clear the terminal prompt with animation
|
|
||||||
function clearPrompt(delay, callback) {
|
function clearPrompt(delay, callback) {
|
||||||
if (clearing) return;
|
if (clearing) return;
|
||||||
clearing = true;
|
clearing = true;
|
||||||
|
|
@ -71,6 +72,26 @@ const promptText = topic ? `barrett@ruth:~$ ${topic}` : "barrett@ruth:~$";
|
||||||
clearPrompt(500, () => (window.location.href = "/"));
|
clearPrompt(500, () => (window.location.href = "/"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function goToAbout(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
const terminalPrompt = document.querySelector(".terminal-prompt");
|
||||||
|
const terminalText = " /about";
|
||||||
|
const delay = 500;
|
||||||
|
|
||||||
|
clearPrompt(delay, () => {
|
||||||
|
let i = 0;
|
||||||
|
function typechar() {
|
||||||
|
if (i < terminalText.length) {
|
||||||
|
terminalPrompt.innerHTML += terminalText.charAt(i++);
|
||||||
|
setTimeout(typechar, delay / terminalText.length);
|
||||||
|
} else {
|
||||||
|
window.location.href = "/about/";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
typechar();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
window.TERMINAL_PROMPT = TERMINAL_PROMPT;
|
window.TERMINAL_PROMPT = TERMINAL_PROMPT;
|
||||||
window.clearPrompt = clearPrompt;
|
window.clearPrompt = clearPrompt;
|
||||||
|
|
@ -96,6 +117,16 @@ const promptText = topic ? `barrett@ruth:~$ ${topic}` : "barrett@ruth:~$";
|
||||||
homeLink.addEventListener("click", goHome);
|
homeLink.addEventListener("click", goHome);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const aboutLink = document.querySelector('header a[href="/about/"]');
|
||||||
|
if (aboutLink) {
|
||||||
|
const path = window.location.pathname;
|
||||||
|
const isHome = path === "/" || path === "/index.html";
|
||||||
|
|
||||||
|
if (isHome) {
|
||||||
|
aboutLink.addEventListener("click", goToAbout);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ Object.keys(postsByCategory).forEach((category) => {
|
||||||
.pop()
|
.pop()
|
||||||
.replace(/\.mdx?$/, "");
|
.replace(/\.mdx?$/, "");
|
||||||
|
|
||||||
link.href = `/posts/${topic}/${slug}`;
|
link.href = `/posts/${topic}/${slug}/`;
|
||||||
link.textContent = post.data.title;
|
link.textContent = post.data.title;
|
||||||
link.style.textDecoration = "underline";
|
link.style.textDecoration = "underline";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue