zoukankan      html  css  js  c++  java
  • 从wordpress换hexo博客后

    之前用wordpress做blog, 为什么换为hexo呢?

    第一

    ​ wordpress的文章都保存在服务器的数据库, 维护不是很直观.

    ​ 而hexo是自己编写markdown文章,本地一份,而blog只是本地的映射.

    ​ 这样文章更好维护和查看.因为做笔记更重要的是自己也能查看.

    第二

    ​ hexo用的github pages服务, 服务器器是git, 自己剩下服务器不说,

    ​ 还能用到git的强大版本控制功能,真是一举多得.

    如果大家发下同步命令复杂,完全可以做个成脚本就像我这这个样,点击脚本就可

    把文章同步了. 真的很方便, 以下为同步步骤.

    hexo同步脚本

    1. 执行hexo_new.sh 生成new.md
    2. 编辑new.md为你要写的blog内容
    3. 把new.md放到你要的分类目录
    4. 执行update.sh同步blog.
    5. 呵呵,完成了

    hexo_new.md

    1
    2
    3
    4
    5
    !/bin/bash
    set -x
    export PATH="/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/toolchain/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin:/opt/FriendlyARM/toolschain/4.4.3/bin 大专栏  从wordpress换hexo博客后:/c/Users/jimmy/AppData/Roaming/npm:/c/Program Files/nodejs"
    cd /e/hexo/
    hexo new "new"

    update.sh

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    !/bin/bash
    set -x
    export PATH="/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/toolchain/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin:/opt/FriendlyARM/toolschain/4.4.3/bin:/c/Users/jimmy/AppData/Roaming/npm:/c/Program Files/nodejs"
    cd /e/demonelf.github.io/
    git pull
    cd /e/hexo/
    hexo g
    rsync -Pv --size-only /e/hexo/public/* /e/demonelf.github.io/ -ar
    rsync -Pv --size-only /e/hexo/source/_posts/* /e/demonelf.github.io/ -ar
    cd /e/demonelf.github.io/
    git add -A
    git commit -m "1.自动更新"
    git push
  • 相关阅读:
    调试php的soapCient
    thinkphp 常见问题
    git使用备忘
    org.apache.catalina.startup.Catalina异常处理
    Java多线程中join方法详解
    WebSphere 安装和配置过程
    数据库错误
    把sql输出成。sql文件
    Oracle 使用命令导入dmp文件
    pl_sql develope连接远程数据库的方法
  • 原文地址:https://www.cnblogs.com/lijianming180/p/12251369.html
Copyright © 2011-2022 走看看