hexo+icarus博客搭建记录
环境准备
Hexo初始化项目
1 2 3
| $ hexo init myblog $ cd myblog $ yarn
|
查看效果
更换Icarus 主题
在myblog目录中下载 Icarus 主题代码。
1
| git clone git@github.com:ppoffice/hexo-theme-icarus.git /themes/icarus
|
之后修改_config.yml文件,将theme修改为icarus
文章样例
1 2 3 4 5 6 7 8 9 10 11 12 13
| --- title: hexo+icarus博客搭建 date: 2023-11-29 18:39:50 categories: 技术分享 tags: hexo id: 1 toc: true thumbnail: '/img/code.jpg' cover: '/img/code.jpg' --- 简介 <!--more>> 正文
|
部署
在 _config.yml
中配置仓库地址
1 2 3 4
| deploy: type: git repo: git@{服务器地址}:/home/git/blog.git branch: master
|
快速部署执行 npm hexo d
主题自定义
1、yml配置&详细说明
2、更换logo
3、文章相关配置
添加摘要、阅读更多
添加分享工具:AddToAny
添加版权声明
发表时间修改
添加默认主图
文章详情三栏边两栏
修改文章访问路径
文章目录
文章添加密码:npm install hexo-blog-encrypt
4、插件安装
评论
采用的是valine,具体配置详见官方文档。
网站访问统计
捐赠
广告
提醒用户cookies的使用
黑暗模式
5、增加友链、留言板
6、CDN资源
配置详解
修改配置文件 _config.yml
和 _config.icarus.yml
,配置网站相关信息。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
|
title: 程序员米七
subtitle: 程序员米七
description: 分享点有用的
keywords: null
author: 米七
language: zh-CN
timezone: Asia/Shanghai
url: http://mi7.net
permalink: '/pages/:title/'
permalink_defaults: null
pretty_urls: trailing_index: true trailing_html: true
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: ':lang'
skip_render: 404.html
new_post_name: ':title.md'
default_layout: post
titlecase: true external_link: enable: true field: site exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true syntax_highlighter: highlight.js
highlight: enable: true line_number: true auto_detect: false tab_replace: '' wrap: true hljs: false
prismjs: enable: false preprocess: true line_number: true tab_replace: '' index_generator: path: '' per_page: 10 order_by: '-date'
default_category: uncategorized
category_map: null
tag_map: null meta_generator: true
date_format: YYYY-MM-DD
time_format: HH:mm:ss
updated_option: mtime
per_page: 10
pagination_dir: page
include: null
exclude:
ignore:
theme: icarus
deploy: type: git repo: git@你的服务器地址:/home/git/blog.git branch: master
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418
|
version: 5.1.0
variant: default
logo: /img/logo.jpg
head: favicon: /img/favicon.svg manifest: name: 程序员米七 short_name: 程序员米七 start_url: https://mi7.net theme_color: background_color: display: standalone icons: - src: '' sizes: '' type: open_graph: title: mi7net type: blog url: https://mi7.net/ image: site_name: author: description: twitter_card: twitter_id: twitter_site: google_plus: fb_admins: fb_app_id: structured_data: title: description: url: author: publisher: publisher_logo: image: meta: - '' rss: atom.xml
navbar: menu: 首页: / 文章归档: /archives 分类: /categories 标签: /tags 留言: /message 关于: /about
footer: links: 知识共享: icon: fab fa-creative-commons url: 'https://creativecommons.org/' CC BY-NC 4.0: icon: fab fa-creative-commons-by url: 'https://creativecommons.org/licenses/by-nc/4.0/deed.zh' Download on Gitee: icon: fab fa-git-square url: 'https://gitee.com/wuchao321'
article: highlight: theme: atom-one-light clipboard: true fold: unfolded readtime: true licenses: Creative Commons: icon: fab fa-creative-commons url: 'https://creativecommons.org/' Attribution: icon: fab fa-creative-commons-by url: 'https://creativecommons.org/licenses/by-nc/4.0/' Noncommercial: icon: fab fa-creative-commons-nc url: 'https://creativecommons.org/licenses/by-nc/4.0/'
search: type: insight
comment: type: valine app_id: iCu4v9Qxxxxxxxx app_key: ENtPhFixxxx placeholder: "欢迎留言交流~" avatar: monsterid avatar_force: false meta: ["nick", "mail", "link"] page_size: 10 lang: zh-CN visitor: true highlight: true record_ip: false server_urls: emoji_cdn: emoji_maps: enable_qq: false required_fields: []
donates: - type: alipay qrcode: '/img/alipay.jpg' - type: wechat qrcode: '/img/wechatpay1.jpg'
share: type: addtoany install_url: ''
sidebar: left: sticky: false right: sticky: true
widgets: - position: left type: profile author: 程序员米七 author_title: 专注AI、全栈开发、个人成长分享~ location: 中国·北京 avatar: /img/avatar1.jpg avatar_rounded: true gravatar: follow_link: 'https://gitee.com/mi7coder' social_links: Gitee: icon: fab fa-git-square url: 'https://gitee.com/mi7coder' Email: icon: fa fa-envelope url: 'mailto:mi7coder@gmail.com' Weibo: icon: fab fa-weibo url: '' WeiXin: icon: fab fa-weixin url: '' - position: left type: toc index: true collapsed: true depth: 3 - position: left type: links links: Hexo: 'https://hexo.io' Gitee: 'https://gitee.com/wuchao321' - position: right type: categories - position: right type: recent_posts - position: right type: archives - position: right type: tags
plugins: animejs: true back_to_top: true baidu_analytics: tracking_id: bing_webmaster: tracking_id: busuanzi: true cnzz: id: web_id: gallery: true google_analytics: tracking_id: hotjar: site_id: katex: false mathjax: false outdated_browser: false progressbar: true statcounter: project: security: twitter_conversion_tracking: pixel_id:
providers: cdn: jsdelivr fontcdn: google iconcdn: fontawesome encrypt: enable: true
|