feat: reorganize templates + layouts

This commit is contained in:
Cory Dransfeldt 2024-10-26 13:28:21 -07:00
parent c5793b9ad4
commit 3c80eb4b5f
No known key found for this signature in database
61 changed files with 81 additions and 80 deletions

View file

@ -105,6 +105,7 @@ export default async function (eleventyConfig) {
dir: {
input: "src",
includes: "includes",
layouts: "layouts",
data: "data",
output: "_site",
},

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "coryd.dev",
"version": "1.9.0",
"version": "2.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coryd.dev",
"version": "1.9.0",
"version": "2.0.0",
"license": "MIT",
"dependencies": {
"@cdransf/api-text": "^1.6.0",

View file

@ -1,6 +1,6 @@
{
"name": "coryd.dev",
"version": "1.9.0",
"version": "2.0.0",
"description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module",
"engines": {

View file

@ -3,7 +3,7 @@ layout: null
eleventyExcludeFromCollections: true
permalink: "/feeds/all.json"
---
{% render "partials/feeds/json.liquid"
{% render "feeds/json.liquid"
permalink:"/feeds/all.json"
title:"All activity / Cory Dransfeldt"
globals:globals

View file

@ -3,7 +3,7 @@ layout: null
eleventyExcludeFromCollections: true
permalink: "/feeds/books.json"
---
{% render "partials/feeds/json.liquid"
{% render "feeds/json.liquid"
permalink:"/feeds/books.json"
title:"Books / Cory Dransfeldt"
globals:globals

View file

@ -3,7 +3,7 @@ layout: null
eleventyExcludeFromCollections: true
permalink: "/feeds/links.json"
---
{% render "partials/feeds/json.liquid"
{% render "feeds/json.liquid"
permalink:"/feeds/links.json"
title:"Links / Cory Dransfeldt"
globals:globals

View file

@ -3,7 +3,7 @@ layout: null
eleventyExcludeFromCollections: true
permalink: "/feeds/movies.json"
---
{% render "partials/feeds/json.liquid"
{% render "feeds/json.liquid"
permalink:"/feeds/movies.json"
title:"Movies / Cory Dransfeldt"
globals:globals

View file

@ -3,7 +3,7 @@ layout: null
eleventyExcludeFromCollections: true
permalink: "/feeds/posts.json"
---
{% render "partials/feeds/json.liquid"
{% render "feeds/json.liquid"
permalink:"/feeds/posts.json"
title:"Posts / Cory Dransfeldt"
globals:globals

View file

@ -3,7 +3,7 @@ layout: null
eleventyExcludeFromCollections: true
permalink: "/feeds/all"
---
{% render "partials/feeds/rss.liquid"
{% render "feeds/rss.liquid"
permalink:"/feeds/all"
title:"All activity / Cory Dransfeldt"
globals:globals

View file

@ -3,7 +3,7 @@ layout: null
eleventyExcludeFromCollections: true
permalink: "/feeds/books"
---
{% render "partials/feeds/rss.liquid"
{% render "feeds/rss.liquid"
permalink:"/feeds/books"
title:"Books / Cory Dransfeldt"
globals:globals

View file

@ -3,7 +3,7 @@ layout: null
eleventyExcludeFromCollections: true
permalink: "/feeds/links"
---
{% render "partials/feeds/rss.liquid"
{% render "feeds/rss.liquid"
permalink:"/feeds/links"
title:"Links / Cory Dransfeldt"
globals:globals

View file

@ -3,7 +3,7 @@ layout: null
eleventyExcludeFromCollections: true
permalink: "/feeds/movies"
---
{% render "partials/feeds/rss.liquid"
{% render "feeds/rss.liquid"
permalink:"/feeds/movies"
title:"Movies / Cory Dransfeldt"
globals:globals

View file

@ -3,7 +3,7 @@ layout: null
eleventyExcludeFromCollections: true
permalink: "/feeds/posts"
---
{% render "partials/feeds/rss.liquid"
{% render "feeds/rss.liquid"
permalink:"/feeds/posts"
title:"Posts / Cory Dransfeldt"
globals:globals

View file

@ -3,7 +3,7 @@ layout: null
eleventyExcludeFromCollections: true
permalink: "/feeds/syndication"
---
{% render "partials/feeds/syndication.rss.liquid"
{% render "feeds/syndication.rss.liquid"
permalink:"/feeds/syndication"
title:"Syndicated content / Cory Dransfeldt"
globals:globals

View file

@ -0,0 +1,18 @@
{%- for block in blocks -%}
{%- case block.type -%}
{%- when 'youtube_player' -%}
{% render "blocks/youtube-player.liquid", url: block.url %}
{%- when 'github_banner' -%}
{% render "blocks/banners/github.liquid", url: block.url %}
{%- when 'npm_banner' -%}
{% render "blocks/banners/npm.liquid", url: block.url, command: block.command %}
{%- when 'rss_banner' -%}
{% render "blocks/banners/rss.liquid", url: block.url, text: block.text %}
{%- when 'hero' -%}
{% render "blocks/hero.liquid", globals: globals, image: block.image, alt: block.alt %}
{%- when 'markdown' -%}
{{ block.text | markdown }}
{%- when 'divider' -%}
{{ block.markup | markdown }}
{%- endcase -%}
{%- endfor -%}

View file

@ -4,12 +4,12 @@
{%- endif -%}
<nav aria-label="Social icons" class="social">
{%- for link in nav.footer_icons -%}
{% render "partials/nav/link.liquid", page:page, link:link %}
{% render "nav/link.liquid", page:page, link:link %}
{%- endfor -%}
</nav>
<nav aria-label="Secondary site navigation" class="sub-pages">
{%- for link in nav.footer_text -%}
{% render "partials/nav/link.liquid", page:page, link:link %}
{% render "nav/link.liquid", page:page, link:link %}
{% unless forloop.last %}<span>/</span>{% endunless %}
{%- endfor -%}
</nav>

View file

@ -6,5 +6,5 @@
<a href="/" tabindex="0">{{ globals.site_name }}</a>
{%- endif -%}
</h1>
{% render "partials/nav/menu.liquid", page:page, nav:nav %}
{% render "nav/menu.liquid", page:page, nav:nav %}
</section>

View file

@ -10,12 +10,12 @@
Recent activity
</h2>
<ul>
<li><span class="music">Last track listened to:</span> {% render "partials/blocks/now-playing.liquid", nowPlaying:nowPlaying %}</li>
<li><span class="music">Last track listened to:</span> {% render "blocks/now-playing.liquid", nowPlaying:nowPlaying %}</li>
<li><span class="music">Top track this week:</span> {{ track.track_name }} by <a href="{{ track.artist_url }}">{{ track.artist_name }}</a></li>
<li><span class="tv">Last episode watched:</span> <strong class="highlight-text">{{ show.formatted_episode }}</strong> of <a href="{{ show.url }}">{{ show.title }}</a></li>
<li><span class="movies">Last movie watched:</span> <a href="{{ movie.url }}">{{ movie.title }}</a>{%- if movie.rating %} ({{ movie.rating }}){%- endif -%}</li>
<li><span class="books">Last book finished:</span> <a href="{{ book.url }}">{{ book.title }}</a> by {{ book.author }}{%- if book.rating %} ({{ book.rating }}){%- endif -%}</li>
<li><span class="link">Last link shared:</span> <a href="{{ link.link }}">{{ link.title }}</a>{% if link.author %} via <a href="{{ link.author.url }}">{{ link.author.name }}</a>{% endif %}</li>
</ul>
{% render "partials/blocks/banners/rss.liquid", url: "/feeds", text: "Subscribe to my movies, books, links or activity feed(s)" %}
{% render "blocks/banners/rss.liquid", url: "/feeds", text: "Subscribe to my movies, books, links or activity feed(s)" %}
</article>

View file

@ -46,5 +46,5 @@
{%- endfor -%}
</div>
{%- unless hidePagination -%}
{% render "partials/nav/paginator.liquid", pagination: pagination %}
{% render "nav/paginator.liquid", pagination: pagination %}
{%- endunless -%}

View file

@ -10,12 +10,12 @@
<span class="subtext">{{ item.chart.artist }}</span>
<span class="subtext">{{ item.chart.plays }} {{ playsLabel }}</span>
</div>
{% render "partials/media/progress-bar.liquid", percentage:percentage %}
{% render "media/progress-bar.liquid", percentage:percentage %}
</div>
</li>
{%- endfor -%}
</ol>
</div>
{%- unless count -%}
{% render "partials/nav/paginator.liquid", pagination:pagination %}
{% render "nav/paginator.liquid", pagination:pagination %}
{%- endunless -%}

View file

@ -9,6 +9,6 @@
({{ movie.year }})
</div>
</div>
{% render "partials/blocks/hero.liquid", globals:globals, image:movie.backdrop, alt:movie.title %}
{% render "blocks/hero.liquid", globals:globals, image:movie.backdrop, alt:movie.title %}
</div>
</a>

View file

@ -6,8 +6,8 @@
</label>
<ul class="menu-primary" aria-label="Primary site navigation" id="primary-navigation">
{%- for link in nav.primary -%}
<li>{% render "partials/nav/link.liquid", page:page, link:link %}</li>
<li>{% render "nav/link.liquid", page:page, link:link %}</li>
{%- endfor -%}
</ul>
{% render "partials/nav/theme-toggle.liquid" %}
{% render "nav/theme-toggle.liquid" %}
</menu>

View file

@ -1,18 +0,0 @@
{%- for block in blocks -%}
{%- case block.type -%}
{%- when 'youtube_player' -%}
{% render "partials/blocks/youtube-player.liquid", url: block.url %}
{%- when 'github_banner' -%}
{% render "partials/blocks/banners/github.liquid", url: block.url %}
{%- when 'npm_banner' -%}
{% render "partials/blocks/banners/npm.liquid", url: block.url, command: block.command %}
{%- when 'rss_banner' -%}
{% render "partials/blocks/banners/rss.liquid", url: block.url, text: block.text %}
{%- when 'hero' -%}
{% render "partials/blocks/hero.liquid", globals: globals, image: block.image, alt: block.alt %}
{%- when 'markdown' -%}
{{ block.text | markdown }}
{%- when 'divider' -%}
{{ block.markup | markdown }}
{%- endcase -%}
{%- endfor -%}

View file

@ -13,7 +13,7 @@
<link rel="preload" href="/assets/fonts/ml.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="/assets/fonts/mlb.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="stylesheet" href="/assets/styles/index.css?v={% appVersion %}" type="text/css" />
{% render "partials/metadata.liquid",
{% render "metadata.liquid",
globals:globals,
schema:schema,
title:title,
@ -59,12 +59,12 @@
</script>
<div class="main-wrapper">
<main>
{% render "partials/header.liquid", globals:globals, page:page, nav:nav %}
{% render "header.liquid", globals:globals, page:page, nav:nav %}
<div class="default-wrapper" data-dynamic="page">
{{ content }}
</div>
</main>
{% render "partials/footer.liquid", page:page, nav:nav, updated:updateTime %}
{% render "footer.liquid", page:page, nav:nav, updated:updateTime %}
</div>
</body>
</html>

View file

@ -11,7 +11,7 @@ schema: books
<h2>Currently reading</h2>
<p>Here's what I'm reading at the moment. I've finished <strong class="highlight-text">{{ currentBookCount }} books</strong> this year.</p>
<p>{{ books.years | bookYearLinks }}</p>
{% render "partials/blocks/banners/rss.liquid", url: "/feeds/books", text: "Subscribe to my books feed or follow along on this page" %}
{% render "blocks/banners/rss.liquid", url: "/feeds/books", text: "Subscribe to my books feed or follow along on this page" %}
<hr />
{% for book in bookData %}
{% capture alt %}{{ book.title }} by {{ book.authors }}{% endcapture %}
@ -41,7 +41,7 @@ schema: books
{% endif %}
{% if book.progress %}
{%- assign percentage = book.progress | append: '%' -%}
{% render "partials/media/progress-bar.liquid", percentage:percentage %}
{% render "media/progress-bar.liquid", percentage:percentage %}
{% endif %}
{% if book.description %}<div class="description">{{ book.description | normalize_whitespace | markdown | htmlTruncate }}</div>{% endif %}
</div>

View file

@ -20,4 +20,4 @@ schema: books-year
<p>I finished <strong class="highlight-text">{{ bookData.size }} books</strong> in <strong class="highlight-text">{{ year.value }}</strong>.{%- if favoriteBooks %} Among my favorites were {{ favoriteBooks }}.{%- endif -%}</p>
{% endif %}
<hr />
{% render "partials/media/grid.liquid", globals:globals, data:bookData, shape:"vertical", count: 200, loading: "eager" %}
{% render "media/grid.liquid", globals:globals, data:bookData, shape:"vertical", count: 200, loading: "eager" %}

View file

@ -1,6 +1,6 @@
---
permalink: /
---
{% render "partials/home/intro.liquid" intro:globals.intro %}
{% render "partials/home/recent-activity.liquid" music:music, nowPlaying:nowPlaying.content, books:books.currentYear, tv:tv, movies:movies, links:links %}
{% render "partials/home/recent-posts.liquid" posts:posts %}
{% render "home/intro.liquid" intro:globals.intro %}
{% render "home/recent-activity.liquid" music:music, nowPlaying:nowPlaying.content, books:books.currentYear, tv:tv, movies:movies, links:links %}
{% render "home/recent-posts.liquid" posts:posts %}

View file

@ -9,7 +9,7 @@ permalink: "/links/{% if pagination.pageNumber > 0 %}{{ pagination.pageNumber }}
{% if pagination.pageNumber == 0 %}
<h2>Links</h2>
<p>These are links I've liked or otherwise found interesting. They're all added manually, after having been read and, I suppose, properly considered.</p>
{% render "partials/blocks/banners/rss.liquid", url: "/feeds/links", text: "Subscribe to my links feed or follow along on this page" %}
{% render "blocks/banners/rss.liquid", url: "/feeds/links", text: "Subscribe to my links feed or follow along on this page" %}
<hr />
{% endif %}
<div class="link-grid">
@ -22,4 +22,4 @@ permalink: "/links/{% if pagination.pageNumber > 0 %}{{ pagination.pageNumber }}
</div>
{% endfor %}
</div>
{% render "partials/nav/paginator.liquid", pagination:pagination %}
{% render "nav/paginator.liquid", pagination:pagination %}

View file

@ -34,9 +34,9 @@ permalink: "/music/concerts/{% if pagination.pageNumber > 0 %}{{ pagination.page
{% if venue %} at {{ venue }}{% endif %}
{%- if concert.notes -%}
{% assign notes = concert.notes | prepend: "### Notes\n" | markdown %}
{% render "partials/blocks/modal.liquid", icon:"info-circle", content:notes, id:concert.id %}
{% render "blocks/modal.liquid", icon:"info-circle", content:notes, id:concert.id %}
{%- endif -%}
</li>
{%- endfor -%}
</ul>
{% render "partials/nav/paginator.liquid", pagination:pagination %}
{% render "nav/paginator.liquid", pagination:pagination %}

View file

@ -8,18 +8,18 @@ schema: music-index
<h2>{{ title }}</h2>
<p>I've listened to <strong class="highlight-text">{{ music.week.artists.size }} artists</strong>, <strong class="highlight-text">{{ music.week.albums.size }} albums</strong> and <strong class="highlight-text">{{ music.week.totalTracks }} tracks</strong> this week. Most of that has been {{ music.week.genres | mediaLinks: "genre", 5 }}.</p>
<p><strong class="highlight-text">Take a look at what I've listened to</strong> <a href="/music/this-month">this month</a> or <a href="/music/concerts">check out the concerts I've been to.</a></p>
{% render "partials/blocks/now-playing.liquid", music:music %}
{% render "blocks/now-playing.liquid", music:music %}
<hr />
<h3 id="artists">
{% tablericon "microphone-2" %}
Artists
</h3>
{% render "partials/media/grid.liquid", globals:globals, data:music.week.artists, shape:"square", count: 8, loading: "eager" %}
{% render "media/grid.liquid", globals:globals, data:music.week.artists, shape:"square", count: 8, loading: "eager" %}
<h3 id="albums">
{% tablericon "vinyl" %}
Albums
</h3>
{% render "partials/media/grid.liquid", globals:globals, data:music.week.albums, shape:"square", count: 8 %}
{% render "media/grid.liquid", globals:globals, data:music.week.albums, shape:"square", count: 8 %}
<h3 id="tracks">
{% tablericon "playlist" %}
Tracks
@ -30,10 +30,10 @@ schema: music-index
<label for="tracks-recent" class="button" data-toggle="tracks-recent">Recent</label>
<label for="tracks-chart" class="button" data-toggle="tracks-chart">This week</label>
<div class="tracks-recent">
{% render "partials/media/music/recent", globals:globals, data:music.recent %}
{% render "media/music/recent", globals:globals, data:music.recent %}
</div>
<div class="tracks-chart">
{% render "partials/media/music/chart.liquid", data:music.week.tracks, count: 10 %}
{% render "media/music/chart.liquid", data:music.week.tracks, count: 10 %}
</div>
</div>
{% if albumReleases.size > 0 %}
@ -41,5 +41,5 @@ schema: music-index
{% tablericon "calendar-time" %}
Anticipated albums
</h3>
{% render "partials/media/grid.liquid", globals:globals, data:albumReleases.upcoming, shape:"square", count: 8 %}
{% render "media/grid.liquid", globals:globals, data:albumReleases.upcoming, shape:"square", count: 8 %}
{% endif %}

View file

@ -14,14 +14,14 @@ schema: music-period
{% tablericon "microphone-2" %}
Artists
</h3>
{% render "partials/media/grid.liquid", globals:globals, data:music.month.artists, shape:"square", count: 8, loading: "eager" %}
{% render "media/grid.liquid", globals:globals, data:music.month.artists, shape:"square", count: 8, loading: "eager" %}
<h3 id="albums">
{% tablericon "vinyl" %}
Albums
</h3>
{% render "partials/media/grid.liquid", globals:globals, data:music.month.albums, shape:"square", count: 8 %}
{% render "media/grid.liquid", globals:globals, data:music.month.albums, shape:"square", count: 8 %}
<h3 id="tracks">
{% tablericon "playlist" %}
Tracks
</h3>
{% render "partials/media/music/chart.liquid", data:music.month.tracks, count: 10 %}
{% render "media/music/chart.liquid", data:music.month.tracks, count: 10 %}

View file

@ -9,4 +9,4 @@ image: "{{ page.open_graph_image | prepend: globals.cdn_url | default: globals.a
updated: "{{ page.updated | default: null }}"
schema: page
---
{% render "partials/blocks/index.liquid", blocks:page.blocks, globals:globals %}
{% render "blocks/index.liquid", blocks:page.blocks, globals:globals %}

View file

@ -19,4 +19,4 @@ permalink: "/posts/{% if pagination.pageNumber > 0 %}{{ pagination.pageNumber }}
<p>{{ post.description | markdown }}</p>
</article>
{% endfor %}
{% render "partials/nav/paginator.liquid", pagination:pagination %}
{% render "nav/paginator.liquid", pagination:pagination %}

View file

@ -17,7 +17,7 @@ schema: blog
{{ post.title }}
</h3>
<div>
{% render "partials/blocks/banners/old-post.liquid", isOldPost:post.old_post %}
{% render "blocks/banners/old-post.liquid", isOldPost:post.old_post %}
{%- if post.image -%}
<img
srcset="
@ -40,9 +40,9 @@ schema: blog
/>
{%- endif -%}
{{ post.content | markdown }}
{% render "partials/blocks/index.liquid", blocks:post.blocks %}
{% render "partials/blocks/mastodon-post.liquid", post:post.mastodon_url %}
{% render "partials/blocks/associated-media.liquid",
{% render "blocks/index.liquid", blocks:post.blocks %}
{% render "blocks/mastodon-post.liquid", post:post.mastodon_url %}
{% render "blocks/associated-media.liquid",
artists: post.artists,
books: post.books,
genres: post.genres,
@ -50,6 +50,6 @@ schema: blog
posts: post.posts,
shows: post.shows
%}
{% render "partials/blocks/banners/coffee.liquid" %}
{% render "blocks/banners/coffee.liquid" %}
</div>
</article>

View file

@ -13,4 +13,4 @@ schema: favorite-movies
<p>These are my favorite movies. There are many like them, but these are mine.</p>
<hr />
{% endif %}
{% render "partials/media/grid.liquid", globals:globals, data:pagination.items, pagination:pagination, shape:"poster" %}
{% render "media/grid.liquid", globals:globals, data:pagination.items, pagination:pagination, shape:"poster" %}

View file

@ -13,4 +13,4 @@ schema: favorite-shows
<p>These are my favorite shows. There are many like them, but these are mine.</p>
<hr />
{% endif %}
{% render "partials/media/grid.liquid", globals:globals, data:pagination.items, pagination:pagination, shape:"poster" %}
{% render "media/grid.liquid", globals:globals, data:pagination.items, pagination:pagination, shape:"poster" %}

View file

@ -7,20 +7,20 @@ schema: watching
---
{%- assign featuredMovie = movies.recentlyWatched | shuffleArray | first -%}
<h2 class="watching">{{ title }}</h2>
{% render "partials/media/watching/hero.liquid", globals:globals, movie:featuredMovie %}
{% render "media/watching/hero.liquid", globals:globals, movie:featuredMovie %}
<p>Here's all of the TV and movies I've been watching presented in what is (hopefully) an organized fashion.</p>
{% render "partials/blocks/banners/rss.liquid", url: "/feeds/movies", text: "Subscribe to my movies feed or follow along on this page" %}
{% render "blocks/banners/rss.liquid", url: "/feeds/movies", text: "Subscribe to my movies feed or follow along on this page" %}
<hr />
<h3 id="movies">
{% tablericon "movie" %}
Recent movies
</h3>
{% render "partials/media/grid.liquid", globals:globals, data:movies.recentlyWatched, shape:"vertical", count: 6 %}
{% render "media/grid.liquid", globals:globals, data:movies.recentlyWatched, shape:"vertical", count: 6 %}
<h3 id="tv">
{% tablericon "device-tv-old" %}
Recent shows
</h3>
{% render "partials/media/grid.liquid", globals:globals, data:tv.recentlyWatched, shape:"vertical", count: 6 %}
{% render "media/grid.liquid", globals:globals, data:tv.recentlyWatched, shape:"vertical", count: 6 %}
<h3 id="favorite-movies">
<a class="icon-link" href="/watching/favorite-movies">
{% tablericon "star" %}
@ -28,7 +28,7 @@ schema: watching
</a>
</h3>
{% assign favoriteMovies = movies.favorites | shuffleArray %}
{% render "partials/media/grid.liquid", globals:globals, data:favoriteMovies, shape:"vertical", count: 6 %}
{% render "media/grid.liquid", globals:globals, data:favoriteMovies, shape:"vertical", count: 6 %}
<h3 id="favorite-shows">
<a class="icon-link" href="/watching/favorite-shows">
{% tablericon "star" %}
@ -36,4 +36,4 @@ schema: watching
</a>
</h3>
{% assign favoriteShows = tv.favorites | shuffleArray %}
{% render "partials/media/grid.liquid", globals:globals, data:favoriteShows, shape:"vertical", count: 6 %}
{% render "media/grid.liquid", globals:globals, data:favoriteShows, shape:"vertical", count: 6 %}