feat: move all pages into cms

This commit is contained in:
Cory Dransfeldt 2024-09-29 11:45:08 -07:00
parent 63e5961756
commit b5d5424555
No known key found for this signature in database
13 changed files with 14 additions and 262 deletions

View file

@ -0,0 +1,4 @@
---
permalink: /api/search
---
{{ collections.searchIndex | json }}

View file

@ -1,38 +0,0 @@
---
title: About
layout: page
permalink: /about.html
---
{%- assign artist = music.week.artists | first -%}
{%- assign book = books.all | bookStatus: 'started' | reverse | first -%}
{%- assign show = tv.recentlyWatched | first -%}
<div class="avatar-wrapper">
<div class="interior">
{%- capture about_alt -%}{{ globals.site_name }} - image by @joel@fosstodon.org{%- endcapture -%}
<img
srcset="
https://cdn.coryd.dev/{{ globals.about }}?class=squaresm&type=webp 200w,
https://cdn.coryd.dev/{{ globals.about }}?class=squaremd&type=webp 400w,
https://cdn.coryd.dev/{{ globals.about }}?class=squarebase&type=webp 800w
"
sizes="(max-width: 450px) 200px, (max-width: 850px) 400px, 800px"
src="https://cdn.coryd.dev/{{ globals.about }}?class=squaresm&type=webp"
alt="{{ about_alt }}"
loading="eager"
decoding="async"
width="200"
height="200"
/>
</div>
</div>
<h2 class="about-title">Hi, I'm Cory</h2>
<strong class="highlight-text">I'm a software developer based in Camarillo, California</strong>. I enjoy hanging out with my beautiful family and 3 rescue dogs, technology, automation, [music](https://coryd.dev/music), [writing](https://coryd.dev/posts), [reading](https://coryd.dev/books), [tv](https://coryd.dev/watching#tv) and [movies](https://coryd.dev/watching#movies). Lately I've been listening to a lot of <strong class="highlight-text">{{ artist.title }}</strong>, reading <strong class="highlight-text">{{ book.title }}</strong> and watching <strong class="highlight-text">{{ show.name }}</strong>.
I build, maintain and design web applications. I've been coding professionally since 2010 with a focus on frontend technologies. I also mentor through [Underdog Devs](https://www.underdogdevs.org).
I tend to write about whatever strikes me, with a focus on development, technology, automation or issues I run into with these things. This is all typically light on editing with and heavy on spur of the moment thoughts.
[You can also see what I'm doing now](/now), [take a look at the links I've shared recently](/links) or [check out the webrings I'm a member of](/webrings).
{% render "partials/blocks/badge-grid.liquid", badges: badges %}

View file

@ -1,33 +0,0 @@
---
title: Contact
layout: default
permalink: /contact.html
description: How to contact me.
---
<h2>{{ title }}</h2>
<div class="contact-wrapper">
<div class="column description">
<p>Fill out the form to get in touch. Or I've got other options 👇🏻</p>
<ul>
<li>Ping me on <a href="https://social.lol/@cory">Mastodon</a></li>
<li>Message me on Signal or iMessage (if you have my phone number)</li>
<li><a href="mailto:{{ globals.email }}">Email me directly</a> if you have a client set up to use <code>mailto:</code> links</li>
<li>File an issue on the appropriate repo over at <a href="https://github.com/cdransf">GitHub</a></li>
</ul>
</div>
<form data-form="contact" class="column" method="POST" action="https://coryd.dev/api/contact" name="contact">
<label class="hp">
Don't fill this out if you're human: <input type="text" name="hp_name">
</label>
<label>
<span>Name</span>
<input type="text" name="name" placeholder="Name" required />
</label>
<label>
<span>Email</span>
<input type="email" name="email" placeholder="Email" required />
</label>
<textarea name="message" placeholder="Message" required></textarea>
<button type="submit">Send message</button>
</form>
</div>

View file

@ -1,80 +0,0 @@
---
title: Search
description: Search through and find the posts and links on my site.
layout: default
permalink: /search.html
---
<script src="/assets/scripts/components/minisearch.js?v={% appVersion %}"></script>
<script type="module">
(() => {
const miniSearch = new MiniSearch({
fields: ['title', 'text', 'tags']
})
const $form = document.querySelector('.search__form')
const $input = document.querySelector('.search__form--input')
const $fallback = document.querySelector('.search__form--fallback')
const $results = document.querySelector('.search__results')
// remove noscript fallbacks
$form.removeAttribute('action')
$form.removeAttribute('method')
$fallback.remove()
const index = {{ collections.searchIndex | json }}
const resultsById = index.reduce((byId, result) => {
byId[result.id] = result
return byId
}, {})
miniSearch.addAll(index)
$input.addEventListener('input', () => {
const query = $input.value
const results = (query.length > 1) ? getSearchResults(query) : []
if (query.length === 0) {
// Clear the results when input is empty
renderSearchResults([])
} else {
if (query.length > 1) {
try {
umami.trackEvent('Search', { query: query })
} catch (err) {}
}
renderSearchResults(results, query)
}
})
$input.addEventListener('keydown', (event) => {
if (event.key === 'Enter') event.preventDefault()
})
const getSearchResults = (query) => miniSearch.search(query, { prefix: true, fuzzy: 0.2, boost: { title: 2 } }).map(({ id }) => resultsById[id])
const renderSearchResults = (results, query = '') => {
if (results.length > 0) {
$results.innerHTML = results.map(({ title, url }) => {
return `<li class="search__results--result"><a href="${url}">${title}</a></li>`
}).join('\n')
$results.style.display = 'block'
} else {
if (query.trim() !== '') {
$results.innerHTML = `<li class="search__results--no-results">No results found for "${query}"</li>`
} else {
$results.innerHTML = ''
}
$results.style.display = 'block'
}
}
})()
</script>
<h2>Search</h2>
<p>You can find <a href="/posts">posts</a>, <a href="/links">links</a>, <a href="/music/#artists">artists</a>, genres, <a href="/watching#movies">movies</a>, <a href="/watching#tv">shows</a> and <a href="/books">books</a> via the field below (though it only surfaces movies and books I've written something about).</p>
<noscript>
<p><strong class="highlight-text">If you're seeing this it means that you've (quite likely) disabled JavaScript (that's a totally valid choice!).</strong> You can search for anything on my site using the form below, but your query will be routed through <a href="https://duckduckgo.com">DuckDuckGo</a>.</p>
<p><strong class="highlight-text">Type something in and hit enter.</strong></p>
</noscript>
<form class="search__form" action="https://duckduckgo.com" method="get">
<input class="search__form--input" placeholder="Search" type="search" name="q" autocomplete="off" autofocus>
<input class="search__form--fallback" type="hidden" placeholder="Type away..." name="sites" value="coryd.dev">
</form>
<ul class="search__results"></ul>

View file

@ -1,13 +0,0 @@
---
title: Webrings
layout: page
permalink: /webrings.html
description: Webrings are awesome! These are the ones I'm a member of.
---
<h2>{{ title }}</h2>
[Webrings](https://en.wikipedia.org/wiki/Webring) are _awesome_. I'm a member of a few that follow. Check them out!
{% render "webrings/the-claw.liquid", logo: globals.logo_the_claw %}
<hr />
{% render "webrings/css-joy.liquid" %}