Skip to content

Commit

Permalink
Site updated: 2020-12-06 15:16:12
Browse files Browse the repository at this point in the history
  • Loading branch information
john committed Dec 6, 2020
1 parent eb1a934 commit f33dfcf
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ <h1 class="post-title" itemprop="name headline">
</a>
</div>
<div class="post-nav-item">
<a href="/2020/12/04/migrate-to-hexo/" rel="next" title="migrate-to-hexo">
migrate-to-hexo <i class="fa fa-chevron-right"></i>
<a href="/2020/12/04/migrate-to-hexo/" rel="next" title="博客从wordpress迁移到hexo github pages平台">
博客从wordpress迁移到hexo github pages平台 <i class="fa fa-chevron-right"></i>
</a>
</div>
</div>
Expand Down
22 changes: 14 additions & 8 deletions 2020/12/04/migrate-to-hexo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
</script>
<meta name="description" content="越来越没有心思来管理一个独立的wordpress博客,linode慢出翔来好久了,还是把blog迁移到github pages吧,迁移过程做个简单的记录。">
<meta property="og:type" content="article">
<meta property="og:title" content="migrate-to-hexo">
<meta property="og:title" content="博客从wordpress迁移到hexo github pages平台">
<meta property="og:url" content="https://openwares.net/2020/12/04/migrate-to-hexo/index.html">
<meta property="og:site_name" content="openwares.net">
<meta property="og:description" content="越来越没有心思来管理一个独立的wordpress博客,linode慢出翔来好久了,还是把blog迁移到github pages吧,迁移过程做个简单的记录。">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2020-12-04T13:12:27.000Z">
<meta property="article:modified_time" content="2020-12-04T14:25:33.880Z">
<meta property="article:modified_time" content="2020-12-06T07:15:51.227Z">
<meta property="article:author" content="changuoqiang">
<meta property="article:tag" content="misc">
<meta name="twitter:card" content="summary">
Expand All @@ -49,7 +49,7 @@
lang : 'en'
};
</script>
<title>migrate-to-hexo | openwares.net</title>
<title>博客从wordpress迁移到hexo github pages平台 | openwares.net</title>



Expand Down Expand Up @@ -286,7 +286,7 @@ <h1 class="site-title">openwares.net</h1>
</span>
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
migrate-to-hexo
博客从wordpress迁移到hexo github pages平台
</h1>

<div class="post-meta-container">
Expand All @@ -296,10 +296,16 @@ <h1 class="post-title" itemprop="name headline">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">Posted on</span>


<time title="Created: 2020-12-04 21:12:27 / Modified: 22:25:33" itemprop="dateCreated datePublished" datetime="2020-12-04T21:12:27+08:00">2020-12-04</time>
<time title="Created: 2020-12-04 21:12:27" itemprop="dateCreated datePublished" datetime="2020-12-04T21:12:27+08:00">2020-12-04</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">Edited on</span>
<time title="Modified: 2020-12-06 15:15:51" itemprop="dateModified" datetime="2020-12-06T15:15:51+08:00">2020-12-06</time>
</span>


</div>
Expand Down Expand Up @@ -394,8 +400,8 @@ <h3 id="撰写"><a href="#撰写" class="headerlink" title="撰写"></a>撰写</
</a>
</div>
<div class="post-nav-item">
<a href="/2020/12/06/hexo-multi-devices-sync/" rel="next" title="hexo-multi-devices-sync">
hexo-multi-devices-sync <i class="fa fa-chevron-right"></i>
<a href="/2020/12/06/hexo-multi-devices-sync/" rel="next" title="hexo github pages 多设备同步">
hexo github pages 多设备同步 <i class="fa fa-chevron-right"></i>
</a>
</div>
</div>
Expand Down
21 changes: 11 additions & 10 deletions 2020/12/06/hexo-multi-devices-sync/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
var NexT = window.NexT || {};
var CONFIG = {"hostname":"openwares.net","root":"/","images":"/images","scheme":"Muse","version":"8.1.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Searching...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}};
</script>
<meta name="description" content="在笔记本上搭建好了hexo github pages博客,同时有用其他设备更新博客的需求,记录配置过程 hexo部署的时候只是将生成的博客发布到githubs的远程分支,所有的发布内容都在.deploy_git目录下,blog源文件并没有使用git管理。 为了在多设备之间同步,可以使用git来管理源代码,发布到github pages仓库的其他分支,这里分支名字设定为hexo。 但要注意,如果">
<meta name="description" content="在笔记本上搭建好了hexo github pages博客,同时有用其他设备更新博客的需求,记录配置过程">
<meta property="og:type" content="article">
<meta property="og:title" content="hexo-multi-devices-sync">
<meta property="og:title" content="hexo github pages 多设备同步">
<meta property="og:url" content="https://openwares.net/2020/12/06/hexo-multi-devices-sync/index.html">
<meta property="og:site_name" content="openwares.net">
<meta property="og:description" content="在笔记本上搭建好了hexo github pages博客,同时有用其他设备更新博客的需求,记录配置过程 hexo部署的时候只是将生成的博客发布到githubs的远程分支,所有的发布内容都在.deploy_git目录下,blog源文件并没有使用git管理。 为了在多设备之间同步,可以使用git来管理源代码,发布到github pages仓库的其他分支,这里分支名字设定为hexo。 但要注意,如果">
<meta property="og:description" content="在笔记本上搭建好了hexo github pages博客,同时有用其他设备更新博客的需求,记录配置过程">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2020-12-06T06:37:12.000Z">
<meta property="article:modified_time" content="2020-12-06T06:59:32.781Z">
<meta property="article:modified_time" content="2020-12-06T07:15:09.883Z">
<meta property="article:author" content="changuoqiang">
<meta property="article:tag" content="misc">
<meta name="twitter:card" content="summary">
Expand All @@ -49,7 +49,7 @@
lang : 'en'
};
</script>
<title>hexo-multi-devices-sync | openwares.net</title>
<title>hexo github pages 多设备同步 | openwares.net</title>



Expand Down Expand Up @@ -286,7 +286,7 @@ <h1 class="site-title">openwares.net</h1>
</span>
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
hexo-multi-devices-sync
hexo github pages 多设备同步
</h1>

<div class="post-meta-container">
Expand All @@ -298,7 +298,7 @@ <h1 class="post-title" itemprop="name headline">
<span class="post-meta-item-text">Posted on</span>


<time title="Created: 2020-12-06 14:37:12 / Modified: 14:59:32" itemprop="dateCreated datePublished" datetime="2020-12-06T14:37:12+08:00">2020-12-06</time>
<time title="Created: 2020-12-06 14:37:12 / Modified: 15:15:09" itemprop="dateCreated datePublished" datetime="2020-12-06T14:37:12+08:00">2020-12-06</time>
</span>


Expand All @@ -312,7 +312,7 @@ <h1 class="post-title" itemprop="name headline">

<div class="post-body" itemprop="articleBody">
<p>在笔记本上搭建好了hexo github pages博客,同时有用其他设备更新博客的需求,记录配置过程</p>
<!-- more --->
<a id="more"></a>

<p>hexo部署的时候只是将生成的博客发布到githubs的远程分支,所有的发布内容都在.deploy_git目录下,blog源文件并没有使用git管理。</p>
<p>为了在多设备之间同步,可以使用git来管理源代码,发布到github pages仓库的其他分支,这里分支名字设定为hexo。</p>
Expand All @@ -334,6 +334,7 @@ <h3 id="在多个设备上撰写的日常流程"><a href="#在多个设备上撰

<p>然后正常撰写新博客,博客发布后不要忘了把源代码提交到github pages</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ git add .</span><br><span class="line">$ git commit -m <span class="string">&#x27;new post&#x27;</span></span><br><span class="line">$ git push</span><br></pre></td></tr></table></figure>

</div>


Expand All @@ -349,8 +350,8 @@ <h3 id="在多个设备上撰写的日常流程"><a href="#在多个设备上撰

<div class="post-nav">
<div class="post-nav-item">
<a href="/2020/12/04/migrate-to-hexo/" rel="prev" title="migrate-to-hexo">
<i class="fa fa-chevron-left"></i> migrate-to-hexo
<a href="/2020/12/04/migrate-to-hexo/" rel="prev" title="博客从wordpress迁移到hexo github pages平台">
<i class="fa fa-chevron-left"></i> 博客从wordpress迁移到hexo github pages平台
</a>
</div>
<div class="post-nav-item">
Expand Down
4 changes: 2 additions & 2 deletions archives/2020/12/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ <h1 class="site-title">openwares.net</h1>

<div class="post-title">
<a class="post-title-link" href="/2020/12/06/hexo-multi-devices-sync/" itemprop="url">
<span itemprop="name">hexo-multi-devices-sync</span>
<span itemprop="name">hexo github pages 多设备同步</span>
</a>
</div>

Expand All @@ -308,7 +308,7 @@ <h1 class="site-title">openwares.net</h1>

<div class="post-title">
<a class="post-title-link" href="/2020/12/04/migrate-to-hexo/" itemprop="url">
<span itemprop="name">migrate-to-hexo</span>
<span itemprop="name">博客从wordpress迁移到hexo github pages平台</span>
</a>
</div>

Expand Down
4 changes: 2 additions & 2 deletions archives/2020/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ <h1 class="site-title">openwares.net</h1>

<div class="post-title">
<a class="post-title-link" href="/2020/12/06/hexo-multi-devices-sync/" itemprop="url">
<span itemprop="name">hexo-multi-devices-sync</span>
<span itemprop="name">hexo github pages 多设备同步</span>
</a>
</div>

Expand All @@ -308,7 +308,7 @@ <h1 class="site-title">openwares.net</h1>

<div class="post-title">
<a class="post-title-link" href="/2020/12/04/migrate-to-hexo/" itemprop="url">
<span itemprop="name">migrate-to-hexo</span>
<span itemprop="name">博客从wordpress迁移到hexo github pages平台</span>
</a>
</div>

Expand Down
4 changes: 2 additions & 2 deletions archives/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ <h1 class="site-title">openwares.net</h1>

<div class="post-title">
<a class="post-title-link" href="/2020/12/06/hexo-multi-devices-sync/" itemprop="url">
<span itemprop="name">hexo-multi-devices-sync</span>
<span itemprop="name">hexo github pages 多设备同步</span>
</a>
</div>

Expand All @@ -308,7 +308,7 @@ <h1 class="site-title">openwares.net</h1>

<div class="post-title">
<a class="post-title-link" href="/2020/12/04/migrate-to-hexo/" itemprop="url">
<span itemprop="name">migrate-to-hexo</span>
<span itemprop="name">博客从wordpress迁移到hexo github pages平台</span>
</a>
</div>

Expand Down
46 changes: 19 additions & 27 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ <h1 class="site-title">openwares.net</h1>
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/12/06/hexo-multi-devices-sync/" class="post-title-link" itemprop="url">hexo-multi-devices-sync</a>
<a href="/2020/12/06/hexo-multi-devices-sync/" class="post-title-link" itemprop="url">hexo github pages 多设备同步</a>
</h2>

<div class="post-meta-container">
Expand All @@ -293,7 +293,7 @@ <h2 class="post-title" itemprop="name headline">
<span class="post-meta-item-text">Posted on</span>


<time title="Created: 2020-12-06 14:37:12 / Modified: 14:59:32" itemprop="dateCreated datePublished" datetime="2020-12-06T14:37:12+08:00">2020-12-06</time>
<time title="Created: 2020-12-06 14:37:12 / Modified: 15:15:09" itemprop="dateCreated datePublished" datetime="2020-12-06T14:37:12+08:00">2020-12-06</time>
</span>


Expand All @@ -307,28 +307,14 @@ <h2 class="post-title" itemprop="name headline">

<div class="post-body" itemprop="articleBody">
<p>在笔记本上搭建好了hexo github pages博客,同时有用其他设备更新博客的需求,记录配置过程</p>
<!-- more --->

<p>hexo部署的时候只是将生成的博客发布到githubs的远程分支,所有的发布内容都在.deploy_git目录下,blog源文件并没有使用git管理。</p>
<p>为了在多设备之间同步,可以使用git来管理源代码,发布到github pages仓库的其他分支,这里分支名字设定为hexo。</p>
<p>但要注意,如果源代码中有私密信息,就不适合这样管理了,因为发布到github pages仓库中的信息是可以完全公开访问,切记。</p>
<h3 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h3><p>在博客目录下,使用git管理源代码,并上传到github pages仓库的hexo分支。<br>注意目录下的.gitignore文件,忽略掉不需要跟踪的文件和目录</p>
<figure class="highlight js"><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><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">.DS_Store</span><br><span class="line">Thumbs.db</span><br><span class="line">db.json</span><br><span class="line">*.log</span><br><span class="line">node_modules/</span><br><span class="line">public/</span><br><span class="line">.deploy*/</span><br></pre></td></tr></table></figure>

<p>然后初始化git仓库,创建新分支hexo,并将所有源代码添加到仓库,提交并推送到github</p>
<figure class="highlight js"><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><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">git init</span><br><span class="line">git remote add origin git@github.com:your_username/your_username.github.io</span><br><span class="line">git checkout -b hexo</span><br><span class="line">git add .</span><br><span class="line">git commit</span><br><span class="line">git push --set-upstream origin hexo</span><br></pre></td></tr></table></figure>

<h3 id="在新设备上使用hexo"><a href="#在新设备上使用hexo" class="headerlink" title="在新设备上使用hexo"></a>在新设备上使用hexo</h3><p>安装好node和git,并配置好git访问github仓库,然后克隆hexo分支到本地</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ git clone -b hexo git@github.com:your_username/your_username.github.io </span><br></pre></td></tr></table></figure>

<p>然后进入your_username.github.io目录</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ npm install</span><br></pre></td></tr></table></figure>

<h3 id="在多个设备上撰写的日常流程"><a href="#在多个设备上撰写的日常流程" class="headerlink" title="在多个设备上撰写的日常流程"></a>在多个设备上撰写的日常流程</h3><p>在撰写新的博客时要先pull跟新本地hexo分支</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ git pull</span><br></pre></td></tr></table></figure>

<p>然后正常撰写新博客,博客发布后不要忘了把源代码提交到github pages</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ git add .</span><br><span class="line">$ git commit -m <span class="string">&#x27;new post&#x27;</span></span><br><span class="line">$ git push</span><br></pre></td></tr></table></figure>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2020/12/06/hexo-multi-devices-sync/#more" rel="contents">
Read more &raquo;
</a>
</div>
<!--/noindex-->


</div>

Expand Down Expand Up @@ -367,7 +353,7 @@ <h3 id="在多个设备上撰写的日常流程"><a href="#在多个设备上撰
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/12/04/migrate-to-hexo/" class="post-title-link" itemprop="url">migrate-to-hexo</a>
<a href="/2020/12/04/migrate-to-hexo/" class="post-title-link" itemprop="url">博客从wordpress迁移到hexo github pages平台</a>
</h2>

<div class="post-meta-container">
Expand All @@ -377,10 +363,16 @@ <h2 class="post-title" itemprop="name headline">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">Posted on</span>


<time title="Created: 2020-12-04 21:12:27 / Modified: 22:25:33" itemprop="dateCreated datePublished" datetime="2020-12-04T21:12:27+08:00">2020-12-04</time>
<time title="Created: 2020-12-04 21:12:27" itemprop="dateCreated datePublished" datetime="2020-12-04T21:12:27+08:00">2020-12-04</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">Edited on</span>
<time title="Modified: 2020-12-06 15:15:51" itemprop="dateModified" datetime="2020-12-06T15:15:51+08:00">2020-12-06</time>
</span>


</div>
Expand Down
Loading

0 comments on commit f33dfcf

Please sign in to comment.