Skip to content

Commit e95aca9

Browse files
committed
updates
1 parent 714ccdb commit e95aca9

8 files changed

Lines changed: 730 additions & 16 deletions

File tree

_includes/head-custom.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,26 @@
1111
root.style.colorScheme = theme === 'light' ? 'light' : 'dark';
1212
})();
1313
</script>
14-
<link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">
14+
<link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">
15+
{% if page.url %}
16+
<link rel="canonical" href="{{ site.url }}{{ site.baseurl }}{{ page.url | replace: '/index.html', '/' }}">
17+
{% endif %}
18+
{% if page.url contains '/logs/' %}
19+
{% assign logs = site.pages | where_exp:"p","p.url contains '/logs/'" | sort: "url" %}
20+
{% for p in logs %}
21+
{% if p.url == page.url %}
22+
{% assign current_index = forloop.index0 %}
23+
{% assign prev_index = current_index | minus: 1 %}
24+
{% assign next_index = current_index | plus: 1 %}
25+
{% if prev_index >= 0 %}
26+
{% assign prev_log = logs[prev_index] %}
27+
<link rel="prefetch" href="{{ prev_log.url | relative_url }}">
28+
{% endif %}
29+
{% if next_index < logs.size %}
30+
{% assign next_log = logs[next_index] %}
31+
<link rel="prefetch" href="{{ next_log.url | relative_url }}">
32+
{% endif %}
33+
{% break %}
34+
{% endif %}
35+
{% endfor %}
36+
{% endif %}

_layouts/default.html

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
---
44
{% include head-custom.html %}
55

6+
<a href="#main-content" class="skip-link">Skip to main content</a>
67
<div class="gradient-side left"></div>
78
<div class="gradient-side right"></div>
89

@@ -26,24 +27,59 @@
2627
</header>
2728

2829
<div class="main-container">
29-
<main class="custom-main">
30+
<main class="custom-main" id="main-content">
3031
{% if page.url contains '/logs/' %}
31-
<nav class="breadcrumbs">
32-
<a href="{{ '/' | relative_url }}">Home</a> /
33-
<a href="{{ '/archive/' | relative_url }}">Archive</a> /
34-
<span aria-current="page">{{ page.title }}</span>
32+
<nav class="breadcrumbs" aria-label="Breadcrumb">
33+
<ol itemscope itemtype="https://schema.org/BreadcrumbList">
34+
<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
35+
<a itemprop="item" href="{{ '/' | relative_url }}"><span itemprop="name">Home</span></a>
36+
<meta itemprop="position" content="1" />
37+
</li>
38+
<li aria-hidden="true"> / </li>
39+
<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
40+
<a itemprop="item" href="{{ '/archive/' | relative_url }}"><span itemprop="name">Archive</span></a>
41+
<meta itemprop="position" content="2" />
42+
</li>
43+
<li aria-hidden="true"> / </li>
44+
<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
45+
<span itemprop="name" aria-current="page">{{ page.title }}</span>
46+
<meta itemprop="position" content="3" />
47+
</li>
48+
</ol>
3549
</nav>
3650
{% endif %}
3751
{{ content }}
3852
{% if page.url contains '/logs/' %}
3953
<div class="log-backlinks">
40-
<a href="{{ '/' | relative_url }}">← Back to Home</a> |
41-
<a href="{{ '/archive/' | relative_url }}">Back to Archive</a>
54+
{% assign logs = site.pages | where_exp:"p","p.url contains '/logs/'" | sort: "url" %}
55+
{% for p in logs %}
56+
{% if p.url == page.url %}
57+
{% assign current_index = forloop.index0 %}
58+
{% assign prev_index = current_index | minus: 1 %}
59+
{% assign next_index = current_index | plus: 1 %}
60+
{% if prev_index >= 0 %}
61+
{% assign prev_log = logs[prev_index] %}
62+
<a href="{{ prev_log.url | relative_url }}" rel="prev">← Previous</a>
63+
{% endif %}
64+
{% if prev_index >= 0 and next_index < logs.size %} | {% endif %}
65+
{% if next_index < logs.size %}
66+
{% assign next_log = logs[next_index] %}
67+
<a href="{{ next_log.url | relative_url }}" rel="next">Next →</a>
68+
{% endif %}
69+
{% break %}
70+
{% endif %}
71+
{% endfor %}
4272
</div>
4373
{% endif %}
4474
</main>
4575
</div>
4676

77+
<button id="back-to-top" class="back-to-top" aria-label="Back to top" title="Back to top">
78+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
79+
<path d="M18 15l-6-6-6 6"/>
80+
</svg>
81+
</button>
82+
4783
<footer class="custom-footer">
4884
<div class="footer-title">Connect With Me</div>
4985
<ul class="footer-links">
@@ -57,6 +93,7 @@
5793
</footer>
5894

5995
<script src="{{ '/assets/js/theme-toggle.js' | relative_url }}"></script>
96+
<script src="{{ '/assets/js/navigation.js' | relative_url }}"></script>
6097
{% if page.url == '/' or page.url == '/index.html' %}
6198
<script src="{{ '/assets/js/typed-home.js' | relative_url }}"></script>
6299
{% endif %}

archive.md

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,36 @@ permalink: /archive/
66

77
# 📚 Devlog Archive
88

9-
All my devlog entries, organized by month.
9+
All my devlog entries, organized by year and month.
10+
11+
<div class="archive-controls">
12+
<button id="expand-all" class="archive-btn" aria-label="Expand all years">Expand All</button>
13+
<button id="collapse-all" class="archive-btn" aria-label="Collapse all years">Collapse All</button>
14+
<input type="text" id="archive-search" class="archive-search" placeholder="Search entries..." aria-label="Search archive entries">
15+
</div>
1016

1117
---
1218

1319
{% assign logs = site.pages | where_exp:"p","p.url contains '/logs/'" | sort: "url" | reverse %}
20+
21+
{% comment %} First pass: count entries per year and month {% endcomment %}
22+
{% assign year_counts = "" | split: "," %}
23+
{% assign month_counts = "" | split: "," %}
24+
{% for p in logs %}
25+
{% assign parts = p.url | split:'/' %}
26+
{% assign date_str = parts[2] %}
27+
{% assign year = date_str | slice:0,4 %}
28+
{% assign month = date_str | slice:0,7 %}
29+
{% assign year_counts = year_counts | push: year %}
30+
{% assign month_counts = month_counts | push: month %}
31+
{% endfor %}
32+
1433
{% assign current_year = "" %}
1534
{% assign current_month = "" %}
35+
{% assign year_count = 0 %}
36+
{% assign month_count = 0 %}
1637

38+
<div id="archive-container">
1739
{% for p in logs %}
1840
{% assign parts = p.url | split:'/' %}
1941
{% assign date_str = parts[2] %}
@@ -25,22 +47,53 @@ All my devlog entries, organized by month.
2547
{%- if current_month != "" -%}</ul></div>{%- endif -%}
2648
</details>
2749
{%- endif -%}
28-
<details class="archive-year">
29-
<summary>{{ year }}</summary>
50+
51+
{% comment %} Count entries for this year {% endcomment %}
52+
{% assign year_count = 0 %}
53+
{% for y in year_counts %}
54+
{% if y == year %}
55+
{% assign year_count = year_count | plus: 1 %}
56+
{% endif %}
57+
{% endfor %}
58+
59+
<details class="archive-year" data-year="{{ year }}">
60+
<summary aria-expanded="false">
61+
<span class="year-label">{{ year }}</span>
62+
<span class="year-count">({{ year_count }})</span>
63+
</summary>
3064
{%- assign current_year = year -%}
3165
{%- assign current_month = "" -%}
66+
{%- assign month_count = 0 -%}
3267
{%- endif -%}
3368

3469
{%- if month != current_month -%}
3570
{%- if current_month != "" -%}</ul></div>{%- endif -%}
36-
<div class="archive-month">
37-
<h3>{{ month }}</h3>
71+
72+
{% comment %} Count entries for this month {% endcomment %}
73+
{% assign month_count = 0 %}
74+
{% for m in month_counts %}
75+
{% if m == month %}
76+
{% assign month_count = month_count | plus: 1 %}
77+
{% endif %}
78+
{% endfor %}
79+
80+
<div class="archive-month" data-month="{{ month }}">
81+
<h2 class="archive-month-heading">{{ month }} <span class="month-count">({{ month_count }})</span></h2>
3882
<ul>
3983
{%- assign current_month = month -%}
4084
{%- endif -%}
4185

42-
<li><a href="{{ p.url | relative_url }}">{{ date_str }} — {{ p.title | default: "Devlog" }}</a></li>
86+
{% assign excerpt = p.content | strip_html | strip_newlines | truncatewords: 15 %}
87+
<li class="archive-entry" data-date="{{ date_str }}" data-title="{{ p.title | default: 'Devlog' | downcase }}">
88+
<a href="{{ p.url | relative_url }}" class="archive-link" data-excerpt="{{ excerpt | escape }}">
89+
<span class="archive-date">{{ date_str }}</span>
90+
<span class="archive-title"> — {{ p.title | default: "Devlog" }}</span>
91+
</a>
92+
</li>
4393
{% endfor %}
4494

4595
{% if current_month != "" %}</ul></div>{% endif %}
46-
{% if current_year != "" %}</details>{% endif %}
96+
{% if current_year != "" %}</details>{% endif %}
97+
</div>
98+
99+
<script src="{{ '/assets/js/archive.js' | relative_url }}"></script>

0 commit comments

Comments
 (0)