#The step-by-step tutorial to create the blog
建立工作文档
mkdir project_name
进入文件夹并对目录初始化
cd project_name
git init
创建一个没有父节点的分支gh-pages该分支中的页面将会生成网页文件
git checkout --orphan gh-pages
创建设置文件
根目录下建立_config.yml,这个是jekyll的设置配置文件
baseurl: /project_name
创建模板文件
在根目录下创建_layouts文件夹,用来放置模板文件
在_layouts文件夹中创建模板文件
创建default.html文件,作为blog的默认模板
在project根目录中创建一个_posts目录,用来存放blog文章
mkdir _posts
在_posts文件夹中写文章,html或者是markdown都可以
文章头部必须要有一个yaml文件头,设置元数据,三根短线开头---,---结尾
包括 layout: default
title: #网页的头显示
同时,文件必须符合年-月-日-文件名.文件后缀名
在根目录里需要创建一个index.html或者是md文件
其中需要放置yaml文件头信息
发布内容
在根目录下
git add .
git commit -m "注释说明"
在github中建立一个存储仓库project_name
git remote add alias https://github.com/username/project_name.git
git push alias gh-pages
目录文件的参考模板
---
layout: default
title: 我的Blog
---
<h2>Start my blog</h2>
<p>最新文章</p>
<ul>
<li>01 Apr 2020 <a href="/tuanzi/">团子</a></li>
<li>12 Aug 2014 <a href="/git_use_experience/">gitstudy</a></li>
<li>06 Aug 2014 <a href="/how-to-build-a-blog/">Start my blog</a></li>
<li>04 Aug 2014 <a href="/Tips-on-learning-languags/">study foreign language</a></li>
<li>03 Aug 2014 <a href="/Text-similarity/">Text Similarity</a></li>
<li> <a href="/2014-8-10-rubynotes/"></a></li>
<li>01 Nov 2014 <a href="/web/">web notes</a></li>
<li>07 Oct 2014 <a href="/js_notes/">js notes</a></li>
<li>09 Sep 2014 <a href="/google_form_script_notes/">google form script notes</a></li>
<li>16 Aug 2014 <a href="/django_note/">Django_note</a></li>
<li>27 Jul 2014 <a href="/R-notes/">R notes</a></li>
<li>24 Jul 2014 <a href="/python_notes/">Python notes</a></li>
</ul>
** _post中文章的参考模板 **
---
layout: default
title: 你好,世界
---
<h2>Start my blog</h2>
<p>我的第一篇文章</p>
<p>06 Aug 2014</p>
blog的参考默认模板
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Start my blog</title>
</head>
<body>
<p>##The five principles</p>
- Focus on language content that is relevant to you
- Use your language as a tool to communicate from day 1
- When you understand the message you will acquire the language unconsciously
- Language is not about accumulating a lot of knowledge but is rather a type of physiological training
- Psycho-physiological state matters - you need to be happy, relaxed, and most importantly, you need to be tolerant of ambiguity. Don’t try to understand every detail as it will drive you crazy.
##The seven actions
- Listen a lot - it doesn’t matter if you understand or not. Listen to rhythms and patterns
- Focus on getting the meaning first, before the words. Body language and facial expressions can help
- Start mixing, get creative, and use what you’re learning
- Focus on the core - use the most commonly - use the words, and use the language to learn more
- Get a language parent - someone who is fluent in the language and who will do their best to understand what you mean; who will not corrent your mistakes; who will feedbac their understanding of what you’re saying using correct language, and uses words that you know
- Copy the face - watch native speakers and observe their face, and particular their mouth moves whrn they’re speaking
- “Direct connect” to the target language - find ways to connect words directly with images and other internal representations
</body>
</html> ###使用现成模板的整个方法
git clone https://github.com/krisb/jekyll-template.git mysite
cd mysite
rm -rf .git
git init
git add -A
git commit -m 'initial template based on https://github.com/krisb/jekyll-template'
git remote add origin git@github.com:username/reponame.git
git push -u origin master ###git 的一些操作技巧
修改本地源名对应的远程地址
git remote set-url origin https://github....
直接删除本地源
git remote remove origin 显示所有的源
git remote show origin
references:
http://gogojimmy.net/2012/01/17/how-to-use-git-1-git-basic/
http://richohan.github.io/yong-pelican-github-pagejian-li-ge-ren-bu-luo-ge.html#.U93vku3ka9L
http://www.ruanyifeng.com/blog/2012/08/blogging_with_jekyll.html
http://site.douban.com/196781/widget/notes/12161495/note/264946576/
https://www.andrewmunsell.com/tutorials/jekyll-by-example/introduction
http://trefoil.github.io/2013/10/05/jekyll.html