From 9ddd1459d39c8284f60dcbabf636ab178af3bad2 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sun, 13 Aug 2023 18:05:58 -0700 Subject: [PATCH] chore: refactor nav --- src/_includes/icons/coffee.liquid | 2 +- src/_includes/icons/rss.liquid | 3 --- src/_includes/icons/search.liquid | 3 --- src/_includes/icons/tags.liquid | 3 --- src/_includes/icons/webrings.liquid | 3 --- src/_includes/partials/footer.liquid | 4 ++-- src/_includes/partials/header.liquid | 2 +- src/_includes/partials/nav.liquid | 22 ---------------------- src/_includes/partials/nav/link.liquid | 19 +++++++++++++++++++ src/_includes/partials/nav/menu.liquid | 22 ++++++++++++++++++++++ tailwind.css | 10 ++-------- 11 files changed, 47 insertions(+), 46 deletions(-) delete mode 100644 src/_includes/icons/rss.liquid delete mode 100644 src/_includes/icons/search.liquid delete mode 100644 src/_includes/icons/tags.liquid delete mode 100644 src/_includes/icons/webrings.liquid delete mode 100644 src/_includes/partials/nav.liquid create mode 100644 src/_includes/partials/nav/link.liquid create mode 100644 src/_includes/partials/nav/menu.liquid diff --git a/src/_includes/icons/coffee.liquid b/src/_includes/icons/coffee.liquid index 503b6177..56f4ac77 100644 --- a/src/_includes/icons/coffee.liquid +++ b/src/_includes/icons/coffee.liquid @@ -1,5 +1,5 @@ diff --git a/src/_includes/icons/rss.liquid b/src/_includes/icons/rss.liquid deleted file mode 100644 index 330fc7ab..00000000 --- a/src/_includes/icons/rss.liquid +++ /dev/null @@ -1,3 +0,0 @@ - - {% tablericon "rss" "RSS" %} - \ No newline at end of file diff --git a/src/_includes/icons/search.liquid b/src/_includes/icons/search.liquid deleted file mode 100644 index 0b8f6040..00000000 --- a/src/_includes/icons/search.liquid +++ /dev/null @@ -1,3 +0,0 @@ - - {% tablericon "search" "Search posts" %} - \ No newline at end of file diff --git a/src/_includes/icons/tags.liquid b/src/_includes/icons/tags.liquid deleted file mode 100644 index e6bcac54..00000000 --- a/src/_includes/icons/tags.liquid +++ /dev/null @@ -1,3 +0,0 @@ - - {% tablericon "tag" "Post tags" %} - \ No newline at end of file diff --git a/src/_includes/icons/webrings.liquid b/src/_includes/icons/webrings.liquid deleted file mode 100644 index 9ba12be3..00000000 --- a/src/_includes/icons/webrings.liquid +++ /dev/null @@ -1,3 +0,0 @@ - - {% tablericon "heart-handshake" "Webrings" %} - \ No newline at end of file diff --git a/src/_includes/partials/footer.liquid b/src/_includes/partials/footer.liquid index a75c580c..a8531c89 100644 --- a/src/_includes/partials/footer.liquid +++ b/src/_includes/partials/footer.liquid @@ -11,7 +11,7 @@ {% render "icons/coffee.liquid" %}
- Uses • - Referrals + {% render "partials/nav/link.liquid", page: page, link: "Uses" %} • + {% render "partials/nav/link.liquid", page: page, link: "Referrals" %}
diff --git a/src/_includes/partials/header.liquid b/src/_includes/partials/header.liquid index d5a88d7a..1772edb5 100644 --- a/src/_includes/partials/header.liquid +++ b/src/_includes/partials/header.liquid @@ -2,5 +2,5 @@

{{ site.title }}

- {% render "partials/nav.liquid", page: page %} + {% render "partials/nav/menu.liquid", page: page %} \ No newline at end of file diff --git a/src/_includes/partials/nav.liquid b/src/_includes/partials/nav.liquid deleted file mode 100644 index 00c55108..00000000 --- a/src/_includes/partials/nav.liquid +++ /dev/null @@ -1,22 +0,0 @@ - \ No newline at end of file diff --git a/src/_includes/partials/nav/link.liquid b/src/_includes/partials/nav/link.liquid new file mode 100644 index 00000000..c7be742b --- /dev/null +++ b/src/_includes/partials/nav/link.liquid @@ -0,0 +1,19 @@ +{%- capture pageUrl %}/{{ link | downcase }}/{% endcapture -%} +{% if page.url != pageUrl %} + + {% if icon %} + {% tablericon icon link %} + {% else %} + {{ link }} + {% endif %} + +{% endif %} +{% if page.url == pageUrl %} + + {% if icon %} + {% tablericon icon link %} + {% else %} + {{ link }} + {% endif %} + +{% endif %} \ No newline at end of file diff --git a/src/_includes/partials/nav/menu.liquid b/src/_includes/partials/nav/menu.liquid new file mode 100644 index 00000000..9f9a8fef --- /dev/null +++ b/src/_includes/partials/nav/menu.liquid @@ -0,0 +1,22 @@ + \ No newline at end of file diff --git a/tailwind.css b/tailwind.css index 0d9963b2..02516002 100644 --- a/tailwind.css +++ b/tailwind.css @@ -18,13 +18,7 @@ .active, .active svg { - color: theme(colors.purple.600) !important; -} - -.active:hover, -.active:active, -.active:focus { - color: theme(colors.purple.500) !important; + color: theme(colors.pink.500) !important; } .header-anchor { @@ -156,7 +150,7 @@ code[class*=language-], pre[class*=language-] { @media (prefers-color-scheme: dark) { .active, .active svg { - color: theme(colors.purple.400) !important; + color: theme(colors.pink.500) !important; } a,