mirror of
https://github.com/Clortox/tylerperkins.xyz.git
synced 2026-03-07 10:37:58 +00:00
Claude cleaning
This commit is contained in:
5
layouts/_default/_markup/render-heading.html
Normal file
5
layouts/_default/_markup/render-heading.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
|
||||
<a href="#{{ .Anchor | safeURL }}" class="heading-anchor">
|
||||
<span class="anchor-icon">#</span>{{ .Text | safeHTML }}
|
||||
</a>
|
||||
</h{{ .Level }}>
|
||||
@@ -1 +0,0 @@
|
||||
<center><img src="{{ .Destination }}" title="{{ with .Title }}{{ . }} {{ else }}{{ .Text }}{{ end }}" alt="{{ .Text }}" /></center>
|
||||
@@ -1 +0,0 @@
|
||||
<a href="{{ .Destination }}" title="{{ .Title }}" data-value="{{ .Text | safeHTML }}" class="scramble">{{ .Text | safeHTML }}</a>
|
||||
272
layouts/_default/baseof.html
Normal file
272
layouts/_default/baseof.html
Normal file
@@ -0,0 +1,272 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ if not .IsHome }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title>
|
||||
<link rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" href="/index.xml">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color: #fff;
|
||||
--text-color: #333;
|
||||
--link-color: #0066cc;
|
||||
--border-color: #ccc;
|
||||
--secondary-color: #666;
|
||||
--code-bg: #f4f4f4;
|
||||
--code-border: #ddd;
|
||||
}
|
||||
[data-theme="dark"] {
|
||||
--bg-color: #1a1a1a;
|
||||
--text-color: #e0e0e0;
|
||||
--link-color: #6ba3ff;
|
||||
--border-color: #444;
|
||||
--secondary-color: #999;
|
||||
--code-bg: #2d2d2d;
|
||||
--code-border: #444;
|
||||
--shadow: 0 1px 3px rgba(0,0,0,0.4);
|
||||
}
|
||||
:root {
|
||||
--shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||
}
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
body {
|
||||
font-family: Georgia, serif;
|
||||
line-height: 1.6;
|
||||
max-width: 650px;
|
||||
margin: 40px auto;
|
||||
padding: 0 20px;
|
||||
color: var(--text-color);
|
||||
background: var(--bg-color);
|
||||
transition: background 0.3s, color 0.3s;
|
||||
}
|
||||
a {
|
||||
color: var(--link-color);
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
h1, h2, h3 {
|
||||
line-height: 1.2;
|
||||
}
|
||||
header {
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
padding-bottom: 10px;
|
||||
margin-bottom: 30px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
header h1 {
|
||||
margin: 0;
|
||||
font-size: 24px;
|
||||
}
|
||||
.header-right {
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
align-items: center;
|
||||
}
|
||||
nav a {
|
||||
font-size: 14px;
|
||||
}
|
||||
.theme-toggle {
|
||||
background: none;
|
||||
border: 1px solid var(--border-color);
|
||||
color: var(--text-color);
|
||||
cursor: pointer;
|
||||
padding: 5px 10px;
|
||||
border-radius: 3px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.theme-toggle:hover {
|
||||
background: var(--code-bg);
|
||||
}
|
||||
footer {
|
||||
margin-top: 50px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid var(--border-color);
|
||||
font-size: 14px;
|
||||
color: var(--secondary-color);
|
||||
}
|
||||
.date {
|
||||
color: var(--secondary-color);
|
||||
font-size: 14px;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
pre {
|
||||
background: var(--code-bg);
|
||||
border: 1px solid var(--code-border);
|
||||
padding: 10px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
code {
|
||||
background: var(--code-bg);
|
||||
padding: 2px 5px;
|
||||
}
|
||||
pre code {
|
||||
background: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Heading anchors */
|
||||
.heading-anchor {
|
||||
color: var(--text-color);
|
||||
text-decoration: none;
|
||||
}
|
||||
.heading-anchor:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.anchor-icon {
|
||||
opacity: 0;
|
||||
margin-right: 5px;
|
||||
color: var(--link-color);
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
.heading-anchor:hover .anchor-icon {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Sidenotes/Margin notes */
|
||||
/* Hide sidenotes by default (except on single post pages) */
|
||||
.sidenote-container {
|
||||
display: none;
|
||||
}
|
||||
.post-content .sidenote-container {
|
||||
display: inline;
|
||||
}
|
||||
.sidenote-ref {
|
||||
color: var(--link-color);
|
||||
text-decoration: none;
|
||||
font-size: 0.85em;
|
||||
vertical-align: super;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
/* Mobile: sidenotes at the end */
|
||||
@media (max-width: 1199px) {
|
||||
.post-content .sidenote-container {
|
||||
display: inline;
|
||||
}
|
||||
.post-content .sidenote {
|
||||
display: none;
|
||||
}
|
||||
#footnotes-section {
|
||||
margin-top: 20px;
|
||||
}
|
||||
#footnotes-section .sidenote {
|
||||
display: block;
|
||||
position: static;
|
||||
margin-bottom: 15px;
|
||||
font-size: 0.85em;
|
||||
line-height: 1.4;
|
||||
padding: 10px;
|
||||
background: var(--code-bg);
|
||||
border-left: 2px solid var(--link-color);
|
||||
border-radius: 3px;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
}
|
||||
|
||||
/* Desktop: sidenotes in right margin */
|
||||
@media (min-width: 1200px) {
|
||||
/* Only expand body width when sidenotes actually exist */
|
||||
body:has(.sidenote) {
|
||||
max-width: 1000px;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.post-content {
|
||||
position: relative;
|
||||
}
|
||||
.post-content .content-wrapper {
|
||||
max-width: 650px;
|
||||
position: relative;
|
||||
}
|
||||
.post-content .sidenote-container {
|
||||
position: static;
|
||||
}
|
||||
.post-content .sidenote {
|
||||
position: absolute;
|
||||
left: 690px;
|
||||
width: 250px;
|
||||
font-size: 0.85em;
|
||||
line-height: 1.4;
|
||||
padding: 10px;
|
||||
margin-top: 0;
|
||||
background: var(--code-bg);
|
||||
border-left: 2px solid var(--link-color);
|
||||
border-radius: 3px;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
#footnotes-section {
|
||||
display: none;
|
||||
}
|
||||
#sidenotes-column {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
// Theme toggle - runs immediately to prevent flash
|
||||
(function() {
|
||||
const theme = localStorage.getItem('theme') || 'light';
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
||||
<script>
|
||||
window.MathJax = {
|
||||
tex: {
|
||||
inlineMath: [['$', '$']],
|
||||
displayMath: [['$$', '$$']],
|
||||
processEscapes: true
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1><a href="/">{{ .Site.Title }}</a></h1>
|
||||
<div class="header-right">
|
||||
<nav>
|
||||
<a href="/resume.pdf">Resume</a>
|
||||
</nav>
|
||||
<button class="theme-toggle" onclick="toggleTheme()" aria-label="Toggle theme">
|
||||
<span class="theme-icon"></span>
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
{{ block "main" . }}{{ end }}
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<p>© {{ now.Year }} {{ .Site.Title }} | <a href="/index.xml">RSS</a> | <a href="/me.gpg">PGP Key</a> | <a href="/resume.pdf">Resume</a></p>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
function toggleTheme() {
|
||||
const html = document.documentElement;
|
||||
const currentTheme = html.getAttribute('data-theme');
|
||||
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
|
||||
html.setAttribute('data-theme', newTheme);
|
||||
localStorage.setItem('theme', newTheme);
|
||||
updateThemeIcon();
|
||||
}
|
||||
|
||||
function updateThemeIcon() {
|
||||
const theme = document.documentElement.getAttribute('data-theme');
|
||||
const icon = document.querySelector('.theme-icon');
|
||||
icon.textContent = theme === 'dark' ? '☀️' : '🌙';
|
||||
}
|
||||
|
||||
updateThemeIcon();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
12
layouts/_default/list.html
Normal file
12
layouts/_default/list.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{ define "main" }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
|
||||
{{ range .Pages }}
|
||||
<article style="margin-bottom: 25px;">
|
||||
<h3><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
|
||||
<p class="date">{{ .Date.Format "January 2, 2006" }}</p>
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
<p><a href="/">← Back to home</a></p>
|
||||
{{ end }}
|
||||
@@ -13,11 +13,11 @@
|
||||
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Tyler's Posts</title>
|
||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>Silly little posts I make for no one in particular</description>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
<language>en</language>{{ with .Site.Author.email }}
|
||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
||||
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
|
||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
||||
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
|
||||
@@ -32,7 +32,7 @@
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>{{ .Content | html -}}</description>
|
||||
<description>{{ .Summary | html }}</description>
|
||||
</item>
|
||||
{{ end }}
|
||||
</channel>
|
||||
|
||||
98
layouts/_default/single.html
Normal file
98
layouts/_default/single.html
Normal file
@@ -0,0 +1,98 @@
|
||||
{{ define "main" }}
|
||||
<article class="post-content">
|
||||
<div class="content-wrapper">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<p class="date">{{ .Date.Format "January 2, 2006" }}</p>
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
<div id="footnotes-section"></div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<p>
|
||||
<a href="/">← Back to home</a>
|
||||
{{ with .OutputFormats.Get "markdown" }}
|
||||
| <a href="{{ .RelPermalink }}" download>Download Markdown</a>
|
||||
{{ end }}
|
||||
</p>
|
||||
|
||||
<script>
|
||||
// On mobile, collect sidenotes and display at the end
|
||||
let sidenotesOrganized = false;
|
||||
|
||||
function positionSidenotes() {
|
||||
if (window.innerWidth < 1200) return;
|
||||
|
||||
const contentWrapper = document.querySelector('.content-wrapper');
|
||||
if (!contentWrapper) return;
|
||||
|
||||
const sidenotes = Array.from(document.querySelectorAll('.sidenote'));
|
||||
const containers = Array.from(document.querySelectorAll('.sidenote-container'));
|
||||
|
||||
// Position each sidenote relative to its reference point
|
||||
containers.forEach((container, index) => {
|
||||
const sidenote = container.querySelector('.sidenote');
|
||||
if (!sidenote) return;
|
||||
|
||||
const containerRect = container.getBoundingClientRect();
|
||||
const wrapperRect = contentWrapper.getBoundingClientRect();
|
||||
|
||||
// Calculate position relative to content-wrapper
|
||||
const topPosition = containerRect.top - wrapperRect.top;
|
||||
sidenote.style.top = topPosition + 'px';
|
||||
});
|
||||
|
||||
// Now check for overlaps and adjust
|
||||
for (let i = 0; i < sidenotes.length - 1; i++) {
|
||||
const current = sidenotes[i];
|
||||
const next = sidenotes[i + 1];
|
||||
|
||||
const currentRect = current.getBoundingClientRect();
|
||||
const nextRect = next.getBoundingClientRect();
|
||||
|
||||
// If next sidenote overlaps with current, push it down
|
||||
if (nextRect.top < currentRect.bottom + 10) {
|
||||
const currentTop = parseFloat(current.style.top) || 0;
|
||||
const currentHeight = currentRect.height;
|
||||
next.style.top = (currentTop + currentHeight + 10) + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function organizeSidenotes() {
|
||||
const sidenotes = document.querySelectorAll('.sidenote');
|
||||
const footnotesSection = document.getElementById('footnotes-section');
|
||||
|
||||
if (!footnotesSection) return;
|
||||
|
||||
if (window.innerWidth < 1200) {
|
||||
// Mobile: show at bottom
|
||||
if (!sidenotesOrganized) {
|
||||
footnotesSection.innerHTML = '<hr style="margin-top: 40px; border: none; border-top: 1px solid var(--border-color);"><h3>Notes</h3>';
|
||||
|
||||
sidenotes.forEach((sidenote) => {
|
||||
const clone = sidenote.cloneNode(true);
|
||||
clone.style.display = 'block';
|
||||
clone.style.position = 'static';
|
||||
clone.style.width = 'auto';
|
||||
clone.style.marginBottom = '15px';
|
||||
footnotesSection.appendChild(clone);
|
||||
});
|
||||
sidenotesOrganized = true;
|
||||
}
|
||||
} else {
|
||||
// Desktop: clear footnotes section and position sidenotes
|
||||
if (sidenotesOrganized) {
|
||||
footnotesSection.innerHTML = '';
|
||||
sidenotesOrganized = false;
|
||||
}
|
||||
setTimeout(positionSidenotes, 100);
|
||||
}
|
||||
}
|
||||
|
||||
organizeSidenotes();
|
||||
window.addEventListener('resize', organizeSidenotes);
|
||||
window.addEventListener('load', positionSidenotes);
|
||||
</script>
|
||||
{{ end }}
|
||||
7
layouts/_default/single.markdown
Normal file
7
layouts/_default/single.markdown
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
title: "{{ .Title }}"
|
||||
date: {{ .Date.Format "2006-01-02" }}
|
||||
{{ if .Draft }}draft: true{{ end }}
|
||||
---
|
||||
|
||||
{{ .RawContent }}
|
||||
Reference in New Issue
Block a user