alissli / Growing-journeys

2 stars 0 forks source link

instructing my own blog #22

Open alissli opened 6 years ago

alissli commented 6 years ago

背景

alissli commented 6 years ago

ref:Think Like (a) Git

alissli commented 6 years ago

思考:假如不使用git,能否搭建一个博客

alissli commented 6 years ago
alissli commented 6 years ago

此路不通的话,从头尝试。 受tianjie仓库启发,将原有仓库改名。

alissli commented 6 years ago

https://help.github.com/articles/about-github-pages-and-jekyll/

alissli commented 6 years ago

All posts must have YAML Front Matter 所有文章需要YAML表头

YEAR-MONTH-DAY-title.MARKUP 文件命名格式必须按照上面来,markup指文件扩展名(比如.html, .md) 范例:2011-12-31-new-years-eve-is-awesome.md

alissli commented 6 years ago

如果参考beiyuu的基本Jekyll结构, 自己去写诸如_config.yml,default.html等,需要看完jeklly的帮助,并且有???编程基础:

基本的Jekyll结构如下:

|-- _config.yml
|-- _includes
|-- _layouts
|   |-- default.html
|   `-- post.html
|-- _posts
|   |-- 2007-10-29-why-every-programmer-should-play-nethack.textile
|   `-- 2009-04-26-barcamp-boston-4-roundup.textile
|-- _site
`-- index.html

尝试2: 在尝试1的基础上,参考beiyuu修改. 但是我不知道哪些是必须的,哪些是不需要的。最简单的高效的方法还是直接去fork仓库,然后大概看下代码中哪些需要改成自己的。我不太想要他的风格,去找其他的仓库fork,更改尝试1中的仓库alissli.github.io为alissli01.github.io

主题参考:

forkTrophy之后,更改仓库名称为alissli.github.io,失败

尝试3:将alissli01.github.io改回alissli.github.io,下载Trophy,解压文件,将所有文件上传至仓库alissli.github.io;通过网页上传,发现文件夹无法上传,改用github desktop上传。

无法更改gh-branch作为source,失败

尝试4:将尝试3的仓库alissli.github.io改为alissli01.github.io,然后fork夏雨莲的仓库。删除index.html和CNAME。 ref: 阮一峰

alissli commented 6 years ago

搭建

尝试0:fork夏雨莲的仓库,将index.html删除。可以实现readme页面 default

推测下一步的尝试是按readme中的installation提示,删除gh-pages,再生成新的gh-pages branch

Installation: Fork the master branch and delete gh-pages branch in it. This is important because gh-pages branch is used here only to host the blog. You should be using the master branch as the source and create a fresh gh-pages branch.

尝试1:复制阮一峰博文中的index.html代码。失败。

尝试2:找到 Yulianxia 使用的jekylltheme的模板仓库,复制index.html源码,提交,成功! default

alissli commented 6 years ago

GitHub Pages分两种,一种是你的GitHub用户名建立的username.github.io这样的用户&组织页(站),另一种是依附项目的pages。(via beiyuu)

ref:github帮助文档

alissli commented 6 years ago

Jekyll基本结构

Jekyll的核心其实就是一个文本的转换引擎,用你最喜欢的标记语言写文档,可以是Markdown、Textile或者HTML等等,再通过layout将文档拼装起来,根据你设置的URL规则来展现,这些都是通过严格的配置文件来定义,最终的产出就是web页面。(via beiyuu)

ref: beiyuu