From 405330385ce3f85fc29af929b7aa295a0a9d85e3 Mon Sep 17 00:00:00 2001 From: liuyib <1656081615@qq.com> Date: Mon, 16 Sep 2019 18:49:55 +0800 Subject: [PATCH] refactor: The post link can be clicked in post page --- layout/_mixins/post-header.pug | 12 ++++++------ layout/_partials/widgets/comments.pug | 1 + layout/_third-party/comments/valine.pug | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/layout/_mixins/post-header.pug b/layout/_mixins/post-header.pug index 56afe48..b02853a 100644 --- a/layout/_mixins/post-header.pug +++ b/layout/_mixins/post-header.pug @@ -5,12 +5,12 @@ mixin postHeader(post) if post.top include ../_partials/widgets/sticky-top.pug - if is_post() - h1.post-header-title= post.title || __("post.untitled") - else - h1.post-header-title - if post.link - a(href=url_for(post.link) target="_blank" rel="noopener" ).post-header-title__a= post.title || post.link + h1.post-header-title + if post.link + a(href=url_for(post.link) target="_blank" rel="noopener" ).post-header-title__a= post.title || post.link + else + if is_post() + = post.title || __("post.untitled") else a(href=url_for(post.path)).post-header-title__a= post.title || __("post.untitled") diff --git a/layout/_partials/widgets/comments.pug b/layout/_partials/widgets/comments.pug index a1ec578..b61d2f4 100644 --- a/layout/_partials/widgets/comments.pug +++ b/layout/_partials/widgets/comments.pug @@ -3,6 +3,7 @@ if theme.disqus && theme.disqus.enable div#disqus_thread else if theme.valine && theme.valine.enable div#comments.comments + div#valine-container else if theme.gitalk && theme.gitalk.enable div#comments.comments div#gitalk-container diff --git a/layout/_third-party/comments/valine.pug b/layout/_third-party/comments/valine.pug index 42ed9be..0f7e336 100644 --- a/layout/_third-party/comments/valine.pug +++ b/layout/_third-party/comments/valine.pug @@ -23,7 +23,7 @@ script&attributes(dataPjax). }); new Valine({ - el: '#comments', + el: '#valine-container', appId: '!{ theme.valine.appid }', appKey: '!{ theme.valine.appkey }', notify: !{ theme.valine.notify }, -- GitLab