Linux-github 搭建静态博客
2023-09-11 14:20:59 时间
1.在Github上创建一个新的Repository
到你的github上 https://github.com去create a new repository命名为 github.myblog
2.本地安装Jekyll-Bootstrap
假设本地centos没有git,使用yum安装
$ yum install git
克隆jekyll-bootstrap
$ git clone https://github.com/plusjade/jekyll-bootstrap.git myblog
$ cd myblog
$ git remote add origin-myblog https://github.com/csuldw/myblog.git
$ git push origin-myblog master #代码传至github
经过上面的代码之后。就能够看到自己的博客了:http://myblog.github.io/
github文件文件夹
3.安装Jekyll
使用以下代码看看是否安装了jekyll
$ git clone https://github.com/plusjade/jekyll-bootstrap.git
$ cd jekyll-bootstrap
$ jekyll serve
依据网址http://localhost:4000. 看是否成功安装
假设没有成功安装,以下再centos中安装jekyll。參考:https://hack0nair.me/2013-10-31-config-jekyll-on-centos/
首先安装ruby:
$ sudo yum install ruby
接着安装jekyll
$ gem install jekyll
然后回到myblog文件夹。运行下列代码检測jekyll是否成功安装
$ jekyll server
假设出现以下情况,表示成功安装
4.创建一个页面
下载rake
$ gem install rake
创建页面
$ rake page name="about.md"
创建一个内部页面
rake page name="pages/about.md"
Create a page with a “pretty” path:
$ rake page name="pages/about"
# this will create the file: ./pages/about/index.html
The rake task automatically creates a page file with properly formatted filename and YAML Front Matter as well as includes the Jekyll Bootstrap “setup” file.
5.公布至github
$ git add .
$ git commit -m "Add new content"
$ git push origin master
附:jekyll支持主题定做 http://jekyllbootstrap.com/usage/jekyll-theming.html
主题文件夹位于:_includes/themes 以下.
相关文章
- STM32MP157 Linux系统移植开发篇2:烧写linux镜像
- linux系统巡检脚本
- Linux Deploy在安卓手机安装LINUX系统
- linux必学
- Linux命令之netstat
- linux安装experss搭建本地服务器
- Linux内核 结构 struct urb
- 转 Linux sudo命令
- Linux使用github仓库
- Linux 如何将linux主机变为路由器&&iptables的基本用法
- Linux平台不同解压缩命令的使用方法
- Linux 之 arm linux 与 windows 使用 tftp 进行文件传输的简单整理
- 基于Linux C的socketEthereal程序和Package分析 (一个)
- 【Linux】linux经常使用基本命令
- Linux学习笔记(24)linux发邮件 mailx发邮件
- Linux学习笔记(19)linux定时任务(crontab)
- Linux学习笔记(18)Linux sed,linux awk,linux grep,Linux三剑客
- Linux学习笔记(2)linux系统信息与进程相关命令
- Linux学习笔记(1)linux的开关机及重启
- Github remote: error: File .vscode/.browse.c_cpp.db exceeds GitHub's file size of 100.00 MB问题的解决
- 通过SSHFS在RHEL中安全的挂载远程Linux/UNIX目录或文件系统--转载
- 《Linux命令行与shell脚本编程大全 第3版》Shell脚本编程基础---13