官网运维指北
- 当前查阅: http://techparty.gitcafe.com/
- 计划发布: http://techparty.org
190320 重新回到 github
- 用本地历史仓库, 分别导入 gitcafe/coding 时代不同分支所有历史版本
- master 恢复 gh-pages 版本 Jekyll 自动编译
- 临时用
https://mirrors.tuna.tsinghua.edu.cn/rubygems/
༄ bundle exec jekyll serve
Configuration file: /opt/data/Sites/com.techparty.org/techparty-org.github.io/_config.yml
Configuration Error: You specified the `plugins` config in your configuration file as a string, please use an array instead. If you wanted to set the directory of your plugins, use the config key `plugins_dir` instead.
jekyll 3.7.4 | Error: 'plugins' should not be a string, but was: "./_plugins". Use 'plugins_dir' instead.
༄ bundle install 引发
...
Bundle complete! 8 Gemfile dependencies, 94 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from dnsruby:
Installing dnsruby...
For issues and source code: https://github.com/alexdalitz/dnsruby
For general discussion (please tell us how you use dnsruby): https://groups.google.com/forum/#!forum/dnsruby
Post-install message from sass:
Ruby Sass is deprecated and will be unmaintained as of 26 March 2019.
* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
primary implementation: https://sass-lang.com/install
* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
sassc gem: https://github.com/sass/sassc-ruby#readme
* For more details, please refer to the Sass blog:
http://sass.logdown.com/posts/7081811
Post-install message from html-pipeline:
-------------------------------------------------
Thank you for installing html-pipeline!
You must bundle Filter gem dependencies.
See html-pipeline README.md for more details.
https://github.com/jch/html-pipeline#dependencies
-------------------------------------------------
参考: 在 coding.net 上部署 Jekyll 博客 - Martin
以下是基于 gitcafe-pages
的维护流程,
已经过期!
- 首先应该注册 gitcafe
- 然后在 您的 SSH 公钥 - GitCafe 上传公匙,以便使用 SSH 协议进行加密无口令提交!
再来初始化本地仓库:
$ git clone git@gitcafe.com:Liebao/Liebao.git
然后配置别名,以加强输入记忆, 修订 仓库目录中 .git/cofig 文件
...
[remote "origin"]
url = git://gitcafe.com/Liebao/Liebao.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = cafe
merge = refs/heads/master
追加一节:
[remote "cafe"]
url = git@gitcafe.com:Liebao/Liebao.git
fetch = +refs/heads/*:refs/remotes/origin/*
- 以后就可以使用
cafe
来替代origin
来指代当前仓库名了!
###使用 msysgit 准备环境
- 下载: http://code.google.com/p/msysgit/downloads/list
- 参考:
- 注意的是:
选择Git文件夹,右键,选择Git Bash Here,会弹出shell命令行界面
可能不一定有 - 不过,可以自然的进入 msysgit 安装目录中, 点击
git-cmd.bat
- 然后在其中调用的 bin 下的
bash.exe
进入方便的 shell 环境 - 然后就可以自动的引用到
ssh-kengen.exe
生成对应的SSH
密匙对!
- 然后在其中调用的 bin 下的
命令形如: bash-3.1$ ssh-keygen -C "zhouqi@ijinshan.com"
Your identification has been saved in /c/Documents and Settings/Administrator/.s
sh/id_rsa.
Your public key has been saved in /c/Documents and Settings/Administrator/.ssh/i
d_rsa.pub.
The key fingerprint is:
cf:1b:90:1b:25:0a:12:61:ff:ad:71:d0:ec:cd:5f:55 zhouqi@ijinshan.com
从对应的文件中复制出公匙字串,这里是 id_rsa.pub
发布为个人帐号的公匙:
再由仓库管理员加我们的 gitcafe
帐号为 blogging
仓库的协作人员:
从仓库首页可以获得有写入权限的 URI
:
在开始前,如前建议,在 git 配置文件中声明有意义的别名:
并配置合理的全局变量:
bash-3.1$ git config --global user.name "zhouqi"
bash-3.1$ git config --global user.email "zhouqi@ijinshan.com"
使用git 命令观察是否生效:
bash-3.1$ git config --list
core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/mingw/bin/curl-ca-bundle.crt
sendemail.smtpserver=/mingw/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
user.name=zhouqi
user.email=zhouqi@ijinshan.com
- 在合适的空白目录中
clone
远程仓库到本地:
bash-3.1$ git clone git@gitcafe.com:Liebao/Liebao.git blog
Cloning into 'blog'...
The authenticity of host 'gitcafe.com (50.116.2.223)' can't be established.
RSA key fingerprint is 84:9e:c9:8e:7f:36:28:08:7e:13:bf:43:12:74:11:4e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitcafe.com,50.116.2.223' (RSA) to the list of known
hosts.
remote: Counting objects: 127, done.
remote: Compressing objects: 100% (122/122), done.
remote: Total 127 (delta 47), reused 0 (delta 0)
Receiving objects: 100% (127/127), 458.50 KiB | 377 KiB/s, done.
Resolving deltas: 100% (47/47), done.
-
更新到约定的
gitcafe-pages
分支:bash-3.1$ cd blog bash-3.1$ git checkout -b gitcafe-pages remotes/origin/gitcafe-pages error: Not tracking: ambiguous information for ref refs/remotes/origin/gitcafe-p ages Switched to a new branch 'gitcafe-pages'
-
注意!
一定要先进入clone
下来的目录中,否则 git 不认为我们在操作合理的版本仓库!
在资源管理器中就可以见到整个基于 jekyll 的团队blog 工程了!
- 免费好编辑器! http://www.markdownpad.com/
- 下载,安装,没什么好说的
- 完全吻合 word 式编辑的环境! 左窗写 markdown,右窗自动编译成最终效果:
编辑保存后,使用 status
可以观察到变化:
bash-3.1$ git status
# On branch gitcafe-pages
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: _posts/2012-12-10-git-note.md
#
no changes added to commit (use "git add" and/or "git commit -a")
使用 add
收录变更,才能 commit
, 最后 push
后,才能发布到 gitcafe
的团队仓库:
bash-3.1$ git add .
bash-3.1$ git commit -m "zhouqi throught XP + msysgit"
[gitcafe-pages 6f50b04] zhouqi throught XP + msysgit
1 file changed, 4 insertions(+)
bash-3.1$ git push cafe
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
Counting objects: 7, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 426 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)
To git@gitcafe.com:Liebao/Liebao.git
89db4d6..6f50b04 gitcafe-pages -> gitcafe-pages
注意!
git 的提示非常智能,会好心提醒我们忘记的参数,不过,一般都是可以智能猜中我们的期待,完成合理的操作!- 基于以上的操作,在远程仓库中就可以见到自个儿的提交了!
$ git log --graph --pretty=oneline --abbrev-commit
* 80846ab - (HEAD, origin/gitcafe-pages, gitcafe-pages) 演示多人协同时的流程+ 8 minutes ago
* e8b5e0f - Merge branch 'gitcafe-pages' of gitcafe.com:Liebao/Liebao into gitcafe-pages 26 minutes ago
|\
| * 9783bab - 尝试另外成员本地的协同过程 33 minutes ago
* | ce33b2e - 增补res 目录,准备发布可能的幻灯资料.. 67 minutes ago
|/
* 61f39ee - 增补本地图片使用样例 71 minutes ago
...
- 当有复杂的团队多人协作时,可以用来观察各种版本的合并关系
使用SourceTree 来管理 Gitcafe 的Pages 发布Blog!
以 MAC/Linux 下的操作为例:
$ cd /path/2/你的本地工作仓库目录
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/gitcafe-pages
remotes/origin/master
# 观察当前分支, 我们应该使用 gitcafe-pages 进行撰写
$ git checkout -b gitcafe-pages remotes/origin/gitcafe-pages
Branch gitcafe-pages set up to track remote branch gitcafe-pages from origin.
Switched to a new branch 'gitcafe-pages'
# 创建本地分支,并指定远程分支的对应关系
$ git br -a
* gitcafe-pages
master
remotes/origin/HEAD -> origin/master
remotes/origin/gitcafe-pages
remotes/origin/master
# 确认变化,当前已经切换到 gitcafe-pages 分支
$ git pl cafe gitcafe-pages
From gitcafe.com:Liebao/Liebao
* branch gitcafe-pages -> FETCH_HEAD
Already up-to-date.
# 下拉所有当前分支内容
# 以上是第一次建立本地工作仓库的操作,以后就不用了...
$ cd _posts
# 创建 yyyy-mm-dd-E文标题名.md 的文本
# 使用自个儿喜爱的编辑器编辑
# 确保前8行类似以下:
---
layout: post
title: 你好,世界
description: 永远的 Hallo World
categories: Programming
tags: md hallo
---
$ git status
# On branch gitcafe-pages
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: README.md
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git add .
$ git ci -m "变更说明 commit log..."
# On branch gitcafe-pages
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: README.md
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git push cafe
Counting objects: 9, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 1.31 KiB, done.
Total 5 (delta 3), reused 0 (delta 0)
To git@gitcafe.com:Liebao/Liebao.git
5e74faf..4e0ada2 gitcafe-pages -> gitcafe-pages
# 推送你的修訂,到远程仓库
$ git pull cafe gitcafe-pages
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From gitcafe.com:Liebao/Liebao
4e0ada2..3c4bcca gitcafe-pages -> origin/gitcafe-pages
Updating 4e0ada2..3c4bcca
Fast-forward
README.md | 37 ++++++++++++++++++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)
# 同步仓库cafe 中他人的增补到指定分支 gitcafe-pages 中
# 如果有冲突先要解决冲突,再增补,push
以 MAC/Linux 下的操作为例:
$ git clone git@gitcafe.com:Liebao/Liebao.git
$ git checkout -b gitcafe-pages
Switched to branch 'gitcafe-pages'
$ cd Liebao/_posts
# 创建 yyyy-mm-dd-E文标题名.md 的文本
# 使用自个儿喜爱的编辑器编辑
$ git add .
$ git ci -m "变更说明 commit log..."
$ git push
在本地部署 Jekll 环境,随时发布本地网站看最终效果!
安装:
- Ruby
- 通过 gem 安装 Jekll
Jekll 虽然简单,但是依赖相关的文本格式,非常精确,常见jekyll使用出错:
Configuration from /home/lazy/atttx123.github.com/_config.yml
Building site: /home/lazy/atttx123.github.com -> /home/lazy/atttx123.github.com/_site
/usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/convertible.rb:81:in `do_layout': fined method `name' for <Post: /2012/04/26/hello-world>:Jekyll::Post (NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/post.rb:189:in `render'
from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:193:in `render'
from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:192:in `each'
from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:192:in `render'
from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:40:in `process'
from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/bin/jekyll:250
from /usr/bin/jekyll:19:in `load'
from /usr/bin/jekyll:19
- 多半引发错误的是因为post文件夹下的日志文件里面有无法编译的内容比如"{%%}" 之类的特殊符号,这样会引发错误,最好的方法是使用排除法,来确定引发错误的位置,以后避免
- 需要这么设置: {% highlight language %} your code {% endhighlight %}
- 结束声明不是 end highlight
- 否则,会出错! 表现起来就是 gitcafe 好象不编译出新的内容修订了!
- 搭建一个免费的,无限流量的Blog----github Pages和Jekyll入门 - 阮一峰的网络日志
- Github Pages极简教程 - 雁起平沙的网络日志
- Mort | 像黑客一样写博客——Jekyll入门
- 190320 ZQ 恢复为 gh-pages
- 121219 以 zhouqi 角度描述使用 SourceTree 的过程
- 121214 以 Zoom.Quiet 角度描述创建过程