enable blog to redirect to asset (#550)
This commit is contained in:
parent
77b60dc395
commit
c37abc44bc
7
_posts/2022-02-01-redirect.md
Normal file
7
_posts/2022-02-01-redirect.md
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
layout: post
|
||||
title: a post with redirect
|
||||
date: 2021-07-04 17:39:00
|
||||
description: you can also redirect to assets like pdf
|
||||
redirect: /assets/pdf/example_pdf.pdf
|
||||
---
|
@ -30,7 +30,12 @@ pagination:
|
||||
{% assign categories = post.categories | join: "" %}
|
||||
|
||||
<li>
|
||||
<h3><a class="post-title" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
|
||||
<h3>
|
||||
{% if post.redirect == blank %}
|
||||
<a class="post-title" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
|
||||
{% else %}
|
||||
<a class="post-title" href="{% if post.redirect contains '://' %}{{ post.redirect }}{% else %}{{ post.redirect | relative_url }}{% endif %}">{{ post.title }}</a>
|
||||
{% endif %}
|
||||
</h3>
|
||||
<p>{{ post.description }}</p>
|
||||
<p class="post-meta"> {{read_time}} min read ·
|
||||
|
Loading…
Reference in New Issue
Block a user