[ubuntu篇] 使用Github Pages 和hexo 建立个人博客,自定义域名,https加密,搜索引擎google,baidu,360收录 (3)

fix to support https

cd blog git clone https://github.com/hrwhisper/baiduShare.git mv baiduShare source #rm -rf baiduShare # make sure we can access localhost:4000/baiduShare/static/api/js/share.js # edit baidushare.swig grep -r 'bdimg.share.baidu.com' . vim ./themes/next/layout/_partials/share/baidushare.swig # change //bdimg.share.baidu.com/ to /baiduShare <script> with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='/baiduShare/static/api/js/share.js?cdnversion='+~(-new Date()/36e5)]; </script> # there exists a bug in share.js hexo generate hexo server stats busuanzi

edit blog\themes\next\_config.yml

busuanzi_count: # count values only if the other configs are false enable: true # custom uv span for the whole site site_uv: true site_uv_header: <i></i> 访问人数 site_uv_footer: # custom pv span for the whole site site_pv: true site_pv_header: <i></i> 总访问量 site_pv_footer: # custom pv span for one page only page_pv: true page_pv_header: <i></i> 阅读次数 page_pv_footer: hexo-all-minifier (not) npm install hexo-all-minifier --save

edit blog\_config.yml

all_minifier: true

Tips: not enable minifier currently because not stable.

hexo-neat npm install hexo-neat --save

edit blog\_config.yml

# hexo-neat neat_enable: true neat_html: enable: true exclude: neat_css: enable: true exclude: - '*.min.css' neat_js: enable: true mangle: true output: compress: exclude: - '*.min.js' 403 error

edit themes/next/layout/_partials/head.swig

<meta content="no-referrer" /> optimize for speed multiple deploy

deploy to coding.net.

vim themes/next/layout/_partials/footer.swig

<p>Hosted by <a href="http://pages.coding.me">Coding Pages</a></p> compress

use hexo-neat or hexo-all-minifier.

Tips: no use, it may cause longer time to load page.

cdn

NOTICE:

We can not use fourth level `####` for header, otherwise post page will not display properly.

jquery

jquery: https://cdn.jsdelivr.net/jquery/2.1.3/jquery.min.js

gitmint

download gitmint files to themes\next\source\lib

tree gitmint/ gitmint/ ├── dist │ └── gitmint.browser.js └── style └── default.css 2 directories, 2 files

edit ./themes/next/layout/_third-party/comments/gitment.swig

#<link href="http://www.likecs.com/lib/gitmint/style/default.css"> #<script src="http://www.likecs.com/lib/gitmint/dist/gitmint.browser.js"></script>

edit _config.yml to skip gitmint file

skip_render: # relative to source/ folder - README.md - lib/gitmint/dist/*.js - lib/gitmint/style/*.css faq

errors:

hexo -v ERROR Local hexo not found in /home/kezunlin/git/blog

solution:

cd blog rm node_modules cnpm install --save Reference

hexo image manage

hexo prement link

using cnblogs and chrome extension to upload iamges

img uploader

baidushare support https

hexo minifier

hexo neat

domain dnspod godaddy

use https

optimize for speed

ssl for github blog

ssl

github page IP

google adsense demo site

google adsense for hexo blog

History

2017/12/26: created.

2017/12/27: add Appendix,use next theame,add tags/categories page.

2017/12/28: add Advanced, use gitment,baidushare,local search,etc.

2018/01/02: upload images to cnblogs.

2018/01/03: hexo-neat to compress,cdn,etc.

2018/01/22: add part2.

2018/09/05: add ssl.

2019/11/07: reorganize post contents.

Copyright

Post author: kezunlin

Post link: https://kezunlin.me/post/98df88a8/

Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 3.0 unless stating additionally.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zwxdwx.html