From 7db1796c97d2c93c3895361209a59544c6391fac Mon Sep 17 00:00:00 2001 From: Jim Nielsen Date: Fri, 27 Feb 2026 00:19:47 -0700 Subject: [PATCH 1/4] initial --- src/routes/index.ori | 8 +++-- src/routes/shuffle.ori.html | 16 +++++++++ src/site.ori | 35 +++++++++++++----- src/templates/Note.ori.html | 2 +- src/templates/Page.ori.html | 71 +++++++++++++++---------------------- src/templates/icons.ori | 6 ++++ static/edit-link.js | 23 ++++++++++++ static/styles.css | 68 ++++++++++++++++++++++++++++------- 8 files changed, 162 insertions(+), 67 deletions(-) create mode 100644 src/routes/shuffle.ori.html create mode 100644 src/templates/icons.ori create mode 100644 static/edit-link.js diff --git a/src/routes/index.ori b/src/routes/index.ori index 67db516..9f8353c 100644 --- a/src/routes/index.ori +++ b/src/routes/index.ori @@ -1,7 +1,9 @@ (site) => ({ + site, title: "Jim Nielsen’s Notes", - children: Tree.map( - site.items, + children: `${Tree.map( + Tree.take(site.items, 10), (item) => (item) - ) + )}View all notes` + path: "/" }) \ No newline at end of file diff --git a/src/routes/shuffle.ori.html b/src/routes/shuffle.ori.html new file mode 100644 index 0000000..d335da4 --- /dev/null +++ b/src/routes/shuffle.ori.html @@ -0,0 +1,16 @@ + +Shuffle + + + diff --git a/src/site.ori b/src/site.ori index d5a56c2..45480f8 100644 --- a/src/site.ori +++ b/src/site.ori @@ -9,14 +9,31 @@ feed.xml = Origami.rss(site_truncated) index.html = (site) - // n = tree:map(_postData/items, { - // key: (post) => post/id - // value: (post) => { - // index.html: ./templates/Page.ori.html({ - // title: post/title, - // children: ./templates/Note.ori.html(post) - // }) - // } - // }) + shuffle = { + index.html: (site) + } + + n = { + index.html: ({ + site, + title: "Archive | Jim Nielsen’s Notes", + children: Tree.map( + site.items, + (item) => (item) + ) + path: "/n/" + }) + ...Tree.map(site.items, { + key: (post) => post.id + value: (post) => { + index.html: templates/Page.ori.html({ + title: post.title, + children: templates/Note.ori.html(post) + site: site, + path: `/n/${post.id}/` + }) + } + }) + } } diff --git a/src/templates/Note.ori.html b/src/templates/Note.ori.html index d3acff9..cd0b61b 100644 --- a/src/templates/Note.ori.html +++ b/src/templates/Note.ori.html @@ -10,7 +10,7 @@

${_.title}

  • - - + @@ -27,32 +27,41 @@ + ${_.path === '/' ? `

    Notes

    Quoting others & adding my 2¢ — a microblog.

    ${}
    + ` : ''}
    ${_.children}
    + ${_.path === '/' ? `
    Holy cow, you made it all the way to the bottom? Look at you 👏
    @@ -60,39 +69,17 @@

    Notes

    >Here’s a special gift.
    + + ` : ''} + diff --git a/src/templates/icons.ori b/src/templates/icons.ori new file mode 100644 index 0000000..99bb848 --- /dev/null +++ b/src/templates/icons.ori @@ -0,0 +1,6 @@ +{ + home: ``, + shuffle: ``, + // `` + rss: `` +} \ No newline at end of file diff --git a/static/edit-link.js b/static/edit-link.js new file mode 100644 index 0000000..26e9a5f --- /dev/null +++ b/static/edit-link.js @@ -0,0 +1,23 @@ +// Add 'Edit' link to each note for my own personal use +// But only if the global var has been set +let edit = window.localStorage.getItem("edit") === "true"; +const urlEdit = new URL(window.location).searchParams.get("edit"); +if (urlEdit) { + edit = urlEdit === "true"; + window.localStorage.setItem("edit", edit); +} +if (edit) { + Array.from(document.querySelectorAll("article")).forEach((article) => { + const id = article.getAttribute("id"); + + // Create the link + const editLink = document.createElement("a"); + editLink.href = "ia-writer://open?path=notes:" + id + ".md"; + editLink.textContent = "Edit"; + + // Add the link to the list + const li = document.createElement("li"); + li.appendChild(editLink); + article.querySelector("footer ul").appendChild(li); + }); +} diff --git a/static/styles.css b/static/styles.css index d6b3af8..247f99e 100644 --- a/static/styles.css +++ b/static/styles.css @@ -1,3 +1,7 @@ +@view-transition { + navigation: auto; +} + :root[data-theme="Notes"] { --c-bg: #fff; --c-text: #001d32; @@ -32,13 +36,13 @@ body { color: var(--c-text); } -a { +main a { color: inherit; text-decoration: none; border-bottom: 1px solid; transition: 0.1s ease color; } -a:hover { +main a:hover { color: var(--c-highlight); border-bottom: 2px solid var(--c-highlight); } @@ -181,8 +185,7 @@ nav:after { } }*/ -nav a { - border: none !important; +nav > * { display: flex; align-items: center; justify-content: center; @@ -190,20 +193,61 @@ nav a { box-shadow: 0 0 0 10px var(--c-bg); background: var(--c-bg); transition: 0.3s ease transform; + width: 48px; + height: 48px; + position: relative; + color: inherit; + border: none; +} + +nav > *:after { + content: ""; + position: absolute; + top: -2px; + left: -2px; + width: 100%; + height: 100%; + border-radius: 50%; + border: 2px solid var(--c-text-secondary); + opacity: 0.25; } -nav a:active { - transform: scale(0.9); + +nav > [aria-current="page"] { + opacity: 0.5; + border-color: transparent; + cursor: default !important; + pointer-events: none; } -nav a:first-child { + +nav > :first-child { z-index: 100; + margin-right: auto; } -[data-open-theme] nav > a:first-child svg, -nav a:hover svg { - fill: var(--c-highlight); +nav > *:hover { + color: inherit; + cursor: pointer; } nav svg { - fill: var(--c-text-secondary); - transition: 0.3s ease fill; + width: 24px; + height: 24px; +} + +/* nav button svg { + view-transition-name: nav-icon; +} */ + +::view-transition-old(nav-icon-shuffle), +::view-transition-new(nav-icon-shuffle) { + animation: nav-icon-spin 1.5s ease; +} + +@keyframes nav-icon-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } } From 3fd9dd7206f97b40213977fd5e78f7abcbabeae0 Mon Sep 17 00:00:00 2001 From: Jim Nielsen Date: Fri, 27 Feb 2026 21:40:40 -0700 Subject: [PATCH 2/4] tweaks --- src/templates/Page.ori.html | 17 +++++++++++++---- static/styles.css | 26 +++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/src/templates/Page.ori.html b/src/templates/Page.ori.html index c28b246..208b7f8 100644 --- a/src/templates/Page.ori.html +++ b/src/templates/Page.ori.html @@ -35,12 +35,12 @@ aria-current="${_.path=== '/' ? 'page' : 'false'}" >${} - + @@ -53,11 +53,20 @@ >${} --> - ${_.path === '/' ? ` + ${_.path === '/' || _.path === '/n/' ? `

    Notes

    Quoting others & adding my 2¢ — a microblog.

    - ${} + ${} ${(_.path === '/' || _.path === '/n/') ? ` +
    + Latest + All +
    + ` : ``}
    ` : ''}
    ${_.children}
    diff --git a/static/styles.css b/static/styles.css index 247f99e..ca029b6 100644 --- a/static/styles.css +++ b/static/styles.css @@ -213,7 +213,7 @@ nav > *:after { } nav > [aria-current="page"] { - opacity: 0.5; + opacity: 0.125; border-color: transparent; cursor: default !important; pointer-events: none; @@ -251,3 +251,27 @@ nav svg { transform: rotate(360deg); } } + +.archive-nav { + margin-top: 0.5rem; + margin-left: 2.25rem; + border-radius: 50px; + position: relative; + z-index: 1; +} +.archive-nav a { + text-align: center; + padding: 0.25rem 0.75rem; + border-radius: 5rem; + text-decoration: none; + color: var(--c-text-secondary); + transition: 0.3s ease color; +} +.archive-nav a:hover { +} +.archive-nav a[aria-current="page"] { + color: var(--c-bg); + background-color: var(--c-highlight); + cursor: default !important; + pointer-events: none; +} From ccad2dc2637a1c6f22c4ff5e0d88373024cd303e Mon Sep 17 00:00:00 2001 From: Jim Nielsen Date: Sat, 28 Feb 2026 13:32:21 -0700 Subject: [PATCH 3/4] updates --- src/site.ori | 4 ++-- src/templates/Note.ori.html | 2 +- src/templates/Page.ori.html | 29 +++++++++++++---------------- src/templates/icons.ori | 1 + 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/site.ori b/src/site.ori index 45480f8..cb78e9d 100644 --- a/src/site.ori +++ b/src/site.ori @@ -17,10 +17,10 @@ index.html: ({ site, title: "Archive | Jim Nielsen’s Notes", - children: Tree.map( + children: `
    Every note I’ve ever published is right here on this page, so use your browser’s built in search functionality to find the keywords you’re looking for.
    ${Tree.map( site.items, (item) => (item) - ) + )}` path: "/n/" }) ...Tree.map(site.items, { diff --git a/src/templates/Note.ori.html b/src/templates/Note.ori.html index cd0b61b..c6cce7e 100644 --- a/src/templates/Note.ori.html +++ b/src/templates/Note.ori.html @@ -1,5 +1,5 @@ -
    +

    ${_.title}

    Notes

    Quoting others & adding my 2¢ — a microblog.

    - ${} ${(_.path === '/' || _.path === '/n/') ? ` -
    - Latest - All -
    - ` : ``} + ${} ${(_.path === '/' || _.path === '/n/') ? ` ` : ``}
    ` : ''}
    ${_.children}
    @@ -78,9 +75,9 @@

    Notes

    >Here’s a special gift.
- ` : ''} +