Git Product home page Git Product logo

jiangliheng.github.io's Introduction

jiangliheng.github.io

GitHub

快速启动

1. 安装 ruby 和 jekyll 环境

这一步和第5步主要是为了让博客系统在本地跑起来,如果不想在本地运行,可以无视这两步,但我还是强烈建议试着先在本地跑起来,没有什么问题后再推送的 GitHub 上。

Windows 用户可以直接使用 RubyInstaller 安装 ruby 环境。后续的操作中可能还会提示安装 DevKit,根据提示操作即可。

建议使用 RubyGems 镜像- Ruby China 安装 jekyll。

安装 jekyll 命令如下

gem install jekyll

2. 复制博客主题代码

可以直接 clone 、下载 或 fork 这个仓库的代码即可

3. 修改参数

主要修改 _config.yml 中的参数和自己的网站小图favicon.ico

4. 写文章

_posts目录下存放文章信息,文章头部注明 layout(布局)、title、date、categories、tags、author(可选)、mathjax(可选,点击这里查看更多关于Mathjax),如下:

---
layout: post
title:  "对这个 jekyll 博客主题的改版和重构"
date:   2016-03-12 11:40:18 +0800
categories: jekyll
tags: jekyll 端口 markdown Foxit RubyGems HTML CSS
author: Haoyang Gao
mathjax: true
---

下面这两行代码为产生目录时使用

* content
{:toc}

文章中存在的4次换行为摘要分割符,换行前的内容会以摘要的形式显示在主页Home上,进入文章页不影响。

换行符的设置见配置文件_config.yml的 excerpt,如下:

# excerpt
excerpt_separator: "\n\n\n\n"

使用 markdown 语法写文章。

代码风格与 GitHub 上 README 或 issue 中的一致。使用3个```的方式。

5. 本地运行

本地执行

jekyll s

显示

Configuration file: jiangliheng.github.io/_config.yml
            Source: jiangliheng.github.io
       Destination: jiangliheng.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 9.773 seconds.
 Auto-regeneration: enabled for 'jiangliheng.github.io'
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

在本地访问 localhost:4000 即可看到博客主页。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.