最近我看了hexo的主题,发现了很多好看的主题。很多人的博客就是用别人的主题,搞出来的。之前我的博客发现真的是太难看了,然后没有去维护。那个时候不知道没有关系,今天我知道了,就是把之前删除了。

我在茫茫的主题中发现了它,这个就是大神开发的:https://shen-yu.gitee.io/


对应的Github:https://github.com/Shen-Yu/hexo-theme-ayer

我先去给大神Star了,这个大神牛逼。百度发现教程不足,搭建起来头疼。遇到问题,Github上又没有解释。

最后决定用icarus,好像很多人用这个主题

文章目录

  • 开干
  • 修改主题
  • 配置主题
  • 项目配置
  • 写文章

开干

在本地创建一个博客目录

hexo init blog

上面这个命令执行完后,会在本地创建一个 blog 目录,然后进入到这个目录中,执行 npm install 命令,安装相关的依赖。

现在去_config.yml文件中,做网站的一些基本配置, 网站的 title,描述,关键字、图标等,这些配置搞定。如下

# Site
title: 'Python之王'
subtitle: 'Python之王'
description: '人生最重要的不是所站的位置,而是内心所朝的方向。只要我在每篇博文中写得自己体会,修炼身心;在每天的不断重复学习中,耐住寂寞,练就真功,不畏艰难,奋勇前行,不忘初心,砥砺前行,人生定会有所收获,不留遗憾...'
keywords: 'Python, Java, 机器学习, 爬虫, 前端, Spring家族, 人工智能'
author: 'Runsen'
language: en
timezone: ''

配置完成后,定位到 blog 目录,执行hexo s就可以在本地启动项目了,浏览器中输入 http://localhost:4000 就可以看到网站了,就是那个最难看的页面。

补充下hexo的命令

新建GIthub项目,创建 {username}.GIthub.io 的仓库,

修改主题

Hexo 默认使用的主题是 landscape ,之前使用了 hexo-theme-next 主题,现在我用melody 。

下面就是看官方教程来搞下来。

首先将之克隆到 ./themes 目录下,这个目录下原本有有一个 landscape 文件夹,里边放的默认的样式,

首先命令行进入到项目的根目录,执行如下命令即可:

git clone  https://github.com/Molunerfinn/hexo-theme-melody themes/melody

克隆成功后,修改 hexo 的 _config.yml 文件,将主题修改为 melody,如下:

theme: icarus

这个时候就可以跑起来了。

配置主题

主题创建好之后,接下来就是对主题的配置了,这个比较麻烦,直接参考官方文档和Github教程即可。

下面是我的主题配置

# Version of the configuration file
version: 3.0.0
# Icarus theme variant, can be "default" or "cyberpunk"
variant: default
# Path or URL to the website's logo
logo: /img/logo.png
# Page metadata configurations
head:# URL or path to the website's iconfavicon: /img/avatar.png# Open Graph metadata# https://hexo.io/docs/helpers.html#open-graphopen_graph:# Page title (og:title) (optional)# You should leave this blank for most of the timetitle: # Page type (og:type) (optional)# You should leave this blank for most of the timetype: blog# Page URL (og:url) (optional)# You should leave this blank for most of the timeurl: # Page cover (og:image) (optional)# You should leave this blank for most of the timeimage: # Site name (og:site_name) (optional)# You should leave this blank for most of the timesite_name: # Page author (article:author) (optional)# You should leave this blank for most of the timeauthor: # Page description (og:description) (optional)# You should leave this blank for most of the timedescription: # Twitter card type (twitter:card)twitter_card: # Twitter ID (twitter:creator)twitter_id: # Twitter Site (twitter:site)twitter_site: # Google+ profile link (deprecated)google_plus: # Facebook admin IDfb_admins: # Facebook App IDfb_app_id: # Structured data of the page# https://developers.google.com/search/docs/guides/intro-structured-datastructured_data:# Page title (optional)# You should leave this blank for most of the timetitle: # Page description (optional)# You should leave this blank for most of the timedescription: # Page URL (optional)# You should leave this blank for most of the timeurl: # Page author (article:author) (optional)# You should leave this blank for most of the timeauthor: # Page images (optional)# You should leave this blank for most of the timeimage: # Additional HTML meta tags in an arraymeta:# Meta tag specified in <attribute>=<value> style# E.g., name=theme-color;content=#123456 => <meta name="theme-color" content="#123456">- 'name=theme-color;content=#123456'- 'name=generator;content="Hexo 4.2.0"'# URL or path to the website's RSS atom.xmlrss: /path/to/atom.xmlnavbar:# Navigation bar menu linksmenu:  #菜单显示改为中文首页: /归档: /archives分类: /categories标签: /tags关于: /about# Links to be shown on the right of the navigation barlinks:Download on GitHub:icon: fab fa-githuburl: 'https://github.com/ppoffice/hexo-theme-icarus'
# Page footer configurations
footer:# Links to be shown on the right of the footer sectionlinks:Creative Commons:icon: fab fa-creative-commonsurl: 'https://creativecommons.org/'Attribution 4.0 International:icon: fab fa-creative-commons-byurl: 'https://creativecommons.org/licenses/by/4.0/'Download on GitHub:icon: fab fa-githuburl: 'https://github.com/ppoffice/hexo-theme-icarus'
# Article related configurations
article:# Code highlight settingshighlight:# Code highlight themes# https://github.com/highlightjs/highlight.js/tree/master/src/stylestheme: atom-one-light# Show copy code buttonclipboard: true# Default folding status of the code blocks. Can be "", "folded", "unfolded"fold: unfolded# Whether to show thumbnail image for every articlethumbnail: true# Whether to show estimated article reading timereadtime: true
# Search plugin configurations
# https://ppoffice.github.io/hexo-theme-icarus/categories/Plugins/Search/
search:type: insight
# Comment plugin configurations
# https://ppoffice.github.io/hexo-theme-icarus/categories/Plugins/Comment/
comment:type: disqus# Disqus shortnameshortname: 'Runsen'avatar: retro # Gravatar style : mm/identicon/monsterid/wavatar/retro/hideplaceholder: 要不要说点啥... # Comment Box placeholder# Donate plugin configurations
# https://ppoffice.github.io/hexo-theme-icarus/categories/Plugins/Donation/
donates:# Alipay donate button configurations-type: alipay# Alipay qrcode image URLqrcode: '/img/alipay.png'# "Buy me a coffee" donate button configurations# Wechat donate button configurations-type: wechat# Wechat qrcode image URLqrcode: '/img/wechat.png'
# Share plugin configurations
# https://ppoffice.github.io/hexo-theme-icarus/categories/Plugins/Share/
share:type: sharejs# URL to the ShareThis share plugin scriptinstall_url: ''
# Sidebar configurations.
# Please be noted that a sidebar is only visible when it has at least one widget
sidebar:# Left sidebar configurationsleft:# Whether the sidebar sticks to the top when page scrollssticky: true# Right sidebar configurationsright:# Whether the sidebar sticks to the top when page scrollssticky: true# Sidebar widget configurations
# http://ppoffice.github.io/hexo-theme-icarus/categories/Widgets/
widgets:-# Where should the widget be placed, left sidebar or right sidebartype: tocposition: right# Profile widget configurations-# Where should the widget be placed, left sidebar or right sidebarposition: lefttype: profile# Author nameauthor: Runsen# Author titleauthor_title: 喜欢折腾的Runsen,微信联系:RunsenLiu# Author's current locationlocation: 中国广东某一个辣鸡学院# URL or path to the avatar imageavatar: # Whether show the rounded avatar imageavatar_rounded: false# Email address for the Gravatargravatar: # URL or path for the follow buttonfollow_link: 'https://github.com/MaoliRUNsen'# Links to be shown on the bottom of the profile widgetsocial_links:Github:icon: fab fa-githuburl: 'https://github.com/MaoliRUNsen'QQ:icon: fab fa-qqurl: 'http://wpa.qq.com/msgrd?v=1&uin=2953510364&site=ioshenmue&menu=yes'RSS:icon: fas fa-rssurl: /# Table of contents widget configurations# Recommendation links widget configurations-# Where should the widget be placed, left sidebar or right sidebarposition: lefttype: links# Names and URLs of the siteslinks:CSDN: 'https://blog.csdn.net/weixin_44510615'知乎: 'https://www.zhihu.com/people/qian-xiao-28-8'头条: 'https://www.toutiao.com/c/user/2115112815048734/'# Categories widget configurations-# Where should the widget be placed, left sidebar or right sidebarposition: lefttype: categories# Recent posts widget configurations-# Where should the widget be placed, left sidebar or right sidebarposition: righttype: recent_posts# Archives widget configurations-# Where should the widget be placed, left sidebar or right sidebarposition: lefttype: archives# Tags widget configurations-# Where should the widget be placed, left sidebar or right sidebarposition: righttype: tags# https://ppoffice.github.io/hexo-theme-icarus/Configuration/Theme/speed-up-your-site-with-custom-cdn/
providers:# Name or URL template of the JavaScript and/or stylesheet CDN providercdn: jsdelivr# Name or URL template of the webfont CDN providerfontcdn: google# Name or URL of the fontawesome icon font CDN providericoncdn: fontawesome

项目配置

下面是项目的根目录配置

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/# Site
title: 'Python之王'
subtitle: 'Python之王'
description: '人生最重要的不是所站的位置,而是内心所朝的方向。只要我在每篇博文中写得自己体会,修炼身心;在每天的不断重复学习中,耐住寂寞,练就真功,不畏艰难,奋勇前行,不忘初心,砥砺前行,人生定会有所收获,不留遗憾...'
keywords: 'Python, Java, 机器学习, 爬虫, 前端, Spring家族, 人工智能'
author: 'Runsen'
language: zh-CN
timezone: 'Asia/Shanghai'# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://maolirunsen.github.io/
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:
pretty_urls:trailing_index: true # Set to false to remove trailing 'index.html' from permalinkstrailing_html: true # Set to false to remove trailing '.html' from permalinkssearch:path: search.xmlfield: post# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link:enable: true # Open external links in new tabfield: site # Apply to the whole siteexclude: 'default_category'
filename_case: 0
render_drafts: true
post_asset_folder: true
relative_link: true
future: true
highlight:enable: trueline_number: trueauto_detect: truetab_replace: ''wrap: truehljs: true# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:path: ''per_page: 10order_by: -date# Category & Tag
default_category: uncategorized
category_map:
tag_map:# Metadata elements
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
meta_generator: true# 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: YYYY-MM-DD
time_format: HH:mm:ss
## Use post's date for updated date unless set in front-matter
use_date_for_updated: true# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
# include:
# exclude:
# ignore:
#busuanzi:
#  enable: true# ---------------下面选项需要对应插件的支持---------------
# npm install hexo-generator-index --save
# npm install hexo-generator-archive --save
# npm install hexo-generator-category --save
# npm install hexo-generator-tag --savearchive_generator:per_page: 20 ##归档页面默认20篇文章标题yearly: true  ##生成年视图monthly: true ##生成月视图tag_generator:per_page: 10 ##标签分类页面默认10篇文章category_generator:per_page: 10 ###分类页面默认10篇文章# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: icarus# 多说 ShortName
busuanzi:enable: true# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:type: gitrepo: https://github.com/MaoliRUNsen/MaoliRUNsen.github.io.gitbranch: master

写文章

写文章时需要有下面的标志,没有<!-- more -->就不能有阅读全文的标签。
`

---
tags:
- Python环境
categories:
- Python
toc: true
---<!-- more -->
1、 搭建Python的基础环境

下面就是搭建的效果。

https://maolirunsen.github.io/

有个问题就是不知道怎么解析域名,卡了好久了。还有,网站访问比较慢。

四十五、Gtihub+Hexo+icarus搭建自己的博客相关推荐

  1. hexo部署成功但是没效果_使用 Hexo+GitHub 搭建个人免费博客教程(小白向)

    前言 近些年来很多用户都喜欢使用 GitHub Pages 来搭建 Hexo 静态博客网站,其最吸引人的莫过于完全免费使用,并且非常稳定. 虽然搭建时比较麻烦,有点折腾,但是配置完成后,基本不需要操心 ...

  2. 利用 Hexo + Github 搭建自己的博客

    扯在前面 在很久很久以前,一直就想搭建属于自己的一个博客,但由于各种原因,最终都不了了之,恰好最近突然有了兴趣,于是就自己参照网上的教程,搭建了属于自己的博客. 至于为什么要搭建自己的博客了?哈哈,大 ...

  3. 用Hexo动手搭建自己的博客主页

    开始之前先在Github上申请一个账号,并新建一个项目,以username.github.io 格式命名,然后进入settings创建Github Pages,如下图: (图1) (图2) 下面是主要 ...

  4. 猿创征文|Hexo+Github搭建完全免费个人博客详细教程

    前言 完全免费的搭建个人博客,没有任何收费,零基础也能上手,不需要编程基础,跟着操作来即可. 首先: 要了解一下我们搭建博客要用到的框架:Hexo是高效的静态站点生成框架,它基于Node.js.通过H ...

  5. 《逆袭进大厂》第十五弹之智力情景题 | 个人博客

    卷友们好,我是阿秀. 嗯,智力题&情景题终于来了,这次阿秀不再是鸽秀... 其实真不是我不更,主要是最近事情有点多,最近在忙着个人博客和研究生毕业答辩的事情. 搭这个博客主要是因为不止一个小伙 ...

  6. 【Hexo】搭建自己的博客并到Github Pages

    一.什么是Hexo 用Hexo官网的介绍https://hexo.io/zh-cn/docs/,Hexo是一个快速.简捷且高效的博客框架.Hexo使用Markdown解析文章,可以在很短的时间内生成静 ...

  7. 【教程】Hexo+Coding搭建自己的博客网站系列5-Next6.7版本主题深度美化

    在我进行主题优化的时候,参考了网上很多文章,但是随着Next版本的变迁,越来越多个性化设置已经被集成到Next中.所以我写了这篇关于Next6.7版本主题优化的方案.有时间和精力的话,这篇文章也会随着 ...

  8. 四十二、Scrapy爬取csdn的博客标题和网址

    @Author:Runsen 每天一爬虫,健康生活每一天. 今天使用Scrapy爬下CSDN的文章的url 目标:爬取CSDN的各类文章的url,简单使用scrapy 来爬取 创建的Scrapy项目如 ...

  9. 四十四、Hexo搭建自己的博客

    最近看了大佬 利用 GitHub 从零开始搭建一个博客文章,解决好久卡在自己的问题,那时看了极客的git课程还是很多问题,找了很多教程,发现都不太全,直到看到 https://mp.weixin.qq ...

最新文章

  1. Windows Azure Storage (25) Azure Append Blob
  2. AI开源评测基准AI-Rank,为开源建立标准
  3. 【教程】1、加载静态内容
  4. centos7安装ftp_python 编译安装
  5. java中哪个是main函数的合法参数,Java试卷及答案
  6. 关于左右滚动,控制某几列不动
  7. Spark _03RDD_Transformations_Action_使用scalajavaAPI
  8. Web前端开发笔记——第四章 JavaScript程序设计 第四节 条件语句和循环语句
  9. 重定向 12 21 解析
  10. 7-5 两个有序链表序列的合并 (20 分)
  11. upper_bound和lower_bound的用法
  12. 普元 AppServer 7.0 如何添加第三方jar到AppServer里?
  13. 蔬菜水果生鲜电商购物网站模板源码下载
  14. 大学生竞赛管理系统项目
  15. Vue响应式声明渲染机制
  16. MySQL数据库——数据完整性(实体完整性、域完整性、参照完整性)
  17. Android 开发 | App 工程目录结构
  18. 深度 | 5分钟读懂阿里零售通智慧供应链平台
  19. 动手学PyG(三):PyG中的mini-batches
  20. 《jetson系列刷机指南》

热门文章

  1. 通信 / SSH介绍和使用,SSH key教程
  2. 诸神战纪2java_诸神战纪2死神归来
  3. php 框架获取服务器,Thinkphp 框架基础之源码获取、环境要求与目录结构分析
  4. 金融运营智能化搞不定?百度智能云有妙方
  5. python基础知识05-控制流程
  6. [Android] QPST,解BL锁,刷Recovery,备份系统,root,刷框架.
  7. Linux 查看和删除进程
  8. VHDL操作运算符的优先级顺序
  9. ibatis.net:第五天,QueryForObject
  10. loj 1210 (求最少的加边数使得图变成强连通)