Our First Hexo

Posted by NTNU_import_magic's member on 2020-11-11
Estimated Reading Time 3 Minutes
Words 726 In Total

Hexo Blog - Live My Life Theme

過程中遇到的小問題

當吃到 INFO Validating config WARN Deprecated config detected: “external_link“ with a Boolean

_config.yml裡的

1
2
external_link:
enable: true|false

改成

1
2
3
4
external_link:
enable: true # Open external links in new tab
field: site # Apply to the whole site
exclude: ''

當吃到 lineno column filename的 Warning

1
2
3
4
5
6
7
8
(node:117248) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:117248) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:117248) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
(node:117248) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(node:117248) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:117248) Warning: Accessing non-existent property 'filename' of module exports inside circular dep
endency

原因如這裡

說白一點就是nodejs@14版本太高的問題,大部分我看到的文章都是要你降級程12版。

但我覺得太毒瘤太不資工正確了。

這是我所查到有用的三篇文章:

  • 第一篇
  • 第二篇(github上討論有關這個問題的處理方法)
  • 第三篇(github中nodejs@14 stylus在 lineno column filename 的error設定)

延續第三篇搭配第二篇,把路徑node_module\nib\node_module\stylus\lib\nodes\index.js
裡的

1
2
export.true = new export.Boolean(true);
export.false = new export.Boolean(false);

一起註解掉

1
2
/*export.true = new export.Boolean(true);
export.false = new export.Boolean(false);*/

想把每一篇文章底部的socialshare改成自己要的

像我,我只想要twitter facebook google mail

首先,先去themes/livemtlife/layout/partial/socialshare.ejs中把<div>裡的

1
<div class="social-share" data-initialized="true" data-disabled="tencent ,douban ,qzone ,linkedin ,facebook ,google ,diandian" data-wechat-qrcode-helper="" align="center">

中的 googlefacebook 刪掉,因為它原本把兩者的link都disable掉了。(PS: data-wechat-qrcode-helper=""也可以砍掉,因為我等一下會把wechat那段 <li></li> 砍掉

然後,將

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!-- 刪掉 wechat weibo QQ -->

<li class="social-share-li">
<a class="social-share-icon icon-wechat">
<i class="fa fa-weixin fa-1x" aria-hidden="true"></i>
</a>
</li>
<li class="social-share-li">
<a target="_blank" class="social-share-icon icon-weibo">
<i class="fa fa-weibo fa-1x" aria-hidden="true"></i>
</a>
</li>
<li class="social-share-li">
<a target="_blank" class="social-share-icon icon-qq">
<i class="fa fa-qq fa-1x" aria-hidden="true"></i>
</a>
</li>

改成

1
2
3
4
5
6
7
8
9
10
11
12
<!-- 新增 google facebook -->

<li class="social-share-li">
<a target="_blank" class="social-share-icon icon-google">
<i class="fa fa-google fa-1x" aria-hidden="true"></i>
</a>
</li>
<li class="social-share-li">
<a target="_blank" class="social-share-icon icon-facebook">
<i class="fa fa-facebook fa-1x" aria-hidden="true"></i>
</a>
</li>

不想用不蒜子統計

themes/livemylife/layout/partial/header.ejs把以下的<span></span>給註記掉。

1
2
3
4
5
 <!-- 不蒜子统计 start -->
<!--<span class="meta">
Viewed <span id="busuanzi_value_page_pv"><i class="fa fa-spinner fa-spin"></i></span> Times
</span>-->
<!-- 不蒜子统计 end -->

If you like this blog or find it useful for you, you are welcome to comment on it. You are also welcome to share this blog, so that more people can participate in it. If the images used in the blog infringe your copyright, please contact the author to delete them. Thank you !