diff options
| author | Hizbu Azka <hanifan.azka@gmail.com> | 2026-11-04 14:38:39 +0700 |
|---|---|---|
| committer | Hizbu Azka <hanifan.azka@gmail.com> | 2026-11-04 14:38:39 +0700 |
| commit | 71b798c1d322a275ac42c082a30377e560432a83 (patch) | |
| tree | bc64dd4e4f1ecca1122d78fa91de10f00f3c39c8 /_includes | |
| parent | 67219e145019d70e263e3f6035285a0ed810d2d3 (diff) | |
add breadcrumb
Diffstat (limited to '_includes')
| -rw-r--r-- | _includes/breadcrumbs.html | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/_includes/breadcrumbs.html b/_includes/breadcrumbs.html new file mode 100644 index 0000000..a4f992e --- /dev/null +++ b/_includes/breadcrumbs.html @@ -0,0 +1,23 @@ +<nav aria-label="Breadcrumb" id="breadcrumbs" style="font-size: 0.8em"> + {% assign crumbs = page.url | remove:'/index.html' | split: '/' %} + <a href="/">Home</a> + {% for crumb in crumbs offset: 1 %} {% if forloop.last %} / {{ page.title }} + {% else %} {% assign crumb_limit = forloop.index | plus: 1 %} / + <a + href="{% for crumb in crumbs limit: crumb_limit %}{{ crumb | append: '/' }}{% endfor %}" + > + {{ crumb | replace:'-',' ' | remove:'.html' | capitalize }} + </a> + {% endif %} {% endfor %} +</nav> + +<style> + nav[aria-label="Breadcrumb"] { + display: inline-block; + opacity: 0.5; + transition: opacity 0.1s; + } + nav[aria-label="Breadcrumb"]:hover { + opacity: 1; + } +</style> |