feat: design + perf + tags etc.

This commit is contained in:
Cory Dransfeldt 2024-03-01 14:00:31 -08:00
parent 93f3506f83
commit 6c63611198
No known key found for this signature in database
44 changed files with 279 additions and 299 deletions

View file

@ -12,15 +12,8 @@ image: /assets/img/404.jpg
{% image './src/assets/img/404.jpg', title, 'image__banner', 'eager' %}
<div class="text--centered">
<h2 class="page__header">{{ title }}</h2>
<h3>What kind of idiots do you have working here?</h3>
<div class="flex justify-center">
<a href="/" class="pill--button">
{% tablericon "receipt-2" "Receipt" %} Skip out on the room service bill
</a>
</div>
What kind of idiots do you have working here? <a href="/">Hurry up and skip out on the room service bill!</a>
</div>
<hr class="large__spacing" />
{% render "partials/popular-posts.liquid", posts: collections.posts, analytics: analytics %}
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {

View file

@ -7,10 +7,5 @@ image: /assets/img/ogi/contact.jpg
<div class="text--centered">
<h2>{{ title }}</h2>
<h3>I'll be in touch soon!</h3>
<a href="/" class="pill--button">
{% tablericon "home-2" "Home" %} Head home
</a>
</div>
<hr class="large__spacing" />
{% render "partials/popular-posts.liquid", posts: collections.posts, analytics: analytics %}
I'll be in touch soon! <a href="/">Head home</a>
</div>

View file

@ -34,6 +34,8 @@ description: 'How to contact me.'
<input type="email" name="email" placeholder="Email" required />
</label>
<textarea name="message" placeholder="Message" required></textarea>
<button class="pill--button" type="submit">Send message</button>
<div class="flex--centered justify--centered">
<button type="submit">Send message</button>
</div>
</form>
</div>

View file

@ -19,4 +19,5 @@ image: /assets/img/ogi/search.jpg
<input type="hidden" placeholder="Search" name="sites" value="coryd.dev">
</form>
</pagefind-search>
{% render "partials/popular-posts.liquid", posts: collections.posts, analytics: analytics %}
{% render "partials/tags.liquid", tags:collections.tagsSortedByCount %}
{% render "partials/popular-posts.liquid", posts:collections.posts, analytics:analytics %}

View file

@ -6,6 +6,8 @@ image: /assets/img/ogi/stats.jpg
---
<p>My first post was published on <strong class="highlight-text">{{ collections.postStats.firstPostDate | dateToReadableDate }}</strong> and my most recent one was published on <strong class="highlight-text">{{ collections.postStats.lastPostDate | dateToReadableDate }}</strong>. I've published <strong class="highlight-text">{{ collections.postStats.postCount }} posts</strong> containing <strong class="highlight-text">{{ collections.postStats.totalWordCount }} words</strong> and <strong class="highlight-text">{{ collections.postStats.totalCodeBlockCount }} code samples</strong>.</p>
<p>Posts have, on average, <strong class="highlight-text">{{ collections.postStats.avgWordCount | round }} words</strong> and a gap of <strong class="highlight-text">{{ collections.postStats.avgDays | round }} days</strong> between them.</p>
<p><strong>Top tags</strong></p>
{% render "partials/tags.liquid", tags:collections.tagsSortedByCount %}
<p><strong>Popular posts</strong></p>
<ol class="link__list">
{% assign posts = collections.posts | getPopularPosts: analytics %}

View file

@ -8,19 +8,17 @@ permalink: /tags/{{ tag }}/
image: /assets/img/ogi/tags.jpg
eleventyComputed:
title: '{{ tag }}'
templateEngineOverride: liquid,md
---
{% assign posts = collections[tag] | reverse %}
{% for post in posts %}
<article class="h-entry">
<a class="no-underline" href="{{ post.url }}">
<h2 class="flex--centered">{{ post.data.title }}</h2>
</a>
<time class="dt-published" datetime="{{ post.date }}">
{{ post.date | date: "%m.%Y" }}
</time>
{%- if post.data.post_excerpt %}
<p class="p-summary">{{ post.data.post_excerpt | markdown }}</p>
{% endif -%}
<a class="no-underline" href="{{ post.url }}">
<h2 class="flex--centered">{{ post.data.title }}</h2>
</a>
<p class="p-summary">{{ post.data.post_excerpt | markdown }}</p>
<p><a class="no-underline" href="{{ post.url }}">Read more →</a></p>
</article>
{% endfor %}
{% endfor %}

View file

@ -1,16 +0,0 @@
---
title: Tags
description: "Filter and find posts on my site by tag."
layout: default
permalink: /tags.html
image: /assets/img/ogi/tags.jpg
---
{% for tag in collections.tagList %}
<span>
<a href="/tags/{{ tag }}" class="no-underline">
<button class="pill--button">
{{ tag }}
</button>
</a>
</span>
{% endfor %}