Skip to content

Commit 2d3ec00

Browse files
authored
fix(docs): prefix blog post card hrefs with base_url (#1552)
`post.url` resolves to a root-absolute path (`/blog/...`) and drops the `/noir` base path when the site is served from a GitHub Pages subdirectory. Clicking a card from the blog index or an author page landed on `https://owasp-noir.github.io/blog/...` (404) instead of `/noir/blog/...`. Prefix with `{{ base_url }}` to match how every other nav/footer link in the templates is built.
1 parent e7ed2c4 commit 2d3ec00

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

docs/templates/blog_section.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h1 class="blog-hero-title">
2525
<ul class="blog-post-list">
2626
{% for post in section.pages %}
2727
<li class="blog-post-card">
28-
<a class="blog-post-card-link" href="{{ post.url }}">
28+
<a class="blog-post-card-link" href="{{ base_url }}{{ post.url }}">
2929
<div class="blog-post-card-meta">
3030
<time datetime="{{ post.date }}">{{ post.date }}</time>
3131
{% if post.authors %}

docs/templates/taxonomy_term.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ <h2 class="blog-author-posts-title">
6161
{% set keep = (page.language == "ko" and is_ko) or (page.language != "ko" and not is_ko) %}
6262
{% if keep %}
6363
<li class="blog-post-card">
64-
<a class="blog-post-card-link" href="{{ post.url }}">
64+
<a class="blog-post-card-link" href="{{ base_url }}{{ post.url }}">
6565
<div class="blog-post-card-meta">
6666
<time datetime="{{ post.date }}">{{ post.date }}</time>
6767
</div>

0 commit comments

Comments
 (0)