-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4668.html
19 lines (19 loc) · 29.2 KB
/
4668.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=2"><meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.0.0"><link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png"><link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png"><link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png"><link rel="mask-icon" href="/images/logo.svg" color="#222"><link rel="stylesheet" href="/css/main.css"><link rel="stylesheet" href="/lib/font-awesome/css/all.min.css"><link rel="stylesheet" href="/lib/pace/pace-theme-material.min.css"><script src="/lib/pace/pace.min.js"></script><script id="hexo-configurations">var NexT=window.NexT||{},CONFIG={hostname:"lingchenblog.tk",root:"/",scheme:"Pisces",version:"7.8.0",exturl:!1,sidebar:{position:"left",display:"post",padding:18,offset:12,onmobile:!1},copycode:{enable:!0,show_result:!0,style:"default"},back2top:{enable:!0,sidebar:!1,scrollpercent:!0},bookmark:{enable:!0,color:"#222",save:"auto"},fancybox:!1,mediumzoom:!1,lazyload:!1,pangu:!1,comments:{style:"tabs",active:null,storage:!0,lazyload:!1,nav:null},algolia:{hits:{per_page:10},labels:{input_placeholder:"Search for Posts",hits_empty:"We didn't find any results for the search: ${query}",hits_stats:"${hits} results found in ${time} ms"}},localsearch:{enable:!1,trigger:"auto",top_n_per_article:1,unescape:!1,preload:!1},motion:{enable:!0,async:!1,transition:{post_block:"fadeIn",post_header:"slideDownIn",post_body:"slideDownIn",coll_header:"slideLeftIn",sidebar:"slideUpIn"}}}</script><meta name="description" content="我相信许多人有着想建一个属于自己的博客的想法,接下来我就来讲讲如何在 Github 上部署 Hexo 作为博客。本次安装环境为 Windows 10。"><meta property="og:type" content="article"><meta property="og:title" content="2020年将 Hexo 部署到 Github 上作为免费博客"><meta property="og:url" content="http://lingchenblog.tk/4668.html"><meta property="og:site_name" content="凌晨blog"><meta property="og:description" content="我相信许多人有着想建一个属于自己的博客的想法,接下来我就来讲讲如何在 Github 上部署 Hexo 作为博客。本次安装环境为 Windows 10。"><meta property="og:locale" content="zh_CN"><meta property="article:published_time" content="2020-04-25T08:10:00.000Z"><meta property="article:modified_time" content="2020-05-09T03:46:37.000Z"><meta property="article:author" content="凌晨"><meta property="article:tag" content="Hexo"><meta name="twitter:card" content="summary"><link rel="canonical" href="http://lingchenblog.tk/4668.html"><script id="page-configurations">CONFIG.page={sidebar:"",isHome:!1,isPost:!0,lang:"zh-CN"}</script><title>2020年将 Hexo 部署到 Github 上作为免费博客 | 凌晨blog</title><noscript><style>.sidebar-inner,.use-motion .brand,.use-motion .collection-header,.use-motion .comments,.use-motion .menu-item,.use-motion .pagination,.use-motion .post-block,.use-motion .post-body,.use-motion .post-header{opacity:initial}.use-motion .site-subtitle,.use-motion .site-title{opacity:initial;top:initial}.use-motion .logo-line-before i{left:initial}.use-motion .logo-line-after i{right:initial}</style></noscript></head><script src="/live2d-widget/autoload.js"></script><body itemscope itemtype="http://schema.org/WebPage"><div class="container use-motion"><div class="headband"></div><header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="header-inner"><div class="site-brand-container"><div class="site-nav-toggle"><div class="toggle" aria-label="切换导航栏"><span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span></div></div><div class="site-meta"><a href="/" class="brand" rel="start"><span class="logo-line-before"><i></i></span><h1 class="site-title">凌晨blog</h1><span class="logo-line-after"><i></i></span></a></div><div class="site-nav-right"><div class="toggle popup-trigger"></div></div></div><nav class="site-nav"><ul id="menu" class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li><li class="menu-item menu-item-commonweal"><a href="/404/" rel="section"><i class="fa fa-heartbeat fa-fw"></i>公益 404</a></li></ul></nav></div></header><div class="back-to-top"><i class="fa fa-arrow-up"></i> <span>0%</span></div><div class="reading-progress-bar"></div><a role="button" class="book-mark-link book-mark-link-fixed"></a> <a href="https://github.com/xulingran" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin:130px 106px" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><main class="main"><div class="main-inner"><div class="content-wrap"><div class="content post posts-expand"><article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN"><link itemprop="mainEntityOfPage" href="http://lingchenblog.tk/4668.html"><span hidden itemprop="author" itemscope itemtype="http://schema.org/Person"><meta itemprop="image" content="/images/ywy_bg.jpg"><meta itemprop="name" content="凌晨"><meta itemprop="description" content="永远相信美好的事情即将发生"></span><span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><meta itemprop="name" content="凌晨blog"></span><header class="post-header"><h1 class="post-title" itemprop="name headline">2020年将 Hexo 部署到 Github 上作为免费博客</h1><div class="post-meta"><span class="post-meta-item"><span class="post-meta-item-icon"><i class="far fa-calendar"></i> </span><span class="post-meta-item-text">发表于</span> <time title="创建时间:2020-04-25 16:10:00" itemprop="dateCreated datePublished" datetime="2020-04-25T16:10:00+08:00">2020-04-25</time> </span><span class="post-meta-item"><span class="post-meta-item-icon"><i class="far fa-calendar-check"></i> </span><span class="post-meta-item-text">更新于</span> <time title="修改时间:2020-05-09 11:46:37" itemprop="dateModified" datetime="2020-05-09T11:46:37+08:00">2020-05-09</time> </span><span class="post-meta-item"><span class="post-meta-item-icon"><i class="far fa-folder"></i> </span><span class="post-meta-item-text">分类于</span> <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Hexo/" itemprop="url" rel="index"><span itemprop="name">Hexo</span></a> </span></span><span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display:none"><span class="post-meta-item-icon"><i class="fa fa-eye"></i> </span><span class="post-meta-item-text">阅读次数:</span> <span id="busuanzi_value_page_pv"></span></span></div></header><div class="post-body" itemprop="articleBody"><blockquote><p>我相信许多人有着想建一个属于自己的博客的想法,接下来我就来讲讲如何在 Github 上部署 Hexo 作为博客。<br>本次安装环境为 Windows 10。</p></blockquote><span id="more"></span><h1 id="配置-Hexo"><a href="#配置-Hexo" class="headerlink" title="配置 Hexo"></a>配置 Hexo</h1><h2 id="安装-Node-js"><a href="#安装-Node-js" class="headerlink" title="安装 Node.js"></a>安装 Node.js</h2><p>在 Node.js 官网下载 <strong>LTS</strong> 版本(<a target="_blank" rel="noopener" href="https://nodejs.org/en/">点击跳转</a>)。在写本篇文章时 Node.js 版本为 <em>12.16.2</em>。下载后直接打开安装包,全程无脑下一步。完成后在 CMD 中输入</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm -v</span><br></pre></td></tr></table></figure><p>来确认版本。</p><h2 id="安装-Git"><a href="#安装-Git" class="headerlink" title="安装 Git"></a>安装 Git</h2><p>在 Git 的官网下载(<a target="_blank" rel="noopener" href="https://git-scm.com/downloads">点击跳转</a>)。在写本篇文章时 Git 版本为 <em>2.26.2</em> 。依旧无脑下一步。<br>安装完成后在 CMD 中输入</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git --version</span><br></pre></td></tr></table></figure><p>来查验 Git 是否安装成功。</p><h2 id="将-npm-源更换为阿里源(可选)"><a href="#将-npm-源更换为阿里源(可选)" class="headerlink" title="将 npm 源更换为阿里源(可选)"></a>将 npm 源更换为阿里源(可选)</h2><p><strong>注意:若本步您未选择更换源,则请将后续的所有<code>cnpm</code>命令更改为<code>npm</code>。</strong><br>输入命令,将源更换为阿里源。</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm config <span class="built_in">set</span> registry https://registry.npm.taobao.org</span><br></pre></td></tr></table></figure><p>验证是否更换成功,若返回<code>https://registry.npm.taobao.org</code>,说明镜像配置成功。</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm config get registry</span><br></pre></td></tr></table></figure><p>安装 cnpm(若不换源,可无视)</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install -g cnpm --registry=https://registry.npm.taobao.org</span><br></pre></td></tr></table></figure><h2 id="下载-Hexo"><a href="#下载-Hexo" class="headerlink" title="下载 Hexo"></a>下载 Hexo</h2><p>在硬盘中新建一个文件夹用来放 Hexo ,这里我选择在D盘新建 blog 文件夹来存放 Hexo 文件。在打开 blog 文件夹后,右键选中 Git Bash Here ,在打开的窗口中输入</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cnpm install -g hexo-cli</span><br></pre></td></tr></table></figure><p>在完成后,输入</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo init</span><br></pre></td></tr></table></figure><p>在文件夹中安装 Hexo 。这一步可能需要较长时间,所以请耐心等候。<br>完成后依次输入(分别为生成文件和启动服务)</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo g</span><br></pre></td></tr></table></figure><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo s</span><br></pre></td></tr></table></figure><p>执行完成后,你就可以访问(<a target="_blank" rel="noopener" href="http://localhost:4000/">http://localhost:4000</a>)来看看 Hexo 的效果了</p><h1 id="主题下载"><a href="#主题下载" class="headerlink" title="主题下载"></a>主题下载</h1><p>笔者比较喜欢以下两种主题,因精力有限,故仅选择 NexT 为示例安装。若有兴趣,亦可下载 Ayer 研究。<em><strong>事实上,因 Ayer 主题为国人开发,主题内的<code>_config.yml</code>也有中文注释,所以相对来讲Ayer更适合初学者,也更容易配置些。</strong></em>在 blog 文件夹中,用 Git Bash 执行下面的命令。</p><h2 id="NexT"><a href="#NexT" class="headerlink" title="NexT"></a>NexT</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">clone</span> https://github.com/theme-next/hexo-theme-next themes/next</span><br></pre></td></tr></table></figure><h2 id="Ayer"><a href="#Ayer" class="headerlink" title="Ayer"></a>Ayer</h2><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">clone</span> https://github.com/Shen-Yu/hexo-theme-ayer.git themes/ayer</span><br></pre></td></tr></table></figure><p>完成后在 blog 下的<code>_config.yml</code>中将<code>Theme</code>后的值更改为主题的名字 ,并重新生成。<br><strong>注意:冒号后必须要有一个空格</strong>。例如我这里用的是 NexT 主题,所以就将值改为<code>theme: next</code>。<em>注:theme后的值为主题文件夹的名字</em></p><h1 id="配置-Github"><a href="#配置-Github" class="headerlink" title="配置 Github"></a>配置 Github</h1><h2 id="注册一个-Github-账号"><a href="#注册一个-Github-账号" class="headerlink" title="注册一个 Github 账号"></a>注册一个 Github 账号</h2><p>没什么好说的,注册就好了。</p><h2 id="新建一个-Repositories"><a href="#新建一个-Repositories" class="headerlink" title="新建一个 Repositories"></a>新建一个 Repositories</h2><p>新建一个名称为<code>【你的 Github 用户名】.github.io</code>的 Repositories 。注意 Repositories 的名称只能为<code>【你的 Github 用户名】.github.io</code>。不然后续很麻烦。也由此可得一个账户只能创建一个网站。就是说如果你的 Github 用户名为<code>example</code>,那么你的 Repositories 的名字就是 <code>example.github.io</code>。</p><h1 id="配置SSH"><a href="#配置SSH" class="headerlink" title="配置SSH"></a>配置SSH</h1><p>在<code>Git Bash</code>中依次输入以下代码(<code>yourname</code>改为GitHub用户名,<code>youremail</code>改为GitHub的注册邮箱)</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.name "yourname"</span><br></pre></td></tr></table></figure><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.email "youremail"</span><br></pre></td></tr></table></figure><h2 id="查看-SSH-密钥"><a href="#查看-SSH-密钥" class="headerlink" title="查看 SSH 密钥"></a>查看 SSH 密钥</h2><p>查看<code>C:\Users\你的系统用户名\</code>下是否有<code>.ssh</code>文件夹,如果没有,则执行</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh-keygen -t rsa -C <span class="string">"你的邮件地址"</span></span><br></pre></td></tr></table></figure><p>来获取 SSH 密钥。完成后进入<code>C:\Users\你的系统用户名\.ssh</code>中复制<code>id_rsa.pub</code>文件中的全部内容。</p><h2 id="在-GitHub-中配置-SSH-密钥"><a href="#在-GitHub-中配置-SSH-密钥" class="headerlink" title="在 GitHub 中配置 SSH 密钥"></a>在 GitHub 中配置 SSH 密钥</h2><p>在 <a target="_blank" rel="noopener" href="https://github.com/">GitHub首页</a> 的右上角进入个人设置(Settings),后找到<code>SSH and GPG keys</code>,点击<code>New SSH key</code>,将之前复制的内容粘贴到<code>Key</code>框中,点击<code>Add SSH key</code>,输入密码即可。</p><h2 id="检查-SSH-配置是否成功"><a href="#检查-SSH-配置是否成功" class="headerlink" title="检查 SSH 配置是否成功"></a>检查 SSH 配置是否成功</h2><p>在 CMD 中输入:</p><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh -T [email protected]</span><br></pre></td></tr></table></figure><p>查看状态。返回<code>Are you sure you want to continue connecting (yes/no)?</code>后输入 yes 并回车。若返回<code>Hi 你的GitHub用户名! You've successfully authenticated, but GitHub does not provide shell access.</code><br>则表示 SSH 密钥配置成功!</p><h2 id="上传到-GitHub"><a href="#上传到-GitHub" class="headerlink" title="上传到 GitHub"></a>上传到 GitHub</h2><p>在 GitHub 的刚才创建的 Repositories 中拷贝 SSH 链接,在 blog 文件夹下的<code>_config.yml</code>中找到<code>deploy</code>并做以下配置。<strong>冒号后要有空格</strong>。</p><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">deploy:</span><br><span class="line"> <span class="built_in">type</span>: git</span><br><span class="line"> repo: </span><br><span class="line"> Github: 这里填入刚刚复制的地址</span><br><span class="line"> branch: master</span><br></pre></td></tr></table></figure><p>比如我的就是</p><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">deploy:</span><br><span class="line"> <span class="built_in">type</span>: git</span><br><span class="line"> repo: </span><br><span class="line"> Github: [email protected]:xulingran/xulingran.github.io.git</span><br><span class="line"> branch: master</span><br></pre></td></tr></table></figure><p>然后在 Git Bash 中执行</p><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cnpm install hexo-deployer-git --save</span><br></pre></td></tr></table></figure><p>完成后执行</p><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo d</span><br></pre></td></tr></table></figure><p>正常情况下此时你就可以登录 <code>http://你的 Github 用户名.github.io</code> 访问你的博客了。我的博客就是 (<a href="https://lingchenblog.tk/">https://lingchenblog.tk</a>),因为 Github 在中国访问不是很稳定,所以我在<code>Coding</code>又搭了一个一模一样的博客。如果有兴趣的话,也可以上去看看,网址是<code>https://xulingran.tk</code>。接下来我会写写如何配置 NexT 主题。</p><blockquote><p>参考:<a target="_blank" rel="noopener" href="https://www.cnblogs.com/liuxianan/p/build-blog-website-by-hexo-github.html">https://www.cnblogs.com/liuxianan/p/build-blog-website-by-hexo-github.html</a></p></blockquote><blockquote><p>附录:命令示例</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">hexo g = hexo generate 生成文件</span><br><span class="line">hexo s = hexo server 创建本地服务器(本地预览)</span><br><span class="line">hexo d = hexo deploy 上传至服务器</span><br><span class="line">hexo clean 删除生成的public文件夹</span><br></pre></td></tr></table></figure><p>更多命令可执行<code>hexo</code>命令查看</p></blockquote></div><div><ul class="post-copyright"><li class="post-copyright-author"><strong>本文作者: </strong>凌晨</li><li class="post-copyright-link"><strong>本文链接:</strong> <a href="http://lingchenblog.tk/4668.html" title="2020年将 Hexo 部署到 Github 上作为免费博客">http://lingchenblog.tk/4668.html</a></li><li class="post-copyright-license"><strong>版权声明: </strong>本博客所有文章除特别声明外,均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/zh-CN" rel="noopener" target="_blank"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处!</li></ul></div><footer class="post-footer"><div class="post-tags"><a href="/tags/Hexo/" rel="tag"><i class="fa fa-tag"></i> Hexo</a></div><div class="post-nav"><div class="post-nav-item"><a href="/11346.html" rel="prev" title="激活office2019"><i class="fa fa-chevron-left"></i> 激活office2019</a></div><div class="post-nav-item"><a href="/31505.html" rel="next" title="Hexo NexT 7.X版本配置指南">Hexo NexT 7.X版本配置指南 <i class="fa fa-chevron-right"></i></a></div></div></footer></article></div><script>window.addEventListener('tabs:register', () => {
let { activeClass } = CONFIG.comments;
if (CONFIG.comments.storage) {
activeClass = localStorage.getItem('comments_active') || activeClass;
}
if (activeClass) {
let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
if (activeTab) {
activeTab.click();
}
}
});
if (CONFIG.comments.storage) {
window.addEventListener('tabs:click', event => {
if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
let commentClass = event.target.classList[1];
localStorage.setItem('comments_active', commentClass);
});
}</script></div><div class="toggle sidebar-toggle"><span class="toggle-line toggle-line-first"></span> <span class="toggle-line toggle-line-middle"></span> <span class="toggle-line toggle-line-last"></span></div><aside class="sidebar"><div class="sidebar-inner"><ul class="sidebar-nav motion-element"><li class="sidebar-nav-toc">文章目录</li><li class="sidebar-nav-overview">站点概览</li></ul><div class="post-toc-wrap sidebar-panel"><div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE-Hexo"><span class="nav-number">1.</span> <span class="nav-text">配置 Hexo</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%AE%89%E8%A3%85-Node-js"><span class="nav-number">1.1.</span> <span class="nav-text">安装 Node.js</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%AE%89%E8%A3%85-Git"><span class="nav-number">1.2.</span> <span class="nav-text">安装 Git</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%B0%86-npm-%E6%BA%90%E6%9B%B4%E6%8D%A2%E4%B8%BA%E9%98%BF%E9%87%8C%E6%BA%90%EF%BC%88%E5%8F%AF%E9%80%89%EF%BC%89"><span class="nav-number">1.3.</span> <span class="nav-text">将 npm 源更换为阿里源(可选)</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%8B%E8%BD%BD-Hexo"><span class="nav-number">1.4.</span> <span class="nav-text">下载 Hexo</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%BB%E9%A2%98%E4%B8%8B%E8%BD%BD"><span class="nav-number">2.</span> <span class="nav-text">主题下载</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#NexT"><span class="nav-number">2.1.</span> <span class="nav-text">NexT</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Ayer"><span class="nav-number">2.2.</span> <span class="nav-text">Ayer</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE-Github"><span class="nav-number">3.</span> <span class="nav-text">配置 Github</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%B3%A8%E5%86%8C%E4%B8%80%E4%B8%AA-Github-%E8%B4%A6%E5%8F%B7"><span class="nav-number">3.1.</span> <span class="nav-text">注册一个 Github 账号</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%96%B0%E5%BB%BA%E4%B8%80%E4%B8%AA-Repositories"><span class="nav-number">3.2.</span> <span class="nav-text">新建一个 Repositories</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E9%85%8D%E7%BD%AESSH"><span class="nav-number">4.</span> <span class="nav-text">配置SSH</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%9F%A5%E7%9C%8B-SSH-%E5%AF%86%E9%92%A5"><span class="nav-number">4.1.</span> <span class="nav-text">查看 SSH 密钥</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%9C%A8-GitHub-%E4%B8%AD%E9%85%8D%E7%BD%AE-SSH-%E5%AF%86%E9%92%A5"><span class="nav-number">4.2.</span> <span class="nav-text">在 GitHub 中配置 SSH 密钥</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%A3%80%E6%9F%A5-SSH-%E9%85%8D%E7%BD%AE%E6%98%AF%E5%90%A6%E6%88%90%E5%8A%9F"><span class="nav-number">4.3.</span> <span class="nav-text">检查 SSH 配置是否成功</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%8A%E4%BC%A0%E5%88%B0-GitHub"><span class="nav-number">4.4.</span> <span class="nav-text">上传到 GitHub</span></a></li></ol></li></ol></div></div><div class="site-overview-wrap sidebar-panel"><div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"><img class="site-author-image" itemprop="image" alt="凌晨" src="/images/ywy_bg.jpg"><p class="site-author-name" itemprop="name">凌晨</p><div class="site-description" itemprop="description">永远相信美好的事情即将发生</div></div><div class="site-state-wrap motion-element"><nav class="site-state"><div class="site-state-item site-state-posts"><a href="/archives/"><span class="site-state-item-count">6</span> <span class="site-state-item-name">日志</span></a></div><div class="site-state-item site-state-categories"><a href="/categories/"><span class="site-state-item-count">3</span> <span class="site-state-item-name">分类</span></a></div><div class="site-state-item site-state-tags"><a href="/tags/"><span class="site-state-item-count">3</span> <span class="site-state-item-name">标签</span></a></div></nav></div><div class="sidebar-button motion-element"><i class="fa fa-comment"></i> Chat</div><div class="links-of-author motion-element"><span class="links-of-author-item"><a href="https://github.com/xulingran" title="GitHub → https://github.com/xulingran" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a> </span><span class="links-of-author-item"><a href="/[email protected]" title="E-Mail → [email protected]"><i class="fa fa-envelope fa-fw"></i>E-Mail</a></span></div><div class="cc-license motion-element" itemprop="license"><a href="https://creativecommons.org/licenses/by-nc-sa/4.0/zh-CN" class="cc-opacity" rel="noopener" target="_blank"><img src="/images/cc-by-nc-sa.svg" alt="Creative Commons"></a></div></div></div></aside><div id="sidebar-dimmer"></div></div></main><footer class="footer"><div class="footer-inner"><div class="copyright">© 2020 – <span itemprop="copyrightYear">2022</span> <span class="with-love"><i class="fa fa-heart"></i> </span><span class="author" itemprop="copyrightHolder">凌晨</span></div><div class="busuanzi-count"><script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><span class="post-meta-item" id="busuanzi_container_site_uv" style="display:none"><span class="post-meta-item-icon"><i class="fa fa-user"></i> </span><span class="site-uv" title="总访客量"><span id="busuanzi_value_site_uv"></span> </span></span><span class="post-meta-divider">|</span> <span class="post-meta-item" id="busuanzi_container_site_pv" style="display:none"><span class="post-meta-item-icon"><i class="fa fa-eye"></i> </span><span class="site-pv" title="总访问量"><span id="busuanzi_value_site_pv"></span></span></span></div></div></footer></div><script size="300" alpha="0.6" zindex="-1" src="//cdn.jsdelivr.net/gh/theme-next/theme-next-canvas-ribbon@1/canvas-ribbon.js"></script><script src="/lib/anime.min.js"></script><script src="/lib/velocity/velocity.min.js"></script><script src="/lib/velocity/velocity.ui.min.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/schemes/pisces.js"></script><script src="/js/next-boot.js"></script><script src="/js/bookmark.js"></script></body></html>