Debian Codegraph @

www/src/content/essays/index.mdx

raw
1 ---
2 title: Essays
3 description: "On hypermedia and building for the web."
4 ---
5
6 import { getFolder } from '../../lib/content';
7
8 export const essayFolder = await getFolder('essays');
9 export const localEssays = essayFolder.files;
10
11 export const externalEssays = [
12 {title: "HATEOAS Is For Humans", url: "https://intercoolerjs.org/2016/05/08/hatoeas-is-for-humans.html", author: "Carson Gross", date: "2016-05-08", tags: "foundations"},
13 {title: "Taking HTML Seriously", url: "https://intercoolerjs.org/2020/01/14/taking-html-seriously", author: "Carson Gross", date: "2020-01-14", tags: "foundations"},
14 {title: "The API Churn/Security Trade-off", url: "https://intercoolerjs.org/2016/02/17/api-churn-vs-security.html", author: "Carson Gross", date: "2016-02-17", tags: "the-case-for-hypermedia"},
15 {title: "A Modest Critique of htmx", url: "https://chrisdone.com/posts/htmx-critique/", author: "Chris Done", date: "2024-10-01", tags: "counterpoints"},
16 {title: "A Modest Critique of htmx (Response)", url: "https://news.ycombinator.com/item?id=41782080", date: "2024-10-01", tags: "counterpoints"},
17 {title: "I tried HTMX, then ditched it", url: "https://ajmoon.com/posts/mesh-i-tried-htmx-then-ditched-it", author: "AJ Moon", tags: "counterpoints"},
18 {title: "Is Rendering JSON More Efficient Than HTML?", url: "https://github.com/1cg/html-json-speed-comparison", author: "Carson Gross", tags: "guides"},
19 {title: "Is JSON Smaller Than HTML?", url: "https://github.com/1cg/html-json-size-comparison", author: "Carson Gross", tags: "guides"},
20 {title: "The Grug Brained Developer", url: "https://grugbrain.dev", author: "Carson Gross", tags: "simplicity"},
21 {title: "htmx Implementation Deep Dive", url: "https://www.youtube.com/watch?v=javGxN-h9VQ", author: "Carson Gross", tags: "simplicity"},
22 {title: "A File Structure For The Complex, The Changing and the Indeterminate", url: "https://dl.acm.org/doi/pdf/10.1145/800197.806036", author: "Ted Nelson", date: "1965-01-01", tags: "research"},
23 {title: "The Mother Of All Demos", url: "https://www.youtube.com/watch?v=B6rKUf9DWRI", author: "Doug Engelbart", date: "1968-01-01", tags: "research"},
24 {title: "The First Web Page", url: "http://info.cern.ch/hypertext/WWW/TheProject.html", date: "1991-01-01", tags: "research"},
25 {title: "Architectural Styles and the Design of Network-based Software Architectures", url: "https://ics.uci.edu/~fielding/pubs/dissertation/top.htm", author: "Roy Fielding", date: "2000-01-01", tags: "research"},
26 {title: "State of the Art Review on Hypermedia Issues and Applications", url: "https://web.archive.org/web/20240428215142/https://paul.luon.net/hypermedia/index.html", date: "2006-01-01", tags: "research"},
27 {title: "How Primer changed JavaScript at Facebook", url: "https://youtu.be/BZmfCjtv6cM", author: "Makinde Adeagbo & Tom Occhino", date: "2010-01-01", tags: "research"},
28 {title: "Hypermedia Controls: Feral to Formal", url: "https://dl.acm.org/doi/pdf/10.1145/3648188.3675127", author: "ACM HT'24", date: "2024-01-01", tags: "research"},
29 {title: "Preserving REST-ful Visibility With Generalized Hypermedia Controls", url: "https://hypermedia.cs.montana.edu/papers/preserving-restful.pdf", author: "ACM SIGWEB", date: "2024-01-01", tags: "research"},
30 ];
31
32 export const fmtDate = (d) => {
33 if (!d) return undefined;
34 return new Date(d).toLocaleDateString('en-US', {year: 'numeric', month: 'short', day: 'numeric'});
35 };
36
37 export const allEssays = [
38 ...localEssays.map(e => ({
39 title: e.frontmatter.title,
40 url: e.url,
41 author: e.frontmatter.authors?.join(', '),
42 date: fmtDate(e.frontmatter.created),
43 rawDate: e.frontmatter.created,
44 tags: Array.isArray(e.frontmatter.tags) ? e.frontmatter.tags.join(' ') : '',
45 external: false,
46 })),
47 ...externalEssays.map(e => ({
48 title: e.title,
49 url: e.url,
50 author: e.author,
51 date: fmtDate(e.date),
52 rawDate: e.date ? new Date(e.date) : null,
53 tags: e.tags,
54 external: true,
55 })),
56 ].sort((a, b) => {
57 if (!a.rawDate && !b.rawDate) return 0;
58 if (!a.rawDate) return 1;
59 if (!b.rawDate) return 1;
60 return new Date(b.rawDate).getTime() - new Date(a.rawDate).getTime();
61 });
62
63 export const GROUPS = [
64 {id: 'foundations', label: 'Hypermedia and REST'},
65 {id: 'the-case-for-hypermedia', label: 'Why Hypermedia?'},
66 {id: 'case-studies', label: 'Real World htmx Experiences'},
67 {id: 'counterpoints', label: 'On The Other Hand…'},
68 {id: 'guides', label: 'Building Hypermedia Applications'},
69 {id: 'simplicity', label: 'Complexity Very, Very Bad'},
70 {id: 'research', label: 'Hypermedia Research'},
71 ];
72
73 export const recentEssays = allEssays.filter(e => e.rawDate).slice(0, 5);
74 export const grouped = GROUPS.map(g => ({
75 ...g,
76 essays: allEssays.filter(e => (e.tags || '').includes(g.id)),
77 })).filter(g => g.essays.length > 0);
78
79 export const essayRow = (essay) => ({
80 class: "stretch-link",
81 'data-filter': `${essay.title} ${essay.author || ''} ${essay.tags || ''}`.toLowerCase(),
82 });
83
84 <div class="not-prose mb-6">
85 <input
86 type="text"
87 placeholder="Search essays..."
88 autocomplete="off"
89 class="w-full px-3 py-2 text-sm border border-neutral-200 dark:border-neutral-800 rounded-md bg-white dark:bg-neutral-900 text-neutral-800 dark:text-neutral-200 placeholder:text-neutral-400 dark:placeholder:text-neutral-500 focus:outline-none focus:ring-2 focus:ring-neutral-300/50 dark:focus:ring-neutral-600/50 focus:border-neutral-300 dark:focus:border-neutral-600"
90 _="install ActiveSearch"
91 />
92 </div>
93
94 <section role="group">
95
96 <h2 id="most-recent">Most Recent</h2>
97
98 <table>
99 <tbody>
100 {recentEssays.map(essay => (
101 <tr {...essayRow(essay)}>
102 <td><a href={essay.url} {...(essay.external && {target: "_blank", rel: "noopener noreferrer"})}>{essay.title}{essay.external && ' ↗'}</a></td>
103 <td class="whitespace-nowrap text-neutral-650 dark:text-neutral-350">{essay.author || ''}</td>
104 <td class="whitespace-nowrap tabular-nums text-neutral-650 dark:text-neutral-350">{essay.date}</td>
105 </tr>
106 ))}
107 </tbody>
108 </table>
109
110 </section>
111
112 {grouped.map(group => (
113 <section role="group">
114
115 <h2 id={group.id}>{group.label}</h2>
116
117 <table>
118 <tbody>
119 {group.essays.map(essay => (
120 <tr {...essayRow(essay)}>
121 <td><a href={essay.url} {...(essay.external && {target: "_blank", rel: "noopener noreferrer"})}>{essay.title}{essay.external && ' ↗'}</a></td>
122 <td class="whitespace-nowrap text-neutral-650 dark:text-neutral-350">{essay.author || ''}</td>
123 <td class="whitespace-nowrap tabular-nums text-neutral-650 dark:text-neutral-350">{essay.date || ''}</td>
124 </tr>
125 ))}
126 </tbody>
127 </table>
128
129 </section>
130 ))}