凭海临风的IT江湖

  • 首页

  • 关于

  • 标签

  • 分类

  • 归档

  • 站点地图

  • 公益 404

  • 时间轴

  • 搜索

push-hexo-to-github

发表于 2015-04-17 | 更新于 2022-08-18 | 分类于 hexo
本文字数: 1.6k | 阅读时长 ≈ 1 分钟

如何使用hexo在github上建立静态博客

环境搭建

  1. hexo环境搭建

    请参考 hexo.io 官方站点,
    强烈建议给基本操作下的内容快速浏览一遍,下面的操作是我一个一个命令敲出来的,遇到的坑也会记录下来,希望大家能少走弯路。

  2. github上建立静态博客

    1. github账号申请(略)
    2. 建立一个github项目
    3. git clone 项目地址 到本地
    4. 项目初始化

      cd 项目名
      echo # hexo 实例站点 >> README.md
      git init
      git add README.md
      git commit -m “first blood”
      git remote add origin 项目地址
      git push -u origin master
    5. github免费站点建立规则,请仔细阅读这个规则
      https://help.github.com/articles/user-organization-and-project-pages/

    6. 默认github域名

      默认github 分配了 一个name.github.io的域名,
      还有一个name.github.io/project_name的二级域名,
      请参照github的提示设置URL。

华丽的分割线

  1. 站点配置流程

    1. 建立站点文件夹,并站点初始化
    2. 安装hexo依赖
    3. 修改node_module/hexo-server/index.js,用于本地调试
    4. 安装hexo-git-deployer插件
    5. 修改全局配置文件_config.yml,配置deploy


      # Site 站点配置
      title: 凭海临风的测试江湖
      subtitle:
      description: 凭海临风的博客
      author: Jeff Sui
      language: zh-CN
      timezone

      </code></pre>
      


      # URL 站点链接
      ## If your site is put in a subdirectory, set url as ‘http://yoursite.com/child' and root as ‘/child/‘
      url: http://jeffsui.github.io
      root: /pinghailinfeng_blog/
      permalink: :year/:month/:day/:title/
      permalink_defaults:


      # Deployment
      ## Docs: http://hexo.io/docs/deployment.html
      deploy:
      type: git
      repo: https://github.com/jeffsui/pinghailinfeng_blog.git
      branch : master
      message :

      以上配置仅供参考

  2. 创建文章

    • 执行hexo new 命令

      例如:hexo new post my-first-blog

      将会自动在source/_posts下创建一个my-first-blog.md的文件,使用的是scaffolds下的post.md模板

    • 修改并保存my-first-blog.md文件

    • 站点生成hexo g

    • 站点部署 hexo d

      如果没有报错,恭喜你已经成功推送到 项目的master分支。

  3. 创建gh-pages分支并推送到远程


    git fetch origin master
    git checkout gh-pages
    git merge master
    git push origin gh-pages

  4. 访问http://jeffsui.github.io/pinghailinfeng_blog/

遇到的问题

  1. github站点的规则不熟悉,url配置浪费我2个小时。项目建立的是二级域名,所以必须要按照我说的那样配置。
  2. 本地预览有可能不加载样式,重新删除node_module下所有,执行npm install,再hexo g,hexo server -i 127.0.0.1 -s -o即可。
  3. hexo3.0版本的git插件必须要独立安装。
  4. 其他坑,自己填吧。

总结

大坑各种有,github特别多,还有伟大的墙,兄弟们,github好上,填坑需谨慎!

sublime run slow problem

发表于 2015-04-17 | 更新于 2022-08-18 | 分类于 工具篇
本文字数: 163 | 阅读时长 ≈ 1 分钟

解决sublime Text2运行缓慢的方法

今天打开sublime想写博客发现整个页面打开很慢,切换tab要等好几秒。
发现了一个帖子,说GitGutter这个插件在st2下会影响切换tab速度。

于是 ctrl+shift+p调出命令,remove package,选择GitGutter,回车。
重启sublime,世界都变得清静了。

first-blog

发表于 2015-04-17 | 更新于 2022-08-18 | 分类于 搭建博客
本文字数: 22 | 阅读时长 ≈ 1 分钟

#第一个博客

##记录使用hexo的各种填坑。

1…1516
Jeff Sui

Jeff Sui

153 日志
40 分类
175 标签
RSS
GitHub E-Mail
  • 20201
  • 2to31
  • Boolean1
  • Centos2
  • Exception1
  • GIL1
  • GitGutter1
  • Tkinter1
  • TypeScript2
  • XML2
  • __all__1
  • _thread1
  • app1
  • argparse2
  • array1
  • atexit1
  • bisect1
  • calendar1
  • centos1
  • checkbox1
  • cmath1
  • cmd1
  • code1
  • collections.abc1
  • concurrent1
  • conda1
  • context-manager-types1
  • cookies1
  • copy1
  • coroutines1
  • csv1
  • cygwin1
  • dataclasses1
  • dbm1
  • dict1
  • dictionary1
  • difflib1
  • dis1
  • django4
  • docker3
  • doctest1
  • dom1
  • eclipse1
  • enum1
  • es61
  • esp323
  • esptool1
  • ffmpeg1
  • filecmp1
  • fileinput1
  • fractions1
  • functools1
  • futures1
  • gc1
  • generator1
  • git4
  • gitcafe1
  • github1
  • glob1
  • heapq1
  • hexo2
  • html.parser1
  • http2
  • http.server1
  • ios1
  • iterator1
  • itertools1
  • java3
  • javascript6
  • javaweb2
  • jdk1
  • jira1
  • json1
  • juypter1
  • keyword1
  • linecache1
  • linter1
  • linux2
  • lite-server1
  • m3u81
  • maven4
  • micorpython1
  • micropython2
  • minidom1
  • modulefinder1
  • mongodb1
  • mybatis1
  • mysql1
  • nbextension1
  • nginx1
  • nodejs2
  • ollama1
  • oop1
  • operator1
  • os1
  • os.path1
  • others1
  • pathlib1
  • photo1
  • pickle1
  • pprint1
  • pwd1
  • pycharm1
  • python99
  • python31
  • queue1
  • re1
  • readline1
  • registry2
  • registry-ui2
  • reprlib1
  • rust1
  • sax1
  • sched1
  • select1
  • selectors1
  • selenium3
  • shutil1
  • socket1
  • sort1
  • spring1
  • sqlite32
  • ssm1
  • standar_library1
  • standard_library78
  • statistics1
  • string2
  • sublime1
  • tempfile1
  • this1
  • thread1
  • timeit1
  • turtle2
  • types1
  • uPycraft1
  • unittest1
  • urllib.robotparser1
  • uuid1
  • uv1
  • venv1
  • vite1
  • vscode1
  • vue31
  • weakref1
  • web test2
  • webbrowser1
  • webrepl1
  • windows3
  • xml2
  • 二维码1
  • 办公1
  • 博客3
  • 坑1
  • 字典1
  • 异步1
  • 循环1
  • 感悟1
  • 持续集成1
  • 搭建1
  • 搭建博客1
  • 文章1
  • 新特性1
  • 杂记3
  • 版本管理2
  • 短网址1
  • 禅道1
  • 笔记1
  • 约束1
  • 网易音乐1
  • 美化1
  • 自动化测试1
  • 软件工程1
  • 逆向工程1
  • 闭包1
  • 项目管理2
© 2015 – 2026 Jeff Sui | 827k | 12:32
由 Hexo 强力驱动 v3.9.0
|
主题 – NexT.Gemini v7.1.1
|
0%