Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Searchbar and Index, Fancy Codeblock, Latex Support #44

Merged
merged 25 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0963779
Update README.md
micahkepe Oct 19, 2024
e77180a
Delete .github/workflows/docs.yml
micahkepe Oct 19, 2024
7032deb
old shortcodes, update info, first pass of code SCSS and clipboarding
micahkepe Oct 19, 2024
2f6eff7
Get nodes and code clipboards working
micahkepe Oct 19, 2024
3bdbc12
gif shortcode improvement with width
micahkepe Oct 19, 2024
75a5bec
Add dim. options for newtab shortcode
micahkepe Oct 20, 2024
a757890
Enable clipboard code blocks by default
micahkepe Oct 20, 2024
ef836e7
Update README
micahkepe Oct 20, 2024
6bf214d
inline code highlighting, comments
micahkepe Oct 21, 2024
e7b3f3b
Make LaTex a config option partial
micahkepe Oct 22, 2024
28739cc
Update README
micahkepe Oct 22, 2024
53934ee
Initial working search bar support
micahkepe Oct 23, 2024
7d90146
Better searchbar styling
micahkepe Oct 24, 2024
cbe3283
Refine search styling, search index file path resolution
micahkepe Oct 25, 2024
db60631
Update demo pages, update README
micahkepe Oct 25, 2024
a625166
fix: graceful search index path resolution, downsize screenshot
micahkepe Oct 25, 2024
f44b607
Youtube and audio shortcodes, search on /, blockquote styling
micahkepe Oct 25, 2024
8a36449
Add custom 404 page
micahkepe Oct 25, 2024
6cc4e42
Blockquote bg, toggle theme JS code for later
micahkepe Oct 26, 2024
63d3c44
Override index title for pages
micahkepe Oct 29, 2024
384452e
Update theme.toml
micahkepe Oct 30, 2024
ac43cd4
Update blockquote styling
micahkepe Nov 2, 2024
28710b3
Revert to original author's README, config, and theme files with
micahkepe Nov 5, 2024
8036c00
Add back deleted docs workflow
micahkepe Nov 5, 2024
448b1c1
Update README instruction for codeblocks
micahkepe Nov 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Blockquote bg, toggle theme JS code for later
  • Loading branch information
micahkepe committed Oct 26, 2024
commit 6cc4e428cfa90a019f878e2d9b5b0e093c302356
19 changes: 13 additions & 6 deletions sass/_vendor.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
This file defines the styles for the vendor libraries used in the theme.
Meant for third-party outside libraries like Prism.js, Clipboard.js, and others.
This file is for "vendor" styles that are not part of the main theme. This
means that they are not part of the main theme's design, but are included
to provide a consistent experience across the site.
*/

html {
Expand All @@ -16,7 +17,10 @@ body {
font-size: 1rem;
line-height: 1.5rem;
margin: 0;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;
font-family:
Menlo, Monaco, Lucida Console, Liberation Mono,
DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New,
monospace, serif;
word-wrap: break-word
}

Expand Down Expand Up @@ -213,7 +217,9 @@ a:hover {
.hack strong {
font-size: 1rem;
font-style: normal;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif
font-family:
Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
Bitstream Vera Sans Mono, Courier New, monospace, serif
}

.hack blockquote,
Expand Down Expand Up @@ -344,7 +350,8 @@ a:hover {
position: relative;
padding-left: 17px;
padding-left: 2ch;
overflow: hidden
overflow: hidden;
background-color: var(--bg-primary, #fff);
}

.hack blockquote:after {
Expand Down Expand Up @@ -516,7 +523,6 @@ table tbody td:first-child {
height: 38px;
line-height: 38px;
padding: 0;
float: left;
position: relative
}

Expand Down Expand Up @@ -571,6 +577,7 @@ textarea.form-control {
select.form-control {
border-radius: 0;
background-color: transparent;
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none
Expand Down
61 changes: 61 additions & 0 deletions static/js/toggle-theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Adapted from `apollo` theme:
* https://github.com/not-matthias/apollo/blob/main/static/js/themetoggle.js
*/
function setTheme(mode) {
localStorage.setItem("theme-storage", mode);
}

function toggleTheme() {
if (localStorage.getItem("theme-storage") === "light") {
setTheme("dark");
updateItemToggleTheme();
} else if (localStorage.getItem("theme-storage") === "dark") {
setTheme("light");
updateItemToggleTheme();
}
}

function updateItemToggleTheme() {
let mode = getSavedTheme();

const darkModeStyle = document.getElementById("darkModeStyle");
if (darkModeStyle) {
darkModeStyle.disabled = mode === "light";
}

const sunIcon = document.getElementById("sun-icon");
const moonIcon = document.getElementById("moon-icon");
if (sunIcon && moonIcon) {
sunIcon.style.display = mode === "dark" ? "inline-block" : "none";
moonIcon.style.display = mode === "light" ? "inline-block" : "none";
}

let htmlElement = document.querySelector("html");
if (mode === "dark") {
htmlElement.classList.remove("light");
htmlElement.classList.add("dark");
} else if (mode === "light") {
htmlElement.classList.remove("dark");
htmlElement.classList.add("light");
}
}

function getSavedTheme() {
let currentTheme = localStorage.getItem("theme-storage");
if (!currentTheme) {
if (
window.matchMedia &&
window.matchMedia("(prefers-color-scheme: dark)").matches
) {
currentTheme = "dark";
} else {
currentTheme = "light";
}
}

return currentTheme;
}

// Update the toggle theme on page load
updateItemToggleTheme();