---------------------------------
-----------------------------------
2023/12/3 16:19:32
contentnbsp;npminstall -g hexo-cli
$hexo init <folder>$cd<folder>$npm install
contentnbsp;hexo new"My New Post"
contentnbsp;hexo server contentnbsp;hexo s
contentnbsp;hexo generate contentnbsp;hexo g
contentnbsp;hexo deploy contentnbsp;hexo d
详细准备工作,可以查阅hexo官网
gitclone https://github.com/probberechts/hexo-theme-cactus.git themes/cactus
# 首页Projects的urlprojects_url:https://github.com/xiaobinwu# 设置页面方向direction:ltr# 首页导航# contentnbsp;hexo new page about,可以创建page页面nav:home:/about:/about/articles:/archives/categories:/categories/search:/search/# 社交链接social_links:github:https://github.com/xiaobinwumail:mailto:xiaobin_wu@yahoo.com# 开启标签快捷方式tags_overview:true# 首页 Writing的展示条数posts_overview:show_all_posts:falsepost_count:5sort_updated:false# 排列方式archive:sort_updated:falsepost:show_updated:false# logo设置logo:enabled:truewidth:50height:50url:/images/logo.pnggravatar:false# ico设置favicon:desktop:url:/images/favicon.icogravatar:falseandroid:url:/images/favicon-192x192.pnggravatar:falseapple:url:/images/apple-touch-icon.pnggravatar:false# 高亮语法highlight:kimbie.dark# 博客主题色,dark, light, classic, whitecolorscheme:darkpage_width:48# rss设置rss:atom.xmlopen_graph:fb_app_id:fb_admins:twitter_id:google_plus:# disqus评论,默认不开启,需翻墙disqus:enabled:falseshortname:cactus-1# 谷歌统计google_analytics:enabled:falseid:UA-86660611-1# 百度统计baidu_analytics:enabled:falseid:2e6da3c375c8a87f5b664cea6d4cb29cgravatar:email:xiaobin_wu@yahoo.comvaline:enable:trueapp_id:xxxxxxapp_key:xxxxxxx
valine:enable:trueapp_id:xxxxapp_key:xxxx
<%if(theme.valine.enable) { %><scriptsrc="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script><scriptsrc='//unpkg.com/valine/dist/Valine.min.js'></script><pid="vcomments"class="blog-post-comments"></p><script>newValine({ el: '#vcomments', visitor: true, appId: '<%=theme.valine.app_id %>', appKey: '<%=theme.valine.app_key %>', placeholder: 'ヾ?≧?≦)o来啊,快活啊!', avatar: 'robohash'}) </script><%} %>
mkdirblog.git&& cdblog.gitgitinit--bare
deploy: type: git message: update repo: root@xx.xxx.xx.xxx:/www/wwwroot/blog.git,master
npm installhexo-deployer-git --save
cd/www/wwwroot/blog.git/hookstouchpost-receivevimpost-receive
#!/bin/bash -lGIT_REPO=/www/wwwroot/blog.git TMP_GIT_CLONE=/www/wwwroot/tmp/blog PUBLIC_WWW=/www/wwwroot/blog rm -rf ${TMP_GIT_CLONE}mkdir ${TMP_GIT_CLONE}git clone$GIT_REPO$TMP_GIT_CLONErm -rf ${PUBLIC_WWW}/* cp -rf ${TMP_GIT_CLONE}/* ${PUBLIC_WWW}
chmod+xpost-receive chmod777-R /www/wwwroot/blog chmod777-R /www/wwwroot/tmp/blog
contentnbsp;hexo g -d
上一条信息:免费搭建博客或网盘(建立博客的好处有什么)