aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2024-10-15 14:23:31 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2024-10-15 14:23:31 +0200
commit3e1fbbe545d2e15823d7f770621fc68b71f2d8d9 (patch)
tree4b7a26756590060194975d0150720a01e7eb7842
parente4b2890d0d064fe85ec1b800271a5fd0e2ef8fda (diff)
downloadmitjafelicijan.com-3e1fbbe545d2e15823d7f770621fc68b71f2d8d9.tar.gz
Added search boxes for posts and notes
-rw-r--r--static/assets/urls.txt46
-rw-r--r--templates/base.html15
-rw-r--r--templates/index.html34
3 files changed, 44 insertions, 51 deletions
diff --git a/static/assets/urls.txt b/static/assets/urls.txt
deleted file mode 100644
index 5fa1690..0000000
--- a/static/assets/urls.txt
+++ /dev/null
@@ -1,46 +0,0 @@
1# In Newsboat format - https://newsboat.org
2
3# Announcements
4https://harelang.org/index.xml Announcements
5https://emacsredux.com/atom.xml Announcements
6https://crawl.develz.org/wordpress/feed Announcements
7https://go.dev/blog/feed.atom Announcements
8https://blog.gtk.org/feed/ Announcements
9
10# Blogs
11https://jameshfisher.com/feed.xml Blogs
12https://www.computerenhance.com/feed Blogs
13https://tratt.net/laurie/news.rss Blogs
14https://willhbr.net/feed.xml Blogs
15https://andrewkelley.me/rss.xml Blogs
16https://beyondloom.com/blog/rss.xml Blogs
17https://blog.orhun.dev/rss.xml Blogs
18https://simonwillison.net/atom/entries/ Blogs
19https://til.simonwillison.net/tils/feed.atom Blogs
20https://danluu.com/atom.xml Blogs "~Dan Luu"
21https://www.andreinc.net/feed.xml Blogs
22https://voussoir.net/writing/writing.atom Blogs "~Ethan Dalool / Voussoir"
23https://blog.regehr.org/feed Blogs
24https://richiejp.com/atom.xml Blogs "~Richard Palethorpe"
25https://szymonkaliski.com/feed.xml Blogs
26https://world.hey.com/dhh/feed.atom Blogs
27https://world.hey.com/jason/feed.atom Blogs
28https://mitchellh.com/feed.xml Blogs
29https://matt-rickard.com/rss Blogs
30https://solar.lowtechmagazine.com/posts/index.xml Blogs
31https://utcc.utoronto.ca/~cks/space/blog/?atom Blogs
32https://neil.computer/rss/ Blogs
33https://matduggan.com/rss/ Blogs
34https://michael.stapelberg.ch/feed.xml Blogs
35https://offbeatpursuit.com/blog/index.rss Blogs "~Offbeatpursuit - Blog"
36https://offbeatpursuit.com/paste/index.rss Blogs "~Offbeatpursuit - Paste"
37https://offbeatpursuit.com/notes/index.rss Blogs "~Offbeatpursuit - Notes"
38https://journal.valeriansaliou.name/rss/ Blogs
39https://www.taniarascia.com/rss.xml Blogs
40https://snarky.ca/rss/ Blogs
41https://www.jeffgeerling.com/blog.xml Blogs
42https://serokell.io/blog.rss.xml Blogs
43https://www.duskborn.com/index.xml Blogs
44https://mirzapandzo.com/rss.xml Blogs
45https://mitjafelicijan.com/feed.xml Blogs
46
diff --git a/templates/base.html b/templates/base.html
index 2397716..fe37b15 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -11,8 +11,9 @@
11 <style> 11 <style>
12 :root { 12 :root {
13 --link-color: blue; 13 --link-color: blue;
14 --code-background: #eee; 14 --code-background: #efefef;
15 --inline-code-background: #eee; 15 --code-border: #aaa;
16 --inline-code-background: #efefef;
16 } 17 }
17 18
18 *::selection { 19 *::selection {
@@ -58,7 +59,7 @@
58 59
59 h1 { 60 h1 {
60 font-size: xx-large; 61 font-size: xx-large;
61 line-height: 110%; 62 line-height: 110%;
62 } 63 }
63 64
64 mark { padding: 0 0.3em; background-color: chartreuse; } 65 mark { padding: 0 0.3em; background-color: chartreuse; }
@@ -83,7 +84,7 @@
83 overflow-x: auto; 84 overflow-x: auto;
84 padding: 1em; 85 padding: 1em;
85 background: var(--code-background)!important; 86 background: var(--code-background)!important;
86 border: 1px solid black; 87 border: 1px solid var(--code-border);
87 } 88 }
88 89
89 code { 90 code {
@@ -129,6 +130,8 @@
129 130
130 pre { margin-block-start: 1em; margin-block-end: 1em; } 131 pre { margin-block-start: 1em; margin-block-end: 1em; }
131 132
133 section.quick-jump { display: grid; gap: 1em; margin-top: 1em; grid-template-columns: 1fr 1fr; }
134
132 .promobox { 135 .promobox {
133 margin-top: 1em; 136 margin-top: 1em;
134 text-decoration: none; 137 text-decoration: none;
@@ -165,6 +168,8 @@
165 display: block; 168 display: block;
166 overflow-y: auto; 169 overflow-y: auto;
167 } 170 }
171
172 section.quick-jump { grid-template-columns: 1fr; }
168 } 173 }
169 </style> 174 </style>
170 <script defer src="https://app.tinyanalytics.io/pixel/isfRNEahfHiS2Ttp"></script> 175 <script defer src="https://app.tinyanalytics.io/pixel/isfRNEahfHiS2Ttp"></script>
@@ -175,8 +180,8 @@
175 <a href="/">Home</a> 180 <a href="/">Home</a>
176 <a href="https://github.com/mitjafelicijan" target="_blank">Code</a> 181 <a href="https://github.com/mitjafelicijan" target="_blank">Code</a>
177 <a href="https://github.com/mitjafelicijan/probe" target="_blank">Probe</a> 182 <a href="https://github.com/mitjafelicijan/probe" target="_blank">Probe</a>
183 <a href="https://github.com/mitjafelicijan/dotfiles" target="_blank">Dotfiles</a>
178 <a href="/assets/mitjafelicijan.pgp.pub.txt">PGP</a> 184 <a href="/assets/mitjafelicijan.pgp.pub.txt">PGP</a>
179 <a href="/assets/urls.txt">Blogroll</a>
180 <a href="/curriculum-vitae.html">CV</a> 185 <a href="/curriculum-vitae.html">CV</a>
181 <a href="/feed.xml">RSS</a> 186 <a href="/feed.xml">RSS</a>
182 </nav> 187 </nav>
diff --git a/templates/index.html b/templates/index.html
index f5821fc..e3586ff 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -11,6 +11,40 @@
11 bytes (trigraphs). 11 bytes (trigraphs).
12</a> 12</a>
13 13
14<section class="quick-jump">
15 <input list="qj-posts" placeholder="Search for posts">
16 <datalist id="qj-posts">
17 {{ range .Pages }}
18 {{ if and (eq .Type "post") (not .Draft) }}
19 <option data-url="{{ .RelPermalink }}">{{ .Title }}</option>
20 {{ end }}
21 {{ end }}
22 </datalist>
23 <input list="qj-notes" placeholder="Search for notes">
24 <datalist id="qj-notes">
25 {{ range .Pages }}
26 {{ if and (eq .Type "note") (not .Draft) }}
27 <option data-url="{{ .RelPermalink }}">{{ .Title }}</option>
28 {{ end }}
29 {{ end }}
30 </datalist>
31</section>
32
33<script>
34document.querySelectorAll("section.quick-jump input[list]").forEach(s => {
35 s.addEventListener("change", e => {
36 const input = e.target;
37 const datalist = e.target.list;
38 for (var j = 0; j < datalist.options.length; j++) {
39 if (input.value == datalist.options[j].value) {
40 console.log(input.value, datalist.options[j].dataset.url);
41 window.location.href = `/${datalist.options[j].dataset.url}`;
42 }
43 }
44 });
45});
46</script>
47
14<section> 48<section>
15 <h2>More long form, ramblings etc</h2> 49 <h2>More long form, ramblings etc</h2>
16 <ul itemscope itemtype="https://schema.org/SiteNavigationElement" role="list" aria-label="More long form, ramblings etc"> 50 <ul itemscope itemtype="https://schema.org/SiteNavigationElement" role="list" aria-label="More long form, ramblings etc">