From 988cbcc331eea131eee2d588f7f1098bf22d316d Mon Sep 17 00:00:00 2001 From: Jerry <16351105+jerryc127@users.noreply.github.com> Date: Thu, 6 Aug 2020 21:45:16 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=BE=A9pjax=E4=B8=8B?= =?UTF-8?q?=EF=BC=8C=E5=90=8C=E6=99=82=E9=96=8B=E5=95=93Open=5FGraph=5Fmet?= =?UTF-8?q?a=E5=92=8CLivere=EF=BC=8CLivere=E8=A9=95=E8=AB=96=E5=BE=8C?= =?UTF-8?q?=E8=87=BA=E9=A1=AF=E7=A4=BA=E7=9A=84=E4=BE=86=E6=BA=90=E9=A0=81?= =?UTF-8?q?=E9=9D=A2=E8=88=87=E5=AF=A6=E9=9A=9B=E4=B8=8D=E5=90=8C=20?= =?UTF-8?q?=E7=9A=84bugs=20#294?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/includes/third-party/pjax.pug | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/layout/includes/third-party/pjax.pug b/layout/includes/third-party/pjax.pug index b15b058..af212fb 100644 --- a/layout/includes/third-party/pjax.pug +++ b/layout/includes/third-party/pjax.pug @@ -1,16 +1,22 @@ script(src=url_for(theme.CDN.pjax)) script. - var pjax = new Pjax({ + let pjaxSelectors = [ + 'title', + 'meta[name=description]', + '#config_change', + '#body-wrap', + '#rightside-config-hide', + '#rightside-config-show', + '.js-pjax' + ] + + if (!{theme.Open_Graph_meta && theme.comments.use.includes('Livere')}) { + pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]') + } + + const pjax = new Pjax({ elements: 'a:not([target="_blank"])', - selectors: [ - 'title', - 'meta[name=description]', - '#config_change', - '#body-wrap', - '#rightside-config-hide', - '#rightside-config-show', - '.js-pjax' - ], + selectors: pjaxSelectors, cacheBust: false, })