plan migrate my blog to github https://github.com/digoal/blog

简介:
网易的博客越来越不给力了,访问速度慢,而且技术文章经常被莫名其妙的封掉。准备迁移到github,用markdown格式保存(或者大家有没有其他更好的建议?)。

新的地址如下:

由于历史文章比较多,迁移起来还挺费事,先把html和xml搬过去,HTML先转换为txt,图片以及附件链接还有点问题。
后续再统一生成markdown。

导出blog html.zip (需要会员)

解压,文件名的前8位是yyyymmdd,所以可以按月来分目录。
-rw-r--r--. 1 root root  63323 Aug  2 17:27 20150723180657.html
-rw-r--r--. 1 root root  21680 Aug  2 17:27 20150730171400.html
-rw-r--r--. 1 root root   1864 Aug  2 17:27 20150731225341.html
-rw-r--r--. 1 root root  29882 Aug  2 17:27 20150802163937.html


下载安装w3m, pandoc(可用于转换html到markdown格式)
# yum localinstall --nogpgcheck https://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# yum search all pandoc
# yum install -y pandoc
# yum install -y w3m


对文件归类
# vi test.sh 

#!/bin/bash
for i in `ls /opt/soft_bak/blog/html/*.html`
do
  filename=`echo $i|awk -F '/' '{print $6}'|awk -F '.' '{print $1}'`
  echo $filename
  dirname=`echo $filename|awk '{print substr($1,1,6)}'`
  echo $dirname
  mkdir -p /tmp/blog/blog_html_backup/$dirname
  mkdir -p /tmp/blog/blog_txt_backup/$dirname
  cat $i|w3m -dump -cols 320 -T text/html > /tmp/blog/blog_txt_backup/$dirname/${filename}.txt
  cp $i /tmp/blog/blog_html_backup/$dirname/
done

调整一下index.html和index.txt的位置.


上传到github

生成并上传ssh key
验证
ssh -v git@github.com


cd ~/
git clone https://github.com/digoal/blog.git
cd ~/blog
cp -r /tmp/blog/* ~/blog/
git remote add blog git@github.com:digoal/blog
git pull blog master
git add .
git commit -m 'backup digoal 163 blog'
git push blog master

[参考]
1. https://progit.org/
2. http://iissnan.com/progit/
3. http://markdownpad.com/download.html
相关文章
|
9月前
完美解决 fatal: unable to access ‘https://github.com/Homebrew/brew/‘
完美解决 fatal: unable to access ‘https://github.com/Homebrew/brew/‘
424 0
|
5天前
|
开发工具 git
github clone Failed to connect to github.com port 443 after xxx ms
github clone Failed to connect to github.com port 443 after xxx ms
85 2
|
5天前
|
网络虚拟化
解决方案:Github Failed to connect to github.com port 443 after 21224 ms: Timed out
解决方案:Github Failed to connect to github.com port 443 after 21224 ms: Timed out
19 0
|
5天前
|
Linux 开发工具 git
【开发专题_03】unable to access ‘https://github.com/deviantony/docker-elk.git/‘: Failed connect to github
【开发专题_03】unable to access ‘https://github.com/deviantony/docker-elk.git/‘: Failed connect to github
46 2
|
5天前
|
Windows
Windows【工具 01】视频下载工具BBDown.exe详细使用说明(https://github.com/nilaoda/BBDown)mp4格式无法识别问题处理(最新版本1.6.1网盘分享)
Windows【工具 01】视频下载工具BBDown.exe详细使用说明(https://github.com/nilaoda/BBDown)mp4格式无法识别问题处理(最新版本1.6.1网盘分享)
234 0
|
5天前
【Error】fatal: unable to access ‘https://github.com/PanJiaChen/vue-element-admin/‘: OpenSSL SSL_read:
【Error】fatal: unable to access ‘https://github.com/PanJiaChen/vue-element-admin/‘: OpenSSL SSL_read:
|
10月前
|
域名解析 网络协议 Windows
github:网址为 https://github.com/ 的网页可能暂时无法连接,或者它已永久性地移动到了新网址
github:网址为 https://github.com/ 的网页可能暂时无法连接,或者它已永久性地移动到了新网址
681 0
|
11月前
|
Shell
(Mac)remotedebug-ios-webkit-adapter 无法运行,出现以下错误:ios_webkit_debug_proxy找不到。请安装 ios_webkit_debug_proxy (https://github.com/google/ios-webkit-debug-proxy) #74
(Mac)remotedebug-ios-webkit-adapter 无法运行,出现以下错误:ios_webkit_debug_proxy找不到。请安装 ios_webkit_debug_proxy (https://github.com/google/ios-webkit-debug-proxy) #74
445 0
|
开发工具 git
fatal: unable to access ‘https://github xxxxxxxxx的解决方法
fatal: unable to access ‘https://github xxxxxxxxx的解决方法
494 0
|
网络安全
unable to access ‘https://github.com/adobe-webplatform/eve.git/‘: Failed to connect to github.com
unable to access ‘https://github.com/adobe-webplatform/eve.git/‘: Failed to connect to github.com