hexo配置主题发表文章
将本地hexo博客部署到github上了,如果想换我们自己喜欢的主题(默认为landscape),同时也要发表发表文章呢,下面给介绍下:
1、进入hexo官网,预览自己想要的主题,https://github.com/hexojs/hexo/wiki/Themes
这里拿light为例:
进入hexo博客的目录,如:E:/hexo/themes 右键git bash 输入:
git clonehttps://github.com/hexojs/hexo-theme-light.git
然后
cd themes/light
git pull
OK.我们的themes目录里面有light文件了。
2、下面我们说下配置
站点配置用到两个文件,一个是对整站的配置H:\hexo\_config.yml,另一个是对主题的配置H:\hexo\themes\light_config.yml,我们来分别介绍。
H:\hexo\ _config.yml
# Hexo Configuration
## Docs: http://zespia.tw/hexo/docs/configure.html
## Source: https://github.com/tommy351/hexo/ # Site 这里的配置,哪项配置反映在哪里,可以参考我的博客
title: Xiaomiya's blog #站点名,站点左上角
subtitle: Walk steps step by step #副标题,站点左上角
description: Walk steps step by step #给搜索引擎看的,对站点的描述,可以自定义
author: xiaomiya#在站点左下角可以看到
email: #你的联系邮箱
language: zh-CN #中国人嘛,用中文 # URL #这项暂不配置,绑定域名后,欲创建sitemap.xml需要配置该项
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://yoursite.com
root: /
permalink: :year/:month/:day/:title/ #永久链接
tag_dir: tags
archive_dir: archives
category_dir: categories # Writing 文章布局、写作格式的定义,不修改
new_post_name: :title.md # File name of new posts
default_layout: post
auto_spacing: false # Add spaces between asian characters and western characters
titlecase: false # Transform title into titlecase
max_open_file: 100
filename_case: 0
highlight:
enable: true
backtick_code_block: true
line_number: true
tab_replace: # Category & Tag
default_category: uncategorized
category_map:
tag_map: # Archives 默认值为2,这里都修改为1,相应页面就只会列出标题,而非全文
## 2: Enable pagination
## 1: Disable pagination
## 0: Fully Disable
archive: 1
category: 1
tag: 1 # Server 不修改
## Hexo uses Connect as a server
## You can customize the logger format as defined in
## http://www.senchalabs.org/connect/logger.html
port: 4000
logger: false
logger_format: # Date / Time format 日期格式,不修改
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: MMM D YYYY
time_format: H:mm:ss # Pagination 每页显示文章数,可以自定义,我将10改成了5
## Set per_page to 0 to disable pagination
per_page: 5
pagination_dir: page # Disqus Disqus插件,我们会替换成“多说”,不修改
disqus_shortname: # Extensions 这里配置站点所用主题和插件,暂默认,后面会介绍怎么修改
## Plugins: https://github.com/tommy351/hexo/wiki/Plugins
## Themes: https://github.com/tommy351/hexo/wiki/Themes
theme: light
exclude_generator:
plugins:
- hexo-generator-feed
- hexo-generator-sitemap # Deployment 站点部署到github要配置,上一节中已经讲过
## Docs: http://zespia.tw/hexo/docs/deploy.html
deploy:
type: github
repository: https://github.com/xiaomiya/xiaomiya.github.com.git
branch: master
现在可以hexo generate,hexo server,打开localhost:4000查看效果了。
H:\hexo\themes\light_config.yml
menu: #站点右上角导航栏,暂时默认,后面介绍修改
首页: /
存档: /archives
关于: /about
ToDo: /todolist widgets: #站点右边栏,暂时默认,后面介绍修改和添加
- search
- category
- tagcloud
- blogroll excerpt_link: 阅读全文 #替换为中文 plugins: twitter: #右边栏要显示twitter展示的话,需要在此设置
username: moxie198
show_replies: false
tweet_count: 5 addthis: #SNS分享,身在天朝,当然用“百度分享”,暂时默认,后面会介绍
enable: true
pubid:
facebook: true
twitter: true
google: true
pinterest: true fancybox: true #图片效果,默认 google_analytics: #要使用google_analytics进行统计的话,这里需要配置ID,暂时默认,后面介绍
rss: #生成RSS,需要配置路径,暂时默认,后面介绍
- hexo server,访问localhost:4000预览效果。(退出server用Ctrl+c)
- hexo deploy,同步到github。访问网站看看效果。
hexo配置主题发表文章的更多相关文章
- 添加 hexo yilia 主题的文章阅读量
根据此篇博客(点击查看) 配置出自己的博客阅读量,里面介绍了如何配置开通 leancloud 应用 当然介绍我如何配置 yilia 显示自己的浏览量的. 首先在 yilia 主题下修改 _config ...
- 安装配置hexo icarus主题配置
安装部分配置hexo icarus主题配置 安装icarus 直接下载主题模块放到blog项目 ,blog项目根目录执行 git clone https://github.com/ppoffice/h ...
- 手摸手带你用Hexo撸博客(二)之配置主题
在上一篇博客手摸手带你用Hexo撸博客(一)中主要介绍了博客的初步搭建 今天我们继续讲如何在Hexo搭建的博客中应用主题 官网选择自己喜欢的主题 点击这里Hexo主题进入官网主题页面 然后选择自己喜欢 ...
- WordPress主题开发实例:显示最新发表文章
实现效果 制作网站的时候,想在页面左栏显示最新发表的文章,如: 一.先开启侧边栏工具,在functions.php加上 $args = array( 'name' => __( '分类侧边栏') ...
- hexo next主题为博客添加分享功能
title: hexo next主题为博客添加分享功能 date: 2018-01-06 20:20:02 tags: [hexo博客, 博客配置] categories: hexo next主题配置 ...
- Hexo系列(五) 撰写文章
在利用 Hexo 框架搭建一个属于我们自己的博客网站后,下面我们就来谈谈怎样在网站上书写我们的第一篇博客吧 一.创建文章 在站点文件夹中打开 git bash,输入如下命令创建文章,其中 title ...
- hexo next主题深度优化(五),评论系统换成gittalk
文章目录 背景: 开始: 新建comments_git.js 找到comments.swig在最后一个endif之前 引入代码 pjax加入gitalk 遇到的问题 所有的页面共享的一个评论issue ...
- hexo next主题深度优化(二),懒加载。
文章目录 tip:没有耐心的可以直接看:正式在hexo next中加入懒加载(最下面) 废话 背景 懒加载简单介绍 引入js 重点!敲黑板了!!! 完善懒加载函数 懒加载函数可配置的参数 正式在hex ...
- Hexo 官方主题 landscape-plus 优化
博主喜欢简洁大方的Hexo主题,看了不下100个主题之后,最终选择了 landscape-plus 主题(针对中国大陆地区,对Hexo官方主题landscape进行优化后的版本).更多Hexo主题资源 ...
随机推荐
- 20145109 《Java程序设计》第五周学习总结
20145109 <Java程序设计>第五周学习总结 教材学习内容总结 Chapter 8 Exception Handling try, catch All Exceptions are ...
- 第十节课-RNN介绍
2017-08-21 这次的课程介绍了RNN的相关知识: 首先是RNN的几种模型: 分别又不同的应用场景,包括机器翻译,视频的分类... RNN的解释: 主要的特点就是用到了上一个隐含状态的信息,所以 ...
- AtCoder Regular Contest 092
AtCoder Regular Contest 092 C - 2D Plane 2N Points 题意: 二维平面上给了\(2N\)个点,其中\(N\)个是\(A\)类点,\(N\)个是\(B\) ...
- bzoj 1050: [HAOI2006]旅行comf(codevs.cn 1001 舒适的路线) 快排+并查集乱搞
没用的话:好像很久没发博客了,主要是懒太蒟找不到水题.我绝对没弃坑...^_^ 还用些话:本文为博主原创文章,若转载请注明原网址和作者. 进入正题: 先pa网址: bzoj :http://www.l ...
- Docker 容器内配置Tomcat manager 远程控制
下载tomcat镜像 , docker run it docker exec -ti 容器ID /bin/bash 进入容器 apt-get update , apt-get install vi ...
- Graph_Master(连通分量_A_双连通分量+桥)
hdu 5409 题目大意:给出一张简单图,求对应输入的m条边,第i-th条边被删除后,哪两个点不连通(u,v,u<v),若有多解,使得u尽量大的同时v尽量小. 解题过程:拿到题面的第一反应缩点 ...
- JavaScript 打印控件
JavaScript 打印控件 github地址 https://github.com/DoersGuild/jQuery.print 使用前需要引入jQuery $("#mapDiv&qu ...
- selenium学习笔记(智能等待)
博主在尝试对百度首页用selenium完成自动登录的功能 反复多次尝试元素定位方法也未写错.最后发现问题原因: 脚本运行速度快于页面加载速度 如百度首页登录例子.脚本已经开始寻找登录弹窗 但是页面仍在 ...
- Python subplot 绘画
环境 Anaconda3 Python 3.6, Window 64bit 目的 利用 matplotlib 画图模块,汇至子图 # -*- coding: utf-8 -*- import matp ...
- spring3: 表达式5.2 SpEL基础
5.1 概述 5.1.1 概述 Spring表达式语言全称为“Spring Expression Language”,缩写为“SpEL”,类似于Struts2x中使用的OGNL表达式语言,能在运行 ...