前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >如何使用github hexo git vercel搭建博客<重制版 上>

如何使用github hexo git vercel搭建博客<重制版 上>

作者头像
Wlog
发布2022-03-30 17:25:06
3390
发布2022-03-30 17:25:06
举报
文章被收录于专栏:Wlog

如何使用github+hexo+git+vercel弄一个hexo博客<重制版 上

为什么又出来了一个 因为上一个太烂 估计看那个教程的都不行

准备

git 电脑 vercel账号 github账号

vercel其实不用搞 他只是加速的

开始

在随便一个盘符 新建一个文件夹 进入文件夹 右键 选择 github bash here 之后最小化 不用管他 前往这里下载node 安装后 在github bash里输入

代码语言:javascript
复制
node -v
npm -v

显示正常 不报错 证明安装成功 之后安装hexo

代码语言:javascript
复制
npm install -g hexo-cli

安装完之后输入

代码语言:javascript
复制
hexo -v

我的是手机 可能会不一样

img
img

显示正常 没报错就是安装好了 之后输入

代码语言:javascript
复制
hexo init
npm install

稍等一会 因为我的手机npm不能用了 这里我就用cnpm

img2
img2

这个教程就到一半了 hexo最重要的就是主题了 这里我用yilia 因为他简洁 你想用其他的也是可以的 在博客主目录输入

代码语言:javascript
复制
git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia

弄好之后 我先歇会

你还真翻了

那我们继续 cd到博客根目录

代码语言:javascript
复制
apt install nano

安装nano

代码语言:javascript
复制
nano _config.yml

应该是这样的

代码语言:javascript
复制
# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html## Source: https://github.com/hexojs/hexo/# Sitetitle: Hexosubtitle: ''description: ''keywords:author: John Doelanguage: entimezone: ''# URL## If your site is put in a subdirectory, set url as 'http://example.com/child' and root as '/child/'url: http://example.comroot: /permalink: :year/:month/:day/:title/permalink_defaults:pretty_urls:  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks  trailing_html: true # Set to false to remove trailing '.html' from permalinks# Directorysource_dir: sourcepublic_dir: publictag_dir: tagsarchive_dir: archivescategory_dir: categoriescode_dir: downloads/codei18n_dir: :langskip_render:# Writingnew_post_name: :title.md # File name of new postsdefault_layout: posttitlecase: false # Transform title into titlecaseexternal_link:  enable: true # Open external links in new tab  field: site # Apply to the whole site  exclude: ''filename_case: 0render_drafts: falsepost_asset_folder: falserelative_link: falsefuture: truehighlight:  enable: true  line_number: true  auto_detect: false  tab_replace: ''  wrap: true  hljs: falseprismjs:  enable: false  preprocess: true  line_number: true  tab_replace: ''# 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: 10  order_by: -date# Category & Tagdefault_category: uncategorizedcategory_map:tag_map:# Metadata elements## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/metameta_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-DDtime_format: HH:mm:ss## updated_option supports 'mtime', 'date', 'empty'updated_option: 'mtime'# Pagination## Set per_page to 0 to disable paginationper_page: 10pagination_dir: page# Include / Exclude file(s)## include:/exclude: options only apply to the 'source/' folderinclude:exclude:ignore:# Extensions## Plugins: https://hexo.io/plugins/## Themes: https://hexo.io/themes/theme: landscape# Deployment## Docs: https://hexo.io/docs/one-command-deploymentdeploy:  type: ''

这里简单弄下 修改 theme: landscape 改成 theme: yilia deployment选项卡 改成

代码语言:javascript
复制
# Deployment
## Docs: https://hexo.io/docs/deployment.htmldeploy:  type: gitrepo: https://github.com/YourGithubName/YourGithubName.github.io.git  branch: master

这里先写到这里

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020-09-03,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 如何使用github+hexo+git+vercel弄一个hexo博客<重制版 上
    • 准备
      • 开始
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档