Some cleanup

This commit is contained in:
Daniel Flanagan 2023-06-26 14:57:21 -05:00
parent 818889f55a
commit ad4e8ef09f
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
6 changed files with 58 additions and 19 deletions

View file

@ -3,7 +3,7 @@
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" }}
<h2 id="{{ .Title }}">{{ .Title }}</h2> <h2 id="{{ .Title }}"><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
{{ with .Lastmod }} {{ with .Lastmod }}
<p> <p>
Posted on {{ dateFormat "Jan 2 2006" . }} Posted on {{ dateFormat "Jan 2 2006" . }}

View file

@ -1,6 +1,8 @@
<h3> <h3>
<a style="flex-shrink: 1; margin-right: auto;" href="{{ .Permalink }}"> <a style="flex-shrink: 1; margin-right: auto;" href="{{ .Permalink }}">
{{ print .Title " posted on " (dateFormat "Jan 2 2006" (cond .Date.IsZero .Lastmod .Date)) }} {{ .Title }}
</a> </a>
<br />
<small>Posted on {{ dateFormat "Jan 2 2006" (cond .Date.IsZero .Lastmod .Date) }}</small>
</h3> </h3>
{{ .Summary }} {{ .Summary }}

View file

@ -2,19 +2,32 @@
{{ .Content }} {{ .Content }}
<h2 id="latest-posts">Latest <a href="/blog">Blog</a> Posts (<a target="_blank" href="/blog/index.xml">RSS</a>)</h2> <details open>
<summary>
<h2 id="latest-posts">
Latest <a href="/blog">Blog</a> Posts (<a target="_blank" href="/blog/index.xml">RSS</a>)
</h2>
</summary>
{{ range (where .Site.RegularPages "Section" "blog") }} {{ range (where .Site.RegularPages "Section" "blog") }}
{{ .Render "li" }} {{ .Render "li" }}
{{ else }} {{ else }}
<p>Looks like there's nothing here!... yet!</p> <p>Looks like there's nothing here!... yet!</p>
{{ end }} {{ end }}
</details>
<h2 id="latest-tips">Latest <a href="/tips">Tips</a> (<a target="_blank" href="/tips/index.xml">RSS</a>)</h2> <details open>
{{ range (where .Site.RegularPages "Section" "tips") }} <summary>
<h2 id="latest-tips">
Latest <a href="/tips">Tips</a> (<a target="_blank" href="/tips/index.xml">RSS</a>)
</h2>
</summary>
{{ range (where .Site.RegularPages "Section" "tips") }}
{{ .Render "li" }} {{ .Render "li" }}
{{ else }} {{ else }}
<p>Looks like there's nothing here!... yet!</p> <p>Looks like there's nothing here!... yet!</p>
{{ end }} {{ end }}
</details>
{{ end }} {{ end }}

View file

@ -1,6 +1,8 @@
<h3> <h3>
<a style="flex-shrink: 1; margin-right: auto;" href="{{ .Permalink }}"> <a style="flex-shrink: 1; margin-right: auto;" href="{{ .Permalink }}">
{{ print .Title " posted on " (dateFormat "Jan 2 2006" (cond .Date.IsZero .Lastmod .Date)) }} {{ .Title }}
</a> </a>
<br />
<small>Posted on {{ dateFormat "Jan 2 2006" (cond .Date.IsZero .Lastmod .Date) }}</small>
</h3> </h3>
{{ .Content }} {{ .Content }}

View file

@ -9,7 +9,7 @@ a
color var(--link-fg) color var(--link-fg)
&:visited { color: var(--link-visited-fg) } &:visited { color: var(--link-visited-fg) }
a > svg main a > svg
margin-right: 0.5em margin-right: 0.5em
button.copy-code-button button.copy-code-button
@ -31,6 +31,28 @@ button.copy-code-button
img, embed, frame, iframe { max-width: 100vw } img, embed, frame, iframe { max-width: 100vw }
details > summary
cursor pointer
list-style none
details > summary::-webkit-details-marker
display none
details > summary::after
position absolute
top 0
right 0
align-self center
content "+"
details[open] > summary::after
content "-"
details
position relative
padding-left 0.5em
border-left solid var(--syntax-bpx) var(--syntax-ledg)
html,body html,body
min-height 100vh min-height 100vh
background-color var(--bg) background-color var(--bg)
@ -56,7 +78,7 @@ html,body
border-left solid var(--syntax-bpx) var(--syntax-ledg) border-left solid var(--syntax-bpx) var(--syntax-ledg)
display flex display flex
.highlight, h1, h2, h3, h4, h5, h6, form, ul, ol, p .highlight, h1, h2, h3, h4, h5, h6, form, ul, ol, p, details
margin-top 1em margin-top 1em
margin-bottom 0.25em margin-bottom 0.25em
@ -219,7 +241,7 @@ form
line-height 1.5em line-height 1.5em
text-align left text-align left
h1, h2, h3, h4, h5, h6, form, ul, ol, p, table, .content h1, h2, h3, h4, h5, h6, form, ul, ol, p, table, .content, details
position relative position relative
max-width 600px max-width 600px
margin-left auto margin-left auto

View file

@ -38,7 +38,7 @@ document.querySelectorAll(".align-toggler").forEach((a) =>
); );
window.addEventListener("load", (_ev) => { window.addEventListener("load", (_ev) => {
const selector = [1, 2, 3, 4, 5, 6].map((n) => `h${n}[id]`).join(","); const selector = [1, 2, 3, 4, 5, 6].map((n) => `main > h${n}[id]`).join(",");
document.querySelectorAll(selector).forEach((el) => { document.querySelectorAll(selector).forEach((el) => {
const anchorLink = document.createElement("a"); const anchorLink = document.createElement("a");
anchorLink.classList.add("anchor-link"); anchorLink.classList.add("anchor-link");