Skip to content

Commit

Permalink
fix: Correct broken links throughout the site.
Browse files Browse the repository at this point in the history
This fix _should_ correct broken links throughout the site when deployed
into production by making sure they're properly prefixed based on the
`base_url`.

Signed-off-by: Andrew Lilley Brinker <[email protected]>
  • Loading branch information
alilleybrinker authored and vcfxb committed Jul 1, 2024
1 parent 9aa945c commit 69ed869
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion site/templates/macros/breadcrumbs.tera.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{% macro breadcrumbs(current) %}

{% set root = config.base_url | replace(from="https://mitre.github.io/", to="") %}

<div class="text-sm text-zinc-500 px-14 dark:text-zinc-400 border-t border-zinc-100 dark:border-zinc-800 rounded-md p-2 mx-[-0.5rem]">
<a class="font-normal no-underline hover:underline" href="/">Home</a>
<a class="font-normal no-underline hover:underline" href="{{ root }}/">Home</a>

{% for ancestor in current.ancestors %}
{% if loop.first %}
Expand Down
6 changes: 4 additions & 2 deletions site/templates/partials/footer.tera.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

{% set root = config.base_url | replace(from="https://mitre.github.io/", to="") %}

<div class="max-w-6xl mx-auto mt-32">
<div class="pb-16">
<div class="flex gap-8 dark:text-zinc-400">
<div class="basis-1/4 text-lg">
<a class="hover:text-green-600 font-semibold" href="/">Hipcheck <span class="leading-none font-extrabold text-green-600 text-2xl"></span></a>
<a class="hover:text-green-600 font-semibold" href="{{ root }}/">Hipcheck <span class="leading-none font-extrabold text-green-600 text-2xl"></span></a>
<p class="text-sm text-zinc-500 mt-3 leading-6">Automated supply chain risk assessment for software packages.</p>
</div>
{% for list in config.extra.footer %}
Expand All @@ -14,7 +16,7 @@
{% if item.title %}
<span class="font-semibold mb-4 mt-8 block">{{ item.name }}</span>
{% else %}
<a class="block mb-2 hover:text-blue-500" href="{{ item.url }}">
<a class="block mb-2 hover:text-blue-500" href="{{ root }}{{ item.url }}">
{{ item.name }}
{% if item.external %}
<span class="text-xs text-zinc-500"></span>
Expand Down
8 changes: 5 additions & 3 deletions site/templates/partials/nav.tera.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

{% import "macros/icon.tera.html" as ic %}

{% set root = config.base_url | replace(from="https://mitre.github.io/", to="") %}

<nav class="
text-sm
py-4 px-8
Expand All @@ -10,15 +12,15 @@
mx-4
">
<li class="block md:flex md:flex-1 items-stretch">
<a href="/" class="
<a href="{{ root }}/" class="
items-stretch content-center
text-black dark:text-zinc-200 hover:text-green-600
text-xl
font-semibold
">Hipcheck&nbsp;<span class="leading-none font-extrabold text-green-600 text-2xl"></span></a>

{% if config.extra.announce %}
<a href="{{ config.extra.announce.url }}"
<a href="{{ root }}{{ config.extra.announce.url }}"
class="
rounded-3xl
bg-sky-100 dark:bg-sky-900 hover:bg-sky-200 dark:hover:bg-sky-800
Expand Down Expand Up @@ -55,7 +57,7 @@
{% else %}
p-0
{% endif %}
" href="{{ item.url }}" {% if item.id %}id="{{ item.id }}"{% endif %}>
" href="{{ root }}{{ item.url }}" {% if item.id %}id="{{ item.id }}"{% endif %}>
{% if item.icon %}
{% set name = item.icon %}
{{ ic::icon(name=name, classes="mt-[-2px] ml-[-4px] mr-1") }}
Expand Down

0 comments on commit 69ed869

Please sign in to comment.