1 Star 0 Fork 0

0xTrustTryEP/draft

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
git-page-blog.md 9.47 KB
一键复制 编辑 原始数据 按行查看 历史

Github Page


在创建github page之前,最好阅读、了解ruby及相关命令和markdown,yaml,jekyll,liquid相关知识概念,再操作。

快速搭建博客

Create Blog

在搭建github page博客前,最后先看看别人如何搭建的 :
利用 GitHub Pages 快速搭建个人博客

Github Pages + Jekyll 独立博客一小时快速搭建&上线指南

搭建一个免费的,无限流量的Blog----github Pages和Jekyll入门

手把手教你用github pages搭建博客 最新版

theme

创建github.io blog仓库,进入仓库主页,点击Settting,进入仓库配置界面,然后修改主题: change themes

jeckyll主题选择,Creating a GitHub Pages site with the Jekyll Theme Chooser:
creating-a-github-pages-site-with-the-jekyll

architect主题: architect

选择主题时可以选择fork,或选择下载主题包,放到自己本地的github.io项目中。

安装ruby(jekyll:blog运行环境)

install ruby

先按照下面链接安装ruby和ruby开发包及jekyll,注意不要忘了安装ruby开发包
Running Jekyll on Windows

如果有插件不存在,可以参考下面的文章
Jekyll With Usefule Plugins

启动项目出现以下错误时

donald@donaldHP MINGW64 /f/github.io/Donaldhan.github.io (master)
$ jekyll serve
D:/Ruby23-x64/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/resolver.rb:288:in \`block in verify_gemfile_dependencies_are_found!': Could not find gem 'github-pages x64-mingw32' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)
        from D:/Ruby23-x64/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/resolver.rb:256:in \`each'
        from D:/Ruby23-x64/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/resolver.rb:256:in \`verify_gemfile_dependencies_are_found!'
        from D:/Ruby23-x64/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/resolver.rb:48:in \`start'
        from D:/Ruby23-x64/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/resolver.rb:22:in \`resolve'
        from D:/Ruby23-x64/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/definition.rb:257:in \`resolve'
        from D:/Ruby23-x64/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/definition.rb:170:in \`specs'
        from D:/Ruby23-x64/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/definition.rb:237:in \`specs_for'
        from D:/Ruby23-x64/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/definition.rb:226:in \`requested_specs'
        from D:/Ruby23-x64/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:108:in \`block in definition_method'
        from D:/Ruby23-x64/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:20:in \`setup'
        from D:/Ruby23-x64/Ruby23-x64/lib/ruby/site_ruby/2.3.0/bundler.rb:107:in \`setup'
        from D:/Ruby23-x64/Ruby23-x64/lib/ruby/gems/2.3.0/gems/jekyll-3.6.2/lib/jekyll/plugin_manager.rb:50:in \`require_from_bundler'
        from D:/Ruby23-x64/Ruby23-x64/lib/ruby/gems/2.3.0/gems/jekyll-3.6.2/exe/jekyll:11:in \`<top (required)>'
        from D:/Ruby23-x64/Ruby23-x64/bin/jekyll:23:in \`load'  

可以按照如下做法:

  1. 如果没有安装bundle gem install bundle
  2. jekyll-blog目录创建Gemfile文件,内容参考链接
  3. 运行bundle,安装Gemfile里的插件(姑且叫插件吧,我也不知道叫啥 bundle install
  4. 打开服务 bundle exec jekyll serve or jekyll serve

整理Ruby相关的各种概念(rvm, gem, bundle, rake, rails等)

遇到如下问题:

GitHub Metadata: No GitHub API authentication could be found. Some fields ma  

做法如下:

This is what I did to resolve this problem:

  1. Create GitHub personal token
  2. Add the JEKYLL_GITHUB_TOKEN env variable whose content is the created token
  3. Download the CA cert file from pem
  4. Add the SSL_CERT_FILE env variable pointing to the download .pem file.

I also wrote a blog post about this case here.

出现如下问题:

F:\github.io\Donaldhan.github.io>bundle exe jekyll serve --incremental
Configuration file: F:/github.io/Donaldhan.github.io/\_config.yml
Source: F:/github.io/Donaldhan.github.io
       Destination: F:/github.io/Donaldhan.github.io/\_site
 Incremental build: enabled
      Generating...
  Liquid Exception: Invalid Repository. Use user/repo format. in /\_layouts/default.html

则修改_config.yml文件,中的github常量为:

github.repository_url: Donaldhan.github.io.git
repository: Donaldhan/Donaldhan.github.io.git

分页、分类、标签

paginate

分页配置

category

Jekyll & Liquid: Output category list with post count?
下面一个是第二种展示category的方式,我没有试过,我是以上面的一个连接为准。 3 Simple steps to setup Jekyll Categories and Tags

Tags

How to create a category/tags page in Jekyll without a list of posts for that tag?

给jekyll添加炫酷简洁的搜索

Jekyll

http://jekyll.com.cn/

https://jekyllrb.com/

Jekyll style guide

An opinionated guide to common Jekyll design patterns and anti-patterns.

https://Donaldhan.github.io

Markdown

markdown document

Markdown 语法说明 (简体中文版)

认识与入门 Markdown

献给写作者的 Markdown 新手指南

好用的Markdown编辑器一览

online

mahua

简书

client

MarkdownPad

atom

YAML

YAML 语言教程 | YAML 简介

Liquid

Liquid官网
Liquid中文简介
Jekyll/Liquid API 语法文档
Liquid 语言基础

在拥有上面所列的知识,我们可以尝试添加一个静态的全文搜索功能,可以参照如下链接:

search

Jekyll search组件
使用Tapir为Jekyll博客实现全局搜索
Jekyll + lunr jsblocks 强大的全文搜索,使用Javascript,在浏览器中搜索Jekyll静态网站
indextank-jquery is a bunch of little building blocks to make your search UX better
基于liquid的Jekyll Tipue Search

建议使用基于liquid的Jekyll Tipue Search,这个上手速度快,jekyll-lunr-js-search也不错,不过要安装 jekyll-lunr-js-search插件,这个要看运气了。

###Python 2.7.14 Python download
Python2.7教程

Mustache

学习笔记《Mustache》
主页
文档

Bower

Bower
bower简明入门教程

gitalk

Jekyll+多说,建立属于你的轻博客

disqus

一个基于 Github Issue 和 Preact 开发的评论插件 gitalk
gitalk github项目地址

Gitment

本身想用多说呢,但多说已死。 gitment与gitalk非常相似,建议使用gitalk。

几款GitHub安卓客户端的使用体验总结

Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/Donaldhans/draft.git
git@gitee.com:Donaldhans/draft.git
Donaldhans
draft
draft
master

搜索帮助