8000 GitHub - wuaizxd/wkevin.github.io: wkevin's blog
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

wuaizxd/wkevin.github.io

 
 

Repository files navigation

Kevin's Blog

  • Github Pages base on Jekyll
  • Init
    • gem install jekyll bundle
    • jekyll new wkevin.github.io
    • cd wkevin.github.io
    • bundle exec jekyll serve
  • _config.yml
    • _config.yml 是给 jekyll servejekyll build使用的
    • jekyll official
    • 修改后需要重启 jekyll serve
  • Gemfile
    • Github Pages 有默认的 Gemfile,用户不需要上传:git rm Gemfile
    • 本地浏览如果需要模拟 Github Pages,修改:
      • 注释 gem "jekyll"
      • 打开 gem "github-pages", group: :jekyll_plugins
  • Config theme
    • 一些theme是gem打包发布的,用户的文档中不会出现_layout_css等内容,本地和远程只需指定theme:xxxremote_theme:xxx
      • 本地 bundle 安装了 theme 后,可以使用 bundle show xxx 查看其具体内容,学习或修改
    • 一些theme而是以源码发布的,需要用户forkgit clone_layout_css等内容到自己的文件夹中。
    • 不同的theme会有不同的配置项,如:layout:xxx,需要读其说明,仔细配置
    • Github Pages 把 theme 分 2 类:
      1. officially supported themes: theme: xxx,都已gem化。
        • Blog使用: 自动搜索 _posts 目录并生成瀑布流文章列表
          • theme: minima —— jekyll new 时默认
        • 网站使用: 自己组织链接,不支持page、post
          • theme: jekyll-theme-cayman
          • 其他的都是,所以要想写blog,还得用下面的 remote_theme
      2. open source Jekyll theme hosted on GitHub
        • remote_theme: xxx —— 需要该theme已经gem化,Github Pages能够在云端找到并安装
          • https://github.com/mmistakes/minimal-mistakes
          • https://github.com/mmistakes/so-simple-theme —— 简洁、大方,本Blog使用
            • 简要说明
              • data/navigation.yml 定义导航栏
              • 10种layout:home, posts, post, collection(等同pages), page, categories, category, tags, tag, search.
              • 2种 entries_layout : list, grid
            • 个性化配置方法
              • _config.yml 中可以在 [head|footer]_scripts 中添加 js 的路径,注意是下滑线
              • bundle show jekyll-theme-so-simple 查看本插件源文件的位置
              • 从源文件中拷贝 _includes/[head|footer]-custom.html 到blog目录下,根据情况修改
              • 从源文件中拷贝 assets/css/main.scss 到blog目录下,酌情修改
              • 从源文件中拷贝 assets/js/main.js 到blog目录下,酌情修改
            • 我的配置:
              • 根目录下的 .md 文件对应每个子目录:posts、categories、tags、ai、auto、search —— 其中 posts、ai、auto 包含md文件,其他是视图
                • _config.yml 中定义了默认值:随笔是post,其他是page —— 不需要每篇文章中再定义
              • posts、ai、auto 分别对应 _post_ai_auto 文件夹 —— _config.yml 中定义的path
              • 根目录下的 ai/auto/it.md 中定义了 entries_layout 使用 grid
        • fork -- modify
  • Others
  • 其他说明
    • 新建post可以用 ./newpost.sh,同时创建一个post 及其images下的同名文件夹放图片

About

wkevin's blog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.2%
  • CSS 2.0%
  • Shell 1.1%
  • Other 0.7%
0