Skip to content

Commit

Permalink
Fixed redirect post access from blog archive (alshedivat#1994)
Browse files Browse the repository at this point in the history
Fixes alshedivat#1831

Signed-off-by: George Araújo <george.gcac@gmail.com>
  • Loading branch information
george-gca authored and himanshuIndia committed Jan 16, 2024
1 parent 37d154a commit b1c7b96
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion _layouts/archive-category.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ <h1 class="post-title"> <i class="fa-solid fa-tag fa-sm"></i> {{ page.title }} <
<tr>
<th scope="row">{{ post.date | date: "%b %-d, %Y" }}</th>
<td>
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title }}</a>
{% if post.redirect == blank %}
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title }}</a>
{% elsif post.redirect contains '://' %}
<a class="post-link" href="{{ post.redirect }}" target="_blank">{{ post.title }}</a>
{% else %}
<a class="post-link" href="{{ post.redirect | relative_url }}">{{ post.title }}</a>
{% endif %}
</td>
</tr>
{% endfor %}
Expand Down
8 changes: 7 additions & 1 deletion _layouts/archive-tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ <h1 class="post-title"> <i class="fa-solid fa-hashtag fa-sm"></i> {{ page.title
<tr>
<th scope="row">{{ post.date | date: "%b %-d, %Y" }}</th>
<td>
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title }}</a>
{% if post.redirect == blank %}
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title }}</a>
{% elsif post.redirect contains '://' %}
<a class="post-link" href="{{ post.redirect }}" target="_blank">{{ post.title }}</a>
{% else %}
<a class="post-link" href="{{ post.redirect | relative_url }}">{{ post.title }}</a>
{% endif %}
</td>
</tr>
{% endfor %}
Expand Down
8 changes: 7 additions & 1 deletion _layouts/archive-year.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ <h1 class="post-title"> <i class="fa-solid fa-calendar fa-sm"></i> {{ page.date
<tr>
<th scope="row">{{ post.date | date: "%b %-d, %Y" }}</th>
<td>
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title }}</a>
{% if post.redirect == blank %}
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title }}</a>
{% elsif post.redirect contains '://' %}
<a class="post-link" href="{{ post.redirect }}" target="_blank">{{ post.title }}</a>
{% else %}
<a class="post-link" href="{{ post.redirect | relative_url }}">{{ post.title }}</a>
{% endif %}
</td>
</tr>
{% endfor %}
Expand Down

0 comments on commit b1c7b96

Please sign in to comment.