600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > github pages + Hexo + 域名绑定搭建个人博客增强版

github pages + Hexo + 域名绑定搭建个人博客增强版

时间:2023-01-25 05:04:19

相关推荐

github pages + Hexo + 域名绑定搭建个人博客增强版

概述

前面我们用github pages + Hexo 搭建了一个简单版的个人博客系统,但是里面的内容单调,很多功能不够完善,所以我们需要对yelle 的主题进行优化和完善。基本搭建请访问:/xiangzhihong8/article/details/53355036

主题配置介绍

从中我们也可以看出,对于主题来讲,大部分可以配置的地方其实都是在这里的。所以我们需要了解一个基本的主题样式。

duoshuo,如果你是打算采用多说评论系统的话,你需要设置这里,但是我个人对多说没好印象youyan,有言也是国内实用比较多的评论系统之一,个人感觉相对比较稳定open_in_new,我个人觉得这个东西就应该是 true,不是用新标签的都是坏人baidu_tongji,我个人使用的是百度统计,具体百度统计的使用可以查看百度统计官网:。

yelle主题完整配置

# Theme Version | 当前版本Yelee: "3.5"# >>> Basic Setup | 基础设置 <<<# Header | 主菜单## About Page: `hexo new page about`## Tags Cloud Page: `hexo new page tags`menu:主页: /所有文章: /archives/#随笔: /tags/随笔标签云: /tags/关于我: /about/# Link to your avatar | 填写头像地址avatar: http://ohe65w0xx./avert.png# Small icon of Your site | 站点小图标地址favicon: /favicon.png# Internationalization | 主题语言## Change Language in SITE's _config.yml | 在站点配置中切换语言## https://hexo.io/docs/internationalization.html## Available Languages: en, zh-Hans, zh-Hant-TW, zh-Hant-HK# Subdirectory | 子目录## If your site' url is '/blog', set root_url as '/blog/'## 网站若存放在子目录,请按上面格式填写## https://hexo.io/docs/configuration.html#URLroot_url: # Year of Site Creation | 网站成立年份since: # Social info. Bar | 社交信息展示## Keep "mailto:" in Email | 设置 Email 时保留 "mailto:"## Encrypt email 加密邮件地址 /encode/## RSS requires a plugin to take effect | 使用 RSS 需先安装对应插件## /hexojs/hexo-generator-feedsubnav:Email: "1044817967@"#新浪微博: "sina weibo"GitHub: "/xiangzhihong/"#V2EX: "#"RSS: "/atom.xml"#知乎: "zhihu"#豆瓣: "douban"#简书: "jianshu"#SegmentFault: ""#博客园: "cnblogs"CSDN: "/xiangzhihong8/"#Coding: ""#网易云音乐: "netease"#虾米音乐: "xiami"#bilibili: ""#AcFun: ""#niconico: ""#Quora: ""#Facebook: "#"#Google: "#"#Twitter: "#"#LinkedIn: "#"#QQ: "1044817967"#微信: "Wechat"#PayPal: "#"#StackOverflow: "#"#CodePen: ""#Plunker: ""#Instagram: "#"#LOFTER: ""#Flickr: "#"#reddit: ""#Medium: ""#TiddlyWiki: ""#Tumblr: ""#_500px: ""# >>> Conments 评论系统 <<<# Chose ONE as your comment system and keep others disable.# 选一个作为网站评论系统,其他保持禁用。preload_comment: true## false: 当点击评论条等区域时再加载评论模块## false: load comment's section until u click/hover on the bar/iconshow_count: false## 是否在主页文章标题旁显示评论数(多说、Disqus)## Add comment count after article titledisqus: #on: trueshortname: # /customer/en/portal/articles/466208-what-s-a-shortname-# It is unnecessary to enable disqus here if # you have set "disqus_shortname" in your site's "_config.yml" duoshuo: #on: truedomain: # 是否开启多说评论,/create-site/# 使用上面网址登陆你的多说,然后创建站点,在 domain 中填入你设定的域名前半部分# http://<要填的部分>. (domain只填上<>里的内容,不要填整个网址)youyan:on: trueid: 2120654# 是否开启友言评论,/index.php# id 中填写你的友言用户数字ID,注册后进入后台管理即可查看# 友言服务在 Web 环境下运行,普通本地环境无法查看,请部署后在线上测试。# >>> Style Customisation 样式自定义 <<<# Background | 背景## "5": show images form bg-1.jpg to bg-5.jpg in `/yelee/source/background/`## "5": 显示`/yelee/source/background/`文件夹中 bg-1.jpg 到 bg-5.jpg 这5张图片## "0": white-gray background | 淳朴灰白背景background_image: 5# Base Font Size | 字号调节base_font_size: 16 #px, 16 - 24## General Color Scheme | 主题配色方案 ## 可用值 Value: yiliacolor_scheme: highlight_style:#on: trueinline_code: 3 # Value: 0 - 9 可选code_block: 2 # Value: 0 - 4 # Set inline_code to style highlight text# Chose a highlight theme for code block# 通过 inline_code 切换内置文本高亮样式# 通过 code_block 切换内置代码高亮配色主题blockquote_style:on: trueblockquote: 1 # Value: 0 - 7 可选# 自定义文章「引用部分」的样式# Headings Style | 标题风格## 0-Yelee, 1-Yilia, 2-GitHubheading_style: 0 # Value: 0 - 2## List style type (ul) | 无序列表项标记样式list_style: 0 # value: 0 - 12 可选# 左边栏宽度 pxleft_col_width: 300# Copyright info. of post | 文末版权信息copyright: true# Table of contents | 文章目录toc:on: truelist_number: true # 目录序号max_depth: 3 # 1 - 6 (h1-h6) 目录最大级数nowrap: false # Keep title on same line | 目录标题不换行# 是否开启主页及加载头像时的动画效果# Animation in Homepage and Loading avataranimate: true# Load jQuery UI to style tooltips# 工具提示框样式美化jquery_ui: false# Max width of right cloumn | 限制右侧内容的宽带 limit_article_width: on: falsemax_width: 60 # em# >>> Small features | 小功能设置 <<<# 是否开启边栏多标签切换# Birdhouse button in left columntagcloud: true# Blogroll, Link exchange | 友情链接friends:Blog: /GitHub: /MOxFIVE: http://moxfive.xyz/#friends: false#是否开启“关于我”。aboutme: 专注于前端#aboutme: false# Open link in a new tab | 是否在新窗口打开链接## `global` 0: Set separately, 1: Open all in new 2: Open all in current## `global` 0: 分开设置, 1: 全部在新标签打开, 2: 全部在"当前"标签打开open_in_new:global: 0 # 0-2title: false # article title in homepage 主页文章标题post: false # link within post/page 正文中的链接tags: false # 标签categories: false # 分类article_nav: false # 导航archives: true # 归档mini_archives: true # 迷你归档menu: false # 边栏菜单friends: true # 友情链接socail: true # 社交图标# Customize feed link 自定义订阅地址rss: /atom.xml# Update Reminder for IE6/7/8# 针对 IE6/7/8 的升级浏览器提示ie_updater:on: truelink: ///## /## /# Tab Title Change | 标签页标题切换tab_title_change: on: falseleft_tab_title: '(つェ⊂) 我藏好了哦~ 'return_tab_title: '(*´∇`*) 被你发现啦~ '# >>> Vendors | 第三方工具 & 服务 <<<# Local Site Search | 本地站内搜索## Insatall below plugin to take effect | 使用搜索需先安装对应插件## /PaicHyperionDev/hexo-generator-searchsearch: #on: trueonload: false## true: get search.xml file when the page has loaded## false: get the file when search box gets focus# images viewer | 图片浏览器## /fancybox/fancybox: true# Display Math(LaTeX, MathML...) | 数学公式支持## /mathjax: false# Socail Share | 是否开启分享share: on: truebaidu: trueaddthis: falseaddthis_pubid: "ra-56ff76c972fc0cf9"## Go to /dashboard to get your pubid (in src of Code)## and customize AddThis share buttons# 百度、谷歌站长验证。填写 HTML 标签 content# Site Verification for Google and Baidu. HTML label content.baidu_site: google_site: # Fill in Google Analytics tracking ID, #e.g. UA-XXXXX-Xgoogle_analytics: # 百度统计 /sc-web/# 查看代码,填入 ///hm.js? 之后的内容baidu_tongji: # 不蒜子网站计数设置# http://ibruce.info//04/04/busuanzi/visit_counter:on: truesite_visit: truepage_visit: true# GitHub Repo Widget# /hustcc/GitHub-Repo-Widget.jsgithub_widget: false# Progress Bar | 页面加载进度条# Demo: /pace/docs/welcome/# type: barber-shop|big-counter|bounce|center-atom|center-circle|# center-radar|center-simple|corner-indicator|flash|flat-top|# loading-bar|mac-osx|minimal# color: black|blue|green|orange|pink|purple|red|silver|white|yellow|progressBar:on: truetype: "minimal" # Keep Quotes | 保留引号避免出错color: blueCDN:jquery: ///jquery/2.2.4/jquery.min.jsrequire: ///require.js/2.2.0/require.min.jsfontawesome: ///font-awesome/4.6.3/css/font-awesome.min.cssfancybox_js: ///fancybox/2.1.5/jquery.fancybox.min.jsfancybox_css: ///fancybox/2.1.5/jquery.fancybox.min.cssanimate_css: ///animate.css/3.5.1/animate.min.cssjquery_ui_js: ///jqueryui/1.10.4/jquery-ui.min.jsjquery_ui_css: ///jqueryui/1.10.4/css/jquery-ui.min.csspace_js: ///pace/1.0.2/pace.min.jsclipboard: ///clipboard.js/1.5.10/clipboard.min.jsmathjax: ///mathjax/2.6.1/MathJax.jsscrollreveal: ///scrollReveal.js/3.1.4/scrollreveal.min.js

添加常用页面

首先定位到我们的本地的blog项目,如我存放的位置是E:\blog\blog

新增一个 404 页面:hexo new page 404新增一个 about 页面:hexo new page about新增一个 tag 标签云页面:hexo new page tags新增一个 robot.txt 文件,把该文件放在:E:\blog\blog\hexo\source 目录下,robot 文件内容

User-Agent: *Allow: /Disallow: /backgroundDisallow: /cssDisallow: /fancyboxDisallow: /font-awesomeDisallow: /imgDisallow: /jsSitemap: /sitemap.xmlSitemap: /baidusitemap.xml

其他插件推荐

插件的基本使用命令

插件官网:https://hexo.io/plugins/

安装插件:npm install 插件名 –save

卸载插件:npm uninstall 插件名

更新插件和博客框架(需要在 E:\blog_space\hexo 目录下):npm update

注:插件的管理实质上是通过项目根目录下 package.json 文件更来管理各大插件。

必备插件

支持RSS:npm install hexo-generator-feed –save生成站点地图:npm install hexo-generator-sitemap –save生成百度站点地图:npm install hexo-generator-baidu-sitemap –saveHTML 压缩:npm install hexo-html-minifier –saveJavaScript 压缩:npm install hexo-uglify –saveCSS 压缩插件:npm install hexo-clean-css –saveSEO优化:npm install hexo-generator-seo-friendly-sitemap

添加文章抬头信息

Hexo默认新建的文章抬头已有title、date、tags等属性,可能缺乏categories和meta标签,想要指定目录就需要添加categories属性,而meta标签则是为了便于搜索引擎的收录。想要修改的话,可以打开D:\Hexo\scaffolds\post.md(这是你clone下来的地址)文件在里面添加。

title: #文章标题date: #时间,一般不用改categories: #目录分类tags: #标签,格式可以是[Hexo,总结],中间用英文逗号分开keywords: #文章关键词,多个关键词用英文逗号隔开

文章图片的存放

想要在文章中插入图片的话,可以按照Markdown语法来插入,格式为。图片的存放有两种方式:在本地D:\Hexo\source目录下新建一个存放图片的文件夹,比如images,然后把想要插入的图片放在里面,插入图片的路径;第二种方法是把图片上传到网络,然后插入图片路径。推荐使用第二种,比如百度云,七牛等。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。