侧边栏壁纸
  • 累计撰写 101 篇文章
  • 累计创建 192 个标签
  • 累计收到 85 条评论
标签搜索

目 录CONTENT

文章目录

joe2.0 文章内广告无法点击

Faonecze
2022-02-25 / 0 评论 / 0 点赞 / 422 阅读 / 2,060 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2022-05-02,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

本来只是好奇,想添加个七牛的广告来查看广告效果.

广告无法点击链接

结果遇到了joe2.0主题的bug,去github项目查看Issues发现原来是缺少class-传送阵

案例分析

但是现在没有确定是哪个位置的,于是利用github搜索项目,发现是在
halo-theme-joe2.0/template/ads/ads_post.ftl位置:

源代码内容如下:

<#if settings.post_ad_address?? && settings.post_ad_address != '' && settings.post_ad_image?? && settings.post_ad_image != ''>    
  <section class="joe_advert-large">
    <a target="_blank" rel="noopener noreferrer nofollow" href="${settings.post_ad_address}" title="广告">
      <img width="100%" src="${settings.post_ad_image}" alt="广告"/>
      <span class="icon">广告</span>
    </a>
  </section>
</#if>

还需要找一个参照代码,恩,那就用作者的html部分的源码对比吧:

        <section class="joe_advert-large">
          <a target="_blank" rel="noopener noreferrer nofollow" href="https://curl.qcloud.com/Ia2NSv50" title="广告">
            <img class="omit" width="100%" src="https://mblog-1257649495.cos.ap-nanjing.myqcloud.com/mblog/%E9%A6%96%E5%8D%95%E9%99%90%E6%97%B6_1040-100_1638724023054.jpg" alt="广告"/>
            <span class="icon">广告</span>
          </a>
        </section>

比较后可以看出是缺少class="omit"

案例处理

由于后台docker还在运行,建立的时候没有添加路径,只能手工操作了.

服务器创建修改好名为ads_post.ftl的文件,并写入如下内容:

<#if settings.post_ad_address?? && settings.post_ad_address != '' && settings.post_ad_image?? && settings.post_ad_image != ''>    
  <section class="joe_advert-large">
    <a target="_blank" rel="noopener noreferrer nofollow" href="${settings.post_ad_address}" title="广告">
      <img class="omit" width="100%" src="${settings.post_ad_image}" alt="广告"/>
      <span class="icon">广告</span>
    </a>
  </section>
</#if>

在主机上cp到docker中:

docker cp /路径/ads_post.ftl halo:/root/.halo/templates/themes/joe2.0/template/ads/ads_post.ftl

至此,完结,欢迎食用.

最后要说

虽作者说在下个版本上会更新,不过能手动做的还是手动做吧,毕竟作者也很忙.当然也期待下个版本修复.

新版本已经修复(2022.3.4 V1.0.9)

新版已修复该问题,请直接前往Github安装新版。

0
广告 广告

评论区