aboutsummaryrefslogtreecommitdiff
path: root/themes/simple/layouts/partials
diff options
context:
space:
mode:
Diffstat (limited to 'themes/simple/layouts/partials')
-rw-r--r--themes/simple/layouts/partials/comments.html9
-rw-r--r--themes/simple/layouts/partials/footer.html62
-rw-r--r--themes/simple/layouts/partials/head.html21
-rw-r--r--themes/simple/layouts/partials/navigation.html29
-rw-r--r--themes/simple/layouts/partials/read-more.html16
-rw-r--r--themes/simple/layouts/partials/search.html191
-rw-r--r--themes/simple/layouts/partials/side-projects.html40
7 files changed, 0 insertions, 368 deletions
diff --git a/themes/simple/layouts/partials/comments.html b/themes/simple/layouts/partials/comments.html
deleted file mode 100644
index 50c28ca..0000000
--- a/themes/simple/layouts/partials/comments.html
+++ /dev/null
@@ -1,9 +0,0 @@
1<section class="comments">
2 <h2 class="text-xl font-bold mb-2">Want to comment or have something to add?</h2>
3
4 <p class="mb-10">
5 You can write me an email at
6 <a href="mailto:m@mitjafelicijan.com" class="underline-offset-2 underline">m@mitjafelicijan.com</a> or catch up with me
7 <a href="https://telegram.me/mitjafelicijan" target="_blank" class="underline-offset-2 underline">on Telegram</a>.
8 </p>
9</section>
diff --git a/themes/simple/layouts/partials/footer.html b/themes/simple/layouts/partials/footer.html
deleted file mode 100644
index 8367f21..0000000
--- a/themes/simple/layouts/partials/footer.html
+++ /dev/null
@@ -1,62 +0,0 @@
1<footer class="container-blog mx-auto px-6 md:p-0 text-gray-400 text-sm">
2 <hr class="border-2 border-gray-100 my-12">
3 <p class="pb-16">
4 This website does not track you.
5 Content is made available under the <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank"
6 rel="noreferrer" class="underline-offset-2 underline hover:text-gray-800">CC BY 4.0
7 license</a> unless specified otherwise.
8 Blog feed is available as <a href="/index.xml" target="_blank"
9 class="underline-offset-2 underline hover:text-gray-800">RSS feed</a>.
10 </p>
11</footer>
12
13<!-- Fathom - beautiful, simple website analytics -->
14<script src="https://cdn.usefathom.com/script.js" data-site="XHQARKXP" defer></script>
15
16{{ if ne .IsHome true }}
17<!-- KaTeX math library -->
18<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/katex.min.css"
19 integrity="sha384-RZU/ijkSsFbcmivfdRBQDtwuwVqK7GMOw6IMvKyeWL2K5UAlyp6WonmB8m7Jd0Hn" crossorigin="anonymous">
20<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/katex.min.js"
21 integrity="sha384-pK1WpvzWVBQiP0/GjnvRxV4mOb0oxFuyRxJlk6vVw146n3egcN5C925NCP7a7BY8" crossorigin="anonymous"></script>
22<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/contrib/auto-render.min.js"
23 integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl" crossorigin="anonymous"
24 onload="renderMathInElement(document.body);"></script>
25{{ end }}
26
27{{ if ne .IsHome true }}
28<!-- Lazy loading of iframes -->
29<script>
30 window.addEventListener('load', () => {
31 const iframes = document.querySelectorAll('.ll-iframe');
32
33 if (iframes) {
34 iframes.forEach(iframe => {
35 iframe.addEventListener('click', (evt) => {
36 // If there are no elements yet in the target element add iframe.
37 if (!evt.target.dataset.alreadyLoaded) {
38 // Setting this element as already loaded so it doesn't
39 // attempt to load it again.
40 evt.target.dataset.alreadyLoaded = true;
41
42 // Clearing up all existing elements inside of the target one.
43 evt.target.innerHTML = '';
44 evt.target.classList.add('empty');
45 evt.target.classList.add('border-0');
46
47 // Creating iframe DOM element.
48 const iframeElement = document.createElement('iframe');
49 iframeElement.classList.add('w-full');
50 iframeElement.classList.add('h-full');
51 iframeElement.classList.add('rounded');
52 iframeElement.src = evt.target.dataset.src;
53
54 // Appending iframe as a child of current element.
55 evt.target.appendChild(iframeElement);
56 }
57 });
58 });
59 }
60 });
61</script>
62{{ end }} \ No newline at end of file
diff --git a/themes/simple/layouts/partials/head.html b/themes/simple/layouts/partials/head.html
deleted file mode 100644
index fc481fc..0000000
--- a/themes/simple/layouts/partials/head.html
+++ /dev/null
@@ -1,21 +0,0 @@
1{{ $cachebuster := delimit (shuffle (split (md5 "6fab11c6669976d759d2992eff1dd5be") "" )) "" }}
2
3<meta charset="UTF-8">
4<meta name="theme-color" content="#ffffff">
5<meta name="viewport" content="width=device-width, initial-scale=1.0">
6
7<link rel="alternate" type="application/rss+xml" href="/index.xml" title="{{ .Site.Author.name }}">
8<link rel="alternate" type="application/rss+xml" href="/notes/index.xml" title="{{ .Site.Author.name }} - Notes">
9
10<link rel="stylesheet" href="/general/index.css?v={{ $cachebuster }}">
11
12<link href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL69vf8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv76+/8LBwQkAAAAAAAAAAAAAAAC+vb3/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL+9vf/Bv78JAAAAAAAAAAAAAAAAu7q6/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC7ubr/vr29CAAAAAAAAAAAy8nJAZ6foP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnqGj/6GipAoAAAAAHLjU/xcXHf/BwsL/I8XY/yPK3v8XGiD/IbjL/yPF2f8XGiD/Fxkf/yLF2f8gnK3/Fxog/62ztv8fwNf/FRcd/x271v8mz93/GRsi/xkXHf8p097/GiIp/xobIv8p0t3/KdPe/xocIv8fYmr/KNPe/xoZH/8aHCL/J87c/xy81/8VFxz/IsPZ/8zS0/8XGiD/Ir/R/yPH2/8XGiD/Fxkf/yPH2/8dd4T/GBog/yPJ3f8jyNr/uru9/xcUGv8cudb/EhITDKi5vRKlvMP/RUpOERwcHRAdOj4QHTk8EBwdHRAdNTgQHTo/EBwcHRAcHB0QSGduEKW4vf+koqQfHzg+EBqz0ewSFRv7EyMr/xq51vsTERb7ExUb+xq41fsau9j7ExUb+xiPp/sZudb7ExUb+xMVG/sZuNX/GKvI/BIUGfMdvdn/IrfL/xcaIP8n1eb/J9Dh/xkcIf8ZGR7/J8/f/xxCSv8ZGyH/J9Dg/ybQ4P8ZHCL/FSQs/yPK3/8UExj/GE1b/ybS5P8ZGB7/Ghwj/ynW5P8p2Ob/Ghwi/yWrtv8p1eH/Ghwi/xocIv8p1uT/J8XT/xkcIv8m1un/Hb7d/xUYH/8hzOr/HtHu/xcaIf8XGB//I8vi/xgxOv8XGSD/I8rg/yPK4P8XGiD/GUFL/yPP6f8SERj/Fhkh/x3A4f8AAAAAJ2f9/ydr//8mZPH/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlYu38J2v//ydo/f8AAAAAAAAAAAd8/fkFqf//Iob8sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMY39awWr//8FfP3/AAAAAAAAAAAFm/7/SfD//wR+/f8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOB/f9B7v//BaX+/wAAAAAAAAAAQ878SAyZ/v9n1v4KAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADu9v8DDJb+/z3N/XgAAAAA3/sAAN/7AADf+wAA3/sAAAAAAAAAAAAAAAAAAN/7AAAAAAAAAAAAAAAAAAAAAAAAj/EAAI/5AACP8QAA3/sAAA==" rel="icon" type="image/x-icon" />
13
14<title>{{ .Title }}</title>
15<meta name="description" content="{{ .Site.Params.description }}" />
16
17<meta property="og:type" content="article">
18<meta property="og:title" content="{{ .Title }}">
19<meta property="og:description" content="{{ if .Summary }}{{ .Summary }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
20<meta property="og:url" content="https://mitjafelicijan.com/{{ .Params.url }}">
21<meta property="og:image" content="https://mitjafelicijan.com/general/og-big.jpg?v={{ $cachebuster }}">
diff --git a/themes/simple/layouts/partials/navigation.html b/themes/simple/layouts/partials/navigation.html
deleted file mode 100644
index 73ae0ce..0000000
--- a/themes/simple/layouts/partials/navigation.html
+++ /dev/null
@@ -1,29 +0,0 @@
1<div class="container-blog mx-auto px-6 md:p-0">
2 <header class="flex py-4 mt-4 mb-8 flex-col md:flex-row items-center ">
3 <div class="flex-grow mb-2 md:mb-0">
4 <a href="/" itemprop="url" class="text-xl font-semibold hover:underline">Mitja Felicijan</a>
5 </div>
6
7 <nav itemscope itemtype="http://schema.org/SiteNavigationElement" class="flex items-center gap-1" role="toolbar">
8 <meta itemprop="name" content="Main Menu">
9
10 <!-- Search button -->
11 <span class="hidden lg:block">
12 <span class="search-button flex gap-2 items-center text-gray-500 bg-gray-100 hover:bg-gray-200 rounded px-2 py-1 text-xs cursor-pointer mr-2 hidden" onclick="showSearchModal()">
13 <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4" stroke="currentColor" class="w-3 h-3">
14 <path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" />
15 </svg>
16 <span class="search-button-text font-bold"></span>
17 </span>
18 </span>
19
20 <a href="/notes.html" class="font-medium px-2 hover:bg-yellow-200 rounded">Notes</a>
21 <a href="https://telegram.me/mitjafelicijan" target="_blank" rel="noopener nofollow" itemprop="url" class="font-medium px-2 hover:bg-yellow-200 rounded">Telegram</a>
22 <a href="https://git.mitjafelicijan.com" target="_blank" rel="noopener nofollow" itemprop="url" class="font-medium px-2 hover:bg-yellow-200 rounded">Git</a>
23 <a href="https://files.mitjafelicijan.com" target="_blank" rel="noopener nofollow" itemprop="url" class="font-medium px-2 hover:bg-yellow-200 rounded hidden md:block">Files</a>
24 <a href="/mitjafelicijan.pgp.pub.txt" itemprop="url" class="font-medium px-2 hover:bg-yellow-200 rounded">PGP</a>
25 <a href="/curriculum-vitae.html" class="font-medium px-2 hover:bg-yellow-200 rounded">CV</a>
26 <a href="/index.xml" itemprop="url" class="font-medium px-2 hover:bg-yellow-200 rounded hidden md:block">RSS</a>
27 </nav>
28 </header>
29</div>
diff --git a/themes/simple/layouts/partials/read-more.html b/themes/simple/layouts/partials/read-more.html
deleted file mode 100644
index 9de1554..0000000
--- a/themes/simple/layouts/partials/read-more.html
+++ /dev/null
@@ -1,16 +0,0 @@
1<section>
2 <h2 class="text-2xl font-bold mb-6">Read more from this site</h2>
3 <nav itemscope itemtype="https://schema.org/SiteNavigationElement" class="mb-12">
4 <meta itemprop="name" content="Article list">
5 <nav class="flex flex-col gap-4">
6 {{ $randomPosts := shuffle (where .Site.RegularPages "Type" "posts") | first 5 }}
7 {{ range $randomPosts }}
8 <div>
9 <time class="block text-gray-400 font-medium text-xs">{{ .Date.Format "Mon Jan 2, 2006" }}</time>
10 <a href="/{{ .Params.url }}" itemprop="url" class="block underline font-medium mb-1">{{ .Title }}</a>
11 <p class="text-gray-600 text-sm">{{ .Summary }}</p>
12 </div>
13 {{ end }}
14 </nav>
15 </nav>
16</section>
diff --git a/themes/simple/layouts/partials/search.html b/themes/simple/layouts/partials/search.html
deleted file mode 100644
index f157f03..0000000
--- a/themes/simple/layouts/partials/search.html
+++ /dev/null
@@ -1,191 +0,0 @@
1{{ $cachebuster := delimit (shuffle (split (md5 "6fab11c6669976d759d2992eff1dd5be") "" )) "" }}
2
3<section class="search-modal mb-10 hidden">
4 <input class="bg-gray-100 w-full px-3 py-2 rounded outline-none" type="search" placeholder="Search here...">
5 <section class="results bg-white border border-gray-200 shadow-md p-2 flex flex-col gap-2 rounded mt-4 hidden"></section>
6</section>
7
8<script src="https://unpkg.com/lunr/lunr.js"></script>
9<script>
10 (async function() {
11 const debounceDelay = 700;
12 const maxSearchResults = 10;
13
14 // Fetch search index generated by Hugo.
15 const req = await fetch('/index.json?v={{ $cachebuster }}');
16 window.searchDocuments = await req.json();
17
18 window.searchIndex = lunr(function() {
19 this.ref('permalink');
20 this.field('title', { boost: 20 });
21 this.field('tags', { boost: 10 });
22 this.field('summary', { boost: 1 });
23
24 window.searchDocuments.forEach(function(doc) {
25 this.add(doc);
26 }, this);
27
28 console.log('Search index processed...');
29 })
30
31 // Connect DOM and search the index.
32 let cachedSearchTerm = null;
33 const searchModal = document.querySelector('.search-modal');
34 const searchInput = document.querySelector('.search-modal input');
35 const searchResults = document.querySelector('.search-modal .results');
36
37 // Display search modal.
38 window.showSearchModal = function() {
39 searchModal.classList.remove('hidden');
40 searchInput.focus();
41 }
42
43 // Detect OS and sets proper search button text.
44 const searchButtonElement = document.querySelector('.search-button');
45 const searchButtonTextElement = document.querySelector('.search-button-text');
46 if (searchButtonElement) {
47 let searchButtonText = 'Ctrl+K';
48 if (navigator.platform.toUpperCase().indexOf('MAC') >= 0) {
49 searchButtonText = '⌘+K';
50 }
51 searchButtonTextElement.innerText = searchButtonText;
52 searchButtonElement.classList.remove('hidden');
53 }
54
55 // On keyboard shortcut shows search modal.
56 let currentSearchResultsSectionIndex = -1;
57 const itemHoverClass = 'bg-gray-100';
58 document.addEventListener('keydown', function(event) {
59 // Handles macOS CMD+k.
60 if ((event.ctrlKey || event.metaKey) && event.key === 'k') {
61 event.preventDefault();
62 showSearchModal();
63 }
64
65 // Handles Windows/Linux Ctrl+k.
66 if (event.ctrlKey && event.key === 'k') {
67 event.preventDefault();
68 showSearchModal();
69 }
70
71
72 // If ESC is pressed when the input is empty close the search modal.
73 if (event.key === 'Escape' || event.key === 'Esc') {
74 if (searchInput.value.length == 0) {
75 if (!searchModal.classList.contains('hidden')) {
76 cachedSearchTerm = null;
77 searchModal.classList.add('hidden');
78 searchResults.innerText = '';
79 if (!searchResults.classList.contains('hidden')) {
80 searchResults.classList.add('hidden');
81 }
82 }
83 } else {
84 const listItems = searchResults.querySelectorAll('a');
85 listItems.forEach(el => el.classList.remove(itemHoverClass));
86 currentSearchResultsSectionIndex = -1;
87 searchInput.focus();
88 }
89 }
90
91
92 // Arrow UP/DOWN movement through search results.
93 if (event.key === 'ArrowUp') {
94 if (!searchResults.classList.contains('hidden')) {
95 event.preventDefault();
96
97 const listItems = searchResults.querySelectorAll('a');
98 listItems.forEach(el => el.classList.remove(itemHoverClass));
99 currentSearchResultsSectionIndex--;
100
101 if (!listItems[currentSearchResultsSectionIndex]) {
102 currentSearchResultsSectionIndex = -1;
103 searchInput.focus();
104 }
105
106 if (currentSearchResultsSectionIndex != -1) {
107 listItems[currentSearchResultsSectionIndex].classList.add(itemHoverClass);
108 listItems[currentSearchResultsSectionIndex].focus();
109 }
110 }
111 }
112 if (event.key === 'ArrowDown') {
113 if (!searchResults.classList.contains('hidden')) {
114 event.preventDefault();
115
116 const listItems = searchResults.querySelectorAll('a');
117 listItems.forEach(el => el.classList.remove(itemHoverClass));
118 currentSearchResultsSectionIndex++;
119
120 if (!listItems[currentSearchResultsSectionIndex]) {
121 currentSearchResultsSectionIndex = 0;
122 }
123
124 if (currentSearchResultsSectionIndex != -1) {
125 listItems[currentSearchResultsSectionIndex].classList.add(itemHoverClass);
126 listItems[currentSearchResultsSectionIndex].focus();
127 }
128 }
129 }
130
131 });
132
133 // Debounce magic.
134 function debounce(func, delay) {
135 let timerId;
136 return function (...args) {
137 clearTimeout(timerId);
138 timerId = setTimeout(() => {
139 func.apply(this, args);
140 }, delay);
141 };
142 }
143
144 // Do the actual search.
145 searchInput.addEventListener('keyup', debounce((evt)=> {
146 const query = evt.target.value.trim().toLowerCase();
147 if (query.length && query != cachedSearchTerm) {
148 const results = searchIndex.search(`*${query}*`);
149
150 if (results.length == 0) {
151 if (!searchResults.classList.contains('hidden')) {
152 searchResults.classList.add('hidden');
153 }
154 } else {
155 searchResults.innerText = '';
156 searchResults.classList.remove('hidden');
157 cachedSearchTerm = query;
158
159 results.slice(0, maxSearchResults).forEach(resultItem => {
160 const item = window.searchDocuments.find(doc => doc.permalink === resultItem.ref);
161
162 const link = document.createElement('a');
163 link.href = item.permalink;
164 link.classList.add('hover:bg-gray-100', 'cursor-pointer', 'py-2', 'px-3', 'rounded');
165
166 const title = document.createElement('div');
167 title.classList.add('text-gray-800', 'font-medium');
168 title.innerHTML = item.title;
169 link.appendChild(title);
170
171 const meta = document.createElement('div');
172 meta.classList.add('text-gray-500', 'flex', 'items-center', 'gap-2');
173
174 const section = document.createElement('span');
175 section.classList.add('uppercase', 'text-xs', 'font-medium', 'bg-gray-200', 'px-1', 'rounded')
176 section.innerText = item.type;
177 meta.appendChild(section);
178
179 const summary = document.createElement('span');
180 const summaryText = item.summary.length > 80 ? `${item.summary.substring(0, 80)}...` : item.summary;
181 summary.innerHTML = summaryText;
182 meta.appendChild(summary);
183
184 link.appendChild(meta);
185 searchResults.appendChild(link);
186 });
187 }
188 }
189 }, debounceDelay));
190 })();
191</script>
diff --git a/themes/simple/layouts/partials/side-projects.html b/themes/simple/layouts/partials/side-projects.html
deleted file mode 100644
index 462ff45..0000000
--- a/themes/simple/layouts/partials/side-projects.html
+++ /dev/null
@@ -1,40 +0,0 @@
1<section class="mb-12">
2 <h2 class="text-2xl font-bold mb-6">Side projects I work/worked on</h2>
3
4 <nav class="flex flex-col gap-4 md:gap-0 md:border w-full mb-4">
5 <a href="https://git.mitjafelicijan.com/cord.h.git/" target="_blank" rel="noopener nofollow" class="block md:p-3 md:hover:bg-yellow-200 md:border-b">
6 <span class="block md:inline-block md:w-40 underline">cord.h</span>
7 <span>Small C library for handling strings</span>
8 </a>
9 <a href="https://git.mitjafelicijan.com/mprogress.git/" target="_blank" rel="noopener nofollow" class="block md:p-3 md:hover:bg-yellow-200 md:border-b">
10 <span class="block md:block md:inline-block md:w-40 underline">mprogress</span>
11 <span>Tiny utility that displays progress bar in terminal</span>
12 </a>
13 <a href="https://git.mitjafelicijan.com/journalctl-proxy.git/" target="_blank" rel="noopener nofollow" class="block md:p-3 md:hover:bg-yellow-200 md:border-b">
14 <span class="block md:inline-block md:w-40 underline">journalctl-proxy</span>
15 <span>Exposes your systemd logs to web via web interface</span>
16 </a>
17 <a href="https://git.mitjafelicijan.com/redis-marshal.git/" target="_blank" rel="noopener nofollow" class="block md:p-3 md:hover:bg-yellow-200 md:border-b">
18 <span class="block md:inline-block md:w-40 underline">redis-marshal</span>
19 <span>Lightweight Redis data exploration tool</span>
20 </a>
21 <a href="https://git.mitjafelicijan.com/dna-encoding.git/" target="_blank" rel="noopener nofollow" class="block md:p-3 md:hover:bg-yellow-200 md:border-b">
22 <span class="block md:inline-block md:w-40 underline">dna-encoding</span>
23 <span>Tools for encoding files to DNA sequence</span>
24 </a>
25 <a href="https://git.mitjafelicijan.com/vertex.git/" target="_blank" rel="noopener nofollow" class="block md:p-3 md:hover:bg-yellow-200 md:border-b">
26 <span class="block md:inline-block md:w-40 underline">vertex</span>
27 <span>Create mock API's and add basic logic to simplify prototyping</span>
28 </a>
29 <a href="https://git.mitjafelicijan.com/scarecrow.git/" target="_blank" rel="noopener nofollow" class="block md:hover:bg-yellow-200 md:p-3">
30 <span class="block md:inline-block md:w-40 underline">scarecrow</span>
31 <span>Minimal configuration reverse proxy</span>
32 </a>
33 </nav>
34
35 <p class="text-gray-500 italic">* For more projects, check out
36 my <a href="https://git.mitjafelicijan.com/" class="underline">Git
37 server</a>. Most of the projects there are probably work in progress and
38 should be considered as such.</p>
39
40</section>