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