diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2023-05-27 17:17:41 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2023-05-27 17:17:41 +0200 |
| commit | 5b0d04bf2be32e85e68fc1339000a0ea5a15543c (patch) | |
| tree | 4e0a5f1c97ffffa6f070e93e6a76d5a4accf76d9 /themes | |
| parent | eb2cf9f9476473811178d1c5cfdd71a0293fdff4 (diff) | |
| download | mitjafelicijan.com-5b0d04bf2be32e85e68fc1339000a0ea5a15543c.tar.gz | |
Added tgas pages
Diffstat (limited to 'themes')
| -rw-r--r-- | themes/simple/layouts/_default/notes.html | 19 | ||||
| -rw-r--r-- | themes/simple/layouts/tags/list.html | 88 | ||||
| -rw-r--r-- | themes/simple/static/css/tailwind.css | 6 |
3 files changed, 112 insertions, 1 deletions
diff --git a/themes/simple/layouts/_default/notes.html b/themes/simple/layouts/_default/notes.html index e2672e4..3474be6 100644 --- a/themes/simple/layouts/_default/notes.html +++ b/themes/simple/layouts/_default/notes.html | |||
| @@ -13,10 +13,27 @@ | |||
| 13 | 13 | ||
| 14 | <hr class="border-2 border-gray-100 mb-8"> | 14 | <hr class="border-2 border-gray-100 mb-8"> |
| 15 | 15 | ||
| 16 | <!-- Dropdown selector to jump to note --> | ||
| 16 | <select id="jump-to-note" class="px-3 py-2 rounded mb-2 bg-gray-100 w-full md:w-auto"> | 17 | <select id="jump-to-note" class="px-3 py-2 rounded mb-2 bg-gray-100 w-full md:w-auto"> |
| 17 | <option>Jump to note</option> | 18 | <option>Jump to note</option> |
| 18 | </select> | 19 | </select> |
| 19 | 20 | ||
| 21 | <!-- List all unique tags --> | ||
| 22 | <nav itemscope itemtype="https://schema.org/SiteNavigationElement" class="mt-6 mb-10" role="feed"> | ||
| 23 | <meta itemprop="name" content="Tag list"> | ||
| 24 | <section> | ||
| 25 | <ul class="flex flex-wrap gap-2"> | ||
| 26 | {{ range .Site.Taxonomies.tags }} | ||
| 27 | <li> | ||
| 28 | <a href="{{ .Page.Permalink }}" class="inline-block px-3 py-1 rounded bg-gray-100 hover:bg-yellow-100"> | ||
| 29 | {{ .Page.Title }} | ||
| 30 | </a> | ||
| 31 | </li> | ||
| 32 | {{ end }} | ||
| 33 | </ul> | ||
| 34 | </section> | ||
| 35 | </nav> | ||
| 36 | |||
| 20 | <!-- List of all notes --> | 37 | <!-- List of all notes --> |
| 21 | <nav itemscope itemtype="https://schema.org/SiteNavigationElement" class="mb-12" role="feed"> | 38 | <nav itemscope itemtype="https://schema.org/SiteNavigationElement" class="mb-12" role="feed"> |
| 22 | <meta itemprop="name" content="Article list"> | 39 | <meta itemprop="name" content="Article list"> |
| @@ -38,7 +55,7 @@ | |||
| 38 | <span class="inline-flex flex-row gap-1"> | 55 | <span class="inline-flex flex-row gap-1"> |
| 39 | <span>(</span> | 56 | <span>(</span> |
| 40 | {{ range .Params.tags }} | 57 | {{ range .Params.tags }} |
| 41 | <span>{{ . }}</span> | 58 | <a href="/tags/{{ . | urlize }}.html">{{ . }}</a> |
| 42 | {{ end }} | 59 | {{ end }} |
| 43 | <span>)</span> | 60 | <span>)</span> |
| 44 | </span> | 61 | </span> |
diff --git a/themes/simple/layouts/tags/list.html b/themes/simple/layouts/tags/list.html new file mode 100644 index 0000000..3aa801b --- /dev/null +++ b/themes/simple/layouts/tags/list.html | |||
| @@ -0,0 +1,88 @@ | |||
| 1 | {{ define "main" }} | ||
| 2 | <main role="main" class="container-blog mx-auto px-6 md:p-0"> | ||
| 3 | |||
| 4 | <section class="mb-6"> | ||
| 5 | <h1 class="text-2xl font-bold mb-2 italic"> | ||
| 6 | <span class="blue">{{ .Title }}</span> | ||
| 7 | <span>//</span> | ||
| 8 | <span>notes</span> | ||
| 9 | <span>//</span> | ||
| 10 | <span class="text-sm">{{ len .Pages }} of them</span> | ||
| 11 | </h1> | ||
| 12 | <p class="text-gray-600 italic"> | ||
| 13 | Notes about things I learn, things I do, things I want to remember, | ||
| 14 | but never do. You can subscribe to this | ||
| 15 | <a href="/notes.xml" class="underline hover:bg-yellow-100">RSS feed</a> | ||
| 16 | which contains only the notes without the blog posts. | ||
| 17 | </p> | ||
| 18 | </section> | ||
| 19 | |||
| 20 | <hr class="border-2 border-gray-100 mb-8"> | ||
| 21 | |||
| 22 | <!-- Dropdown selector to jump to note --> | ||
| 23 | <select id="jump-to-note" class="px-3 py-2 rounded mb-2 bg-gray-100 w-full md:w-auto"> | ||
| 24 | <option>Jump to note</option> | ||
| 25 | </select> | ||
| 26 | |||
| 27 | <!-- List of all notes --> | ||
| 28 | <nav itemscope itemtype="https://schema.org/SiteNavigationElement" class="mb-12" role="feed"> | ||
| 29 | <meta itemprop="name" content="Article list"> | ||
| 30 | <section> | ||
| 31 | {{ range .Pages }} | ||
| 32 | <div class="mb-10"> | ||
| 33 | <article class="mb-5 single note" itemscope itemtype="http://schema.org/Article"> | ||
| 34 | <a href="{{ .Params.url }}"> | ||
| 35 | <h2 class="text-xl font-medium notes-heading">{{.Title}}</h2> | ||
| 36 | </a> | ||
| 37 | <p class="text-gray-600 _italic text-sm flex flex-col md:flex-row gap-1"> | ||
| 38 | <time datetime="{{ .Date.Format "2006-01-02" }}" itemprop="datePublished"> | ||
| 39 | {{ .Date.Format "Monday Jan 2, 2006" }} | ||
| 40 | </time> | ||
| 41 | |||
| 42 | {{ if .Params.tags }} | ||
| 43 | <span class="hidden md:inline-block"> | ||
| 44 | <span>with tags</span> | ||
| 45 | <span class="inline-flex flex-row gap-1"> | ||
| 46 | <span>(</span> | ||
| 47 | {{ range .Params.tags }} | ||
| 48 | <span>{{ . }}</span> | ||
| 49 | {{ end }} | ||
| 50 | <span>)</span> | ||
| 51 | </span> | ||
| 52 | </span> | ||
| 53 | {{ end }} | ||
| 54 | <div class="content"> | ||
| 55 | {{ .Content | safeHTML }} | ||
| 56 | </div> | ||
| 57 | </article> | ||
| 58 | </div> | ||
| 59 | {{ end }} | ||
| 60 | </section> | ||
| 61 | </nav> | ||
| 62 | |||
| 63 | <script> | ||
| 64 | try { | ||
| 65 | const notes = document.querySelectorAll('h2'); | ||
| 66 | const select = document.querySelector('#jump-to-note'); | ||
| 67 | |||
| 68 | notes.forEach(note => { | ||
| 69 | const id = note.innerText.toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g, ''); | ||
| 70 | note.id = id; | ||
| 71 | note.innerHTML = `<a href="#${id}"></a>${note.innerHTML}`; | ||
| 72 | |||
| 73 | const option = document.createElement('option'); | ||
| 74 | option.value = id; | ||
| 75 | option.innerText = note.innerText; | ||
| 76 | select.appendChild(option); | ||
| 77 | |||
| 78 | select.addEventListener('change', () => { | ||
| 79 | window.location.hash = select.value; | ||
| 80 | }); | ||
| 81 | }); | ||
| 82 | } catch (error) { | ||
| 83 | console.error(error); | ||
| 84 | } | ||
| 85 | </script> | ||
| 86 | |||
| 87 | </main> | ||
| 88 | {{ end }} | ||
diff --git a/themes/simple/static/css/tailwind.css b/themes/simple/static/css/tailwind.css index db7294b..b99c7fc 100644 --- a/themes/simple/static/css/tailwind.css +++ b/themes/simple/static/css/tailwind.css | |||
| @@ -18,10 +18,16 @@ | |||
| 18 | @apply bg-yellow-100 text-black; | 18 | @apply bg-yellow-100 text-black; |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | /* Helpers */ | ||
| 22 | |||
| 21 | a:hover { | 23 | a:hover { |
| 22 | color: blue; | 24 | color: blue; |
| 23 | } | 25 | } |
| 24 | 26 | ||
| 27 | .blue { | ||
| 28 | color: blue; | ||
| 29 | } | ||
| 30 | |||
| 25 | /* Headings */ | 31 | /* Headings */ |
| 26 | article.single h2 { | 32 | article.single h2 { |
| 27 | @apply text-2xl font-bold mb-8 mt-8 leading-tight; | 33 | @apply text-2xl font-bold mb-8 mt-8 leading-tight; |
