如何从零搭建hexo个人博客网站
https://www.jianshu.com/p/adf65cbad393?utm_source=oschina-app
准备工作
- github账号
- node.js 环境搭建
- git使用
- markdown语法
环境搭建
本地环境: win10
node -v
# v8.11.1
npm -v
# 5.6.0
hexo -v
# hexo: 3.7.1
# hexo-cli: 1.1.0
git --version
# git version 2.18.0.windows.1
nodejs,git安装过程及github.io的创建参考其他文章,git需要配置到如下输出可正常使用
ssh -T git@github.com
> Hi xxx! You've successfully authenticated, but GitHub does not provide shell access.
hexo安装使用
- 切换淘宝源
npm config set registry https://registry.npm.taobao.org - 安装使用hexo-cil
npm install -g hexo-cli
hexo init <folder>
cd <folder>
npm install
hexo g
hexo s
# 浏览器输入localhost:4000 ,可看到最初的hexo网站
# 此处命令可使用git-bash。exe 输入
- 安装部署到github.io的依赖
npm install –save hexo-deployer-git - 修改配置文件部署到github.io
#修改项目下的_config.yml文件
deploy:
type: git
repo: git@github.com:diaoyongbao/diaoyongbao.github.io.git #修改成自己的项目地址
branch: master
- 部署项目,访问项目地址
hexo deploy
next安装使用
- 安装
cd your-hexo-site
git clone https://github.com/iissnan/hexo-theme-next themes/next
- 修改项目的配置文件启用
theme: next
开启更多功能
官方网站上已经记录了很多功能,下面记录几个没有的
- 自动更换背景图片
# 配置文件 themes\next\source\css\ _custom\custom.styl
body {
background:url(https://source.unsplash.com/random/1600x900);
background-repeat: no-repeat;
background-attachment:fixed;
background-position:50% 50%;
#repeat:是否重复出现
#attachment:定义背景图片随滚动轴的移动方式
#position:设置背景图像的起始位置
}
- 字数统计
# 配置文件:themes/_config.yml
post_wordcount:
item_text: true
wordcount: true
min2read: true
totalcount: false
separated_meta: true
- 添加社交图标
# 配置文件:themes/_config.yml
social:
GitHub: https://github.com/diaoyongbao || github
E-Mail: mailto:dyb6884@gmail.com || envelope
- 点击爱心效果
浏览器输入:http://7u2ss1.com1.z0.glb.clouddn.com/love.js
拷贝所有代码,在/themes/next/source/js/src里面新建love.js,然后在/themes/next/layou/_layout.swig文件末尾添加以下代码:
<!-- 页面点击小红心 -->
<script type="text/javascript" src="/js/src/love.js"></script>
下载链接及参考文章
- node.js: http://nodejs.cn/
- git: https://git-scm.com/downloads
- win下好用的markdown编辑器:https://ivarptr.github.io/yu-writer.site/
- 环境搭建:https://blog.csdn.net/weixin_39879178/article/details/80319392
- hexo使用文档: https://hexo.io/zh-cn/docs/
- next: https://github.com/iissnan/hexo-theme-next
- next使用文档: http://theme-next.iissnan.com/
- next进阶设置: https://www.jianshu.com/p/1f8107a8778c
如何从零搭建hexo个人博客网站的更多相关文章
- github+hexo搭建自己的博客网站(六)进阶配置(搜索引擎收录,优化你的url)
详细的可以查看hexo博客的演示:https://saucxs.github.io/ 绑定了域名: http://www.chengxinsong.cn hexo+github博客网站源码(可以clo ...
- github+hexo搭建自己的博客网站(七)注意事项(避免read.me,CNAME文件的覆盖,手动改github page的域名)
详细的可以查看hexo博客的演示:https://saucxs.github.io/ 绑定域名可以查看:http://www.chengxinsong.cn 可以查看在github上生成的静态文件(如 ...
- Hexo搭建个人静态博客网站
前言 前段时间博客园整改,许多博客无法查看,偶然的机会接触到了许多博客框架,可用来快速搭建一个静态博客网站:最后选择使用hexo,看了不少大佬的教程,觉得挺有意思的,于是也总结了一下自己的搭建步骤,可 ...
- 5分钟搭建wordpress个人博客网站——宝塔傻瓜式部署,无坑系列,附赠主题和md插件[2021-12-31]
一.前言 自从买了服务器,小编已经马不停蹄的学了两天服务搭建的知识,问了很多大佬,快速搭建自己的博客网站.有四种方式,我在这里全部分享给大家.自己已经搭建好,欢迎大家过来看一下,给你提供个思路哈! 小 ...
- github+hexo搭建自己的博客网站(一)基础入门
github提供的page,hexo提供的静态博客文档,这样可以搭建一个自己的一个博客网站. 使用github pages服务搭建博客的好处有: 全是静态文件,访问速度快: 免费方便,不用花一分钱就可 ...
- github+hexo搭建自己的博客网站(二)更换主题yilia
开始更换主题,hexo默认的主题是landscape,可以更换为其他的主题yilia主题 详细的可以查看hexo博客的演示:saucxs.github.io 可以查看在github上生成的静态文件:h ...
- Hexo+Github: 博客网站搭建完全教程(看这篇就够了)
本篇教程首次发布在个人博客:sunhwee.com,想要获得最佳阅读体验,欢迎前往,建议用电脑查看教程文档. # 阅读须知 注意,这篇文章篇幅较长,主要针对新手,每一步很详细,所以可能会显得比较啰嗦, ...
- 在Github和oschina上搭建自己的博客网站
在Github上搭建 - 参考链接 搭建一个免费的,无限流量的Blog----github Pages和Jekyll入门 GitHub + Jekyll 搭建并美化个人网站 用Jekyll搭建的Git ...
- CentOS 7 yum安装LAMP,LNMP并搭建WordPress个人博客网站
本次实验要进行的是在CentOS7.2,内核版本3.10.0-327.el7.x86_64的环境下搭建LAMP和LNMP,并在此之上做一个WordPress博客网站. [root@Shining ~] ...
随机推荐
- C++ STL 已序区间查找算法
#include <iostream>#include <algorithm>#include <list>#include <functional># ...
- Spring事务管理5-----声明式事务管理(3)
声明式事务管理 基于注解 在配置文件中需要开启注解驱动<tx:annotation-driven transaction-manager="transactionManager&qu ...
- 为Django添加图片验证码
可直接复制到Django项目中使用 # author:sunshine from django.http import HttpResponse from PIL import Image, Imag ...
- 递归-PrintDigit
static void PrintDigit(double n,int len,int count=-1) { if (n <0) { n = System.Math.Abs(n); Conso ...
- 【ARM-LInux开发】如何运行wayland
Running Wayland 原文:https://jan.newmarch.name/Wayland/RunningWayland/ skip table of contents Show tab ...
- CVPapers - Computer Vision Resource
To add links (PDF, project,...) you can use the online tool. Computer Vision Paper Indexes ICCV: 20 ...
- .net 结合FFMPEG
读取流 https://blog.csdn.net/vanjoge/article/details/79657874 基于设备,推流 https://blog.csdn.net/lxbwolf/art ...
- elasticsearch数据库(ES)
1. http://blog.csdn.net/cnweike/article/details/33736429 http://www.oschina.net/translate/elasticsea ...
- 解决从github上下载代码仓库慢的问题
一,打开命令提示符,最好之前准备一个仓库地址,这样下载下来的文件方便查看,这里打开你想要的下载根目录,进行下载. github上下载代码仓库慢的问题"> 二:复制代码仓库的地址 三:右 ...
- oracle分区表原理学习
1.创建普通表 create table normal_shp(id number,day date,city_number number,note varchar2(100)) tablespace ...