From c37abc44bcd82efd1abd837e379b48e75572ebb5 Mon Sep 17 00:00:00 2001 From: Jiashu Xu Date: Sat, 19 Feb 2022 19:41:13 -0800 Subject: [PATCH] enable blog to redirect to asset (#550) --- _posts/2022-02-01-redirect.md | 7 +++++++ blog/index.html | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 _posts/2022-02-01-redirect.md diff --git a/_posts/2022-02-01-redirect.md b/_posts/2022-02-01-redirect.md new file mode 100644 index 0000000..29170d8 --- /dev/null +++ b/_posts/2022-02-01-redirect.md @@ -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 +--- diff --git a/blog/index.html b/blog/index.html index fc0d6d6..4e2f168 100644 --- a/blog/index.html +++ b/blog/index.html @@ -30,7 +30,12 @@ pagination: {% assign categories = post.categories | join: "" %}
  • -

    {{ post.title }} +

    + {% if post.redirect == blank %} + {{ post.title }} + {% else %} + {{ post.title }} + {% endif %}

    {{ post.description }}