Merge pull request #43 from barrettruth/feat/refactor
remove theme and public gist visibility
This commit is contained in:
commit
fb8e7079a1
8 changed files with 2 additions and 133 deletions
|
|
@ -5,37 +5,6 @@ import rehypeKatex from "rehype-katex";
|
|||
import remarkMath from "remark-math";
|
||||
import path from "path";
|
||||
|
||||
const midnight = {
|
||||
name: "midnight",
|
||||
type: "dark",
|
||||
colors: {
|
||||
"editor.background": "#121212",
|
||||
"editor.foreground": "#e0e0e0",
|
||||
},
|
||||
tokenColors: [
|
||||
{
|
||||
scope: [
|
||||
"storage.type",
|
||||
"storage.modifier",
|
||||
"keyword.control",
|
||||
"keyword.operator.new",
|
||||
],
|
||||
settings: { foreground: "#7aa2f7" },
|
||||
},
|
||||
{
|
||||
scope: [
|
||||
"string",
|
||||
"constant",
|
||||
"constant.numeric",
|
||||
"constant.language",
|
||||
"constant.character",
|
||||
"number",
|
||||
],
|
||||
settings: { foreground: "#98c379" },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const daylight = {
|
||||
name: "daylight",
|
||||
type: "light",
|
||||
|
|
@ -97,7 +66,6 @@ export default defineConfig({
|
|||
shikiConfig: {
|
||||
themes: {
|
||||
light: daylight,
|
||||
dark: midnight,
|
||||
},
|
||||
langs: [],
|
||||
wrap: true,
|
||||
|
|
|
|||
|
|
@ -251,30 +251,6 @@
|
|||
true,
|
||||
);
|
||||
|
||||
const themeToggle = document.getElementById("theme-toggle");
|
||||
if (themeToggle) {
|
||||
function updateBearVisual() {
|
||||
const currentTheme =
|
||||
document.documentElement.getAttribute("data-theme");
|
||||
if (currentTheme === "dark") {
|
||||
themeToggle.textContent = "☾⊂ʕ•ᴥ•ʔ";
|
||||
} else {
|
||||
themeToggle.textContent = "☼⊂ʕ•ᴥ•ʔ";
|
||||
}
|
||||
}
|
||||
|
||||
updateBearVisual();
|
||||
|
||||
themeToggle.addEventListener("click", () => {
|
||||
const currentTheme =
|
||||
document.documentElement.getAttribute("data-theme");
|
||||
const newTheme = currentTheme === "dark" ? "light" : "dark";
|
||||
document.documentElement.setAttribute("data-theme", newTheme);
|
||||
localStorage.setItem("theme", newTheme);
|
||||
updateBearVisual();
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener("beforeunload", () => {
|
||||
const el = promptEl();
|
||||
if (el) el.textContent = TERMINAL_PROMPT;
|
||||
|
|
|
|||
|
|
@ -150,16 +150,6 @@
|
|||
--grid-color: rgba(200, 200, 200, 0.4);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--bg: #000;
|
||||
--text: #fff;
|
||||
--code-bg: #121212;
|
||||
--border: #2d2d2d;
|
||||
--grid-color: rgba(55, 55, 55, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
[data-theme="light"] {
|
||||
--bg: #fff;
|
||||
--text: #000;
|
||||
|
|
@ -168,14 +158,6 @@
|
|||
--grid-color: rgba(200, 200, 200, 0.4);
|
||||
}
|
||||
|
||||
[data-theme="dark"] {
|
||||
--bg: #000;
|
||||
--text: #fff;
|
||||
--code-bg: #121212;
|
||||
--border: #2d2d2d;
|
||||
--grid-color: rgba(55, 55, 55, 0.4);
|
||||
}
|
||||
|
||||
pre,
|
||||
code,
|
||||
pre code,
|
||||
|
|
@ -208,11 +190,6 @@ footer {
|
|||
justify-content: space-between;
|
||||
}
|
||||
|
||||
#theme-toggle {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.main {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
<a href="/about.html" data-topic="about">about</a>
|
||||
</div>
|
||||
<div class="footer-links-right">
|
||||
<a href="/gist.html" data-topic="gist">gist</a>
|
||||
<a href="/git.html" data-topic="git">git</a>
|
||||
<a
|
||||
href="https://www.linkedin.com/in/barrett-ruth/"
|
||||
|
|
|
|||
|
|
@ -26,14 +26,9 @@ const promptText = topic ? `barrett@ruth:~$ ${topic}` : "barrett@ruth:~$";
|
|||
<span class="terminal-cursor"></span>
|
||||
</div>
|
||||
</a>
|
||||
<span id="theme-toggle">☼⊂ʕ•ᴥ•ʔ</span>
|
||||
</header>
|
||||
|
||||
<style>
|
||||
#theme-toggle {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
header {
|
||||
flex-direction: row;
|
||||
|
|
|
|||
|
|
@ -13,17 +13,6 @@ const {
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<script is:inline>
|
||||
(function () {
|
||||
const stored = localStorage.getItem("theme");
|
||||
const theme =
|
||||
stored ||
|
||||
(matchMedia("(prefers-color-scheme: dark)").matches
|
||||
? "dark"
|
||||
: "light");
|
||||
document.documentElement.setAttribute("data-theme", theme);
|
||||
})();
|
||||
</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
---
|
||||
import BaseLayout from "../layouts/BaseLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
import { sortItem } from "../utils/sort.js";
|
||||
|
||||
const title = "gists";
|
||||
const gists = await getCollection("gists");
|
||||
gists.sort(sortItem);
|
||||
---
|
||||
|
||||
<BaseLayout title={title}>
|
||||
<slot name="head" slot="head">
|
||||
<link rel="stylesheet" href="/styles/index.css" />
|
||||
<script src="/scripts/index.js" is:inline></script>
|
||||
</slot>
|
||||
|
||||
<div class="content">
|
||||
<ul class="topics">
|
||||
{
|
||||
gists.map((gist) => (
|
||||
<li class="topic">
|
||||
<a
|
||||
href={`/gist/${gist.slug}.html`}
|
||||
data-topic={`gist/${gist.slug}`}
|
||||
>
|
||||
{gist.data.title || gist.slug}
|
||||
</a>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</BaseLayout>
|
||||
|
|
@ -6,9 +6,8 @@ export type CollectionKey =
|
|||
| "meditations"
|
||||
| "autonomous-racing"
|
||||
| "git"
|
||||
| "gists"
|
||||
| "death";
|
||||
export type PostCollection = Exclude<CollectionKey, "git" | "gists">;
|
||||
export type PostCollection = Exclude<CollectionKey, "git">;
|
||||
|
||||
export type AnyCollectionEntry =
|
||||
| CollectionEntry<"algorithms">
|
||||
|
|
@ -16,5 +15,4 @@ export type AnyCollectionEntry =
|
|||
| CollectionEntry<"meditations">
|
||||
| CollectionEntry<"autonomous-racing">
|
||||
| CollectionEntry<"death">
|
||||
| CollectionEntry<"git">
|
||||
| CollectionEntry<"gists">;
|
||||
| CollectionEntry<"git">;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue