Skip to content

Commit

Permalink
Merge pull request #146 from w568w/master
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
imeoer authored Feb 13, 2023
2 parents 1c84f7b + a37d986 commit 382d373
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 42 deletions.
97 changes: 75 additions & 22 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,24 @@ InkPaper is a static blog generator developed in Golang. No dependencies, cross

![InkPaper - An Elegant Static Blog Generator](template/source/images/example-en.png)

### Features
- YAML format configuration
- Markdown format articles
- No dependencies, cross platform
- Super fast build times
- Continuously improving theme and typography
- Multiple article authors support
- Archive and tag generation
- Real-time preview when saving
- Offline full-text keyword search
- $\LaTeX$ style math formula support (MathJax):

$$
\int_{-\infty}^\infty g(x) dx = \frac{1}{2\pi i} \oint_{\gamma} \frac{f(z)}{z-g(x)} dz
$$

### Quick Start
- Download & Extract [Ink](https://imeoer.github.io/) and run `ink preview`
- Download & Extract [Ink](https://github.com/InkProject/ink/releases) and run `ink preview`

> Tip:Linux/macOS, use `./ink preview`
Expand All @@ -23,19 +39,19 @@ site:
limit: Max Article Count Per Page
theme: Website Theme Directory
comment: Comment Plugin Variable (Default is disqus username)
root: Website Root Path #Optional
lang: Website Language #Support en, zh, ru, ja, de, Configurable in theme/lang.yml
url: Website URL #For RSS Generating
link: Article Link Scheme #Default Is {title}.htmlSupport {year},{month},{day},{hour},{minute},{second},{title} Variables
root: Website Root Path # Optional
lang: Website Language # Support en, zh, ru, ja, de, pt-br, configurable in theme/lang.yml
url: Website URL # For RSS generating
link: Article Link Scheme # Default is {title}.html, Support {year}, {month}, {day}, {hour}, {minute}, {second}, {title} variables

authors:
AuthorID:
AuthorID: # Your author ID, used in article's author field
name: Author Name
intro: Author Motto
avatar: Author Avatar Path

build:
output: Build Output Directory #Optional, Default is "public"
output: Build Output Directory # Optional, default is "public"
port: Preview Port
copy:
- Copied Files When Build
Expand All @@ -48,19 +64,19 @@ Create a `.md` file in the `source` directory (Supports subdirectories). Use thi

``` yaml
title: Article Title
date: Year-Month-Day Hour:Minute:Second #Created TimeSupport TimeZone, such as " +0800"
update: Year-Month-Day Hour:Minute:Second #Updated Time,Optional,Support TimeZone, such as " +0800"
date: Year-Month-Day Hour:Minute:Second #Created Time. Support timezone, such as " +0800"
update: Year-Month-Day Hour:Minute:Second #Updated Time, optional. Support timezone, such as " +0800"
author: AuthorID
cover: Article Cover Path #Optional
draft: false #If Draft,Optional
top: false #Place article to top, Optional
preview: Article PreviewAlso use <!--more--> to split in body #Optional
tags: #Optional
cover: Article Cover Path # Optional
draft: false # Is draft or not, optional
top: false # Place article to top or not, optional
preview: Article Preview, Also use <!--more--> to split in body # Optional
tags: # Optional
- Tag1
- Tag2
type: post #Specify type is post or page, Optional
hide: false #Hide articlecan be accessed via URL, Optional
type: post # Specify type is post or page, optional
hide: false # Hide article or not. Hidden atricles still can be accessed via URL, optional
toc: false # Show table of contents or not, optional
---
Markdown Format's Body
Expand All @@ -70,7 +86,7 @@ Markdown Format's Body
- Run `ink publish` in the blog directory to automatically build and publish
- Or run `ink build` to manually deploy generated `public` directory

> **Tips**: When `source` directory changed`ink preview` will automatically rebuild the blog. Refresh browser to update
> **Tips**: When files changed, `ink preview` will automatically rebuild the blog. Refresh browser to update.

## Customization

Expand All @@ -84,6 +100,43 @@ page `page.html` (article list) and `article.html` (article), use variable with

Created any `.html` file will be copied to `source` directory, could use all variables on `site` field in `config.yml`.


#### Define Custom Variables
InkPaper supports defining custom variables in pages, which must be placed under `site.config` in `config.yaml`, such as:

``` yaml
site:
config:
MyVar: "Hello World"
```

The variable can be referenced in the page by `{{.Site.Config.MyVar}}`.

> **Note**
>
> Although the field names in other parts of `config.yaml` are all lowercase, the name of the custom variable must be used correctly. Otherwises, such a variable:
>
> ```yaml
> site:
> config:
> MYVAR_aAa: "Hello World"
> ```
> must be referenced in the page as `{{.Site.Config.MYVAR_aAa}}`.

#### Use Functions (Experimental)

InkPaper defines a minimal set of functions that can be used in HTML pages (except for `.md` source files), such as

``` yaml
{{ readFile "path/to/file" }}
```

This will read the content of the file `path/to/file` and include it in the page without any processing.

For file-related functions, when executed in the `source` directory, the file path is relative to the `source` directory; when executed in other directories, the file path is relative to the theme (such as `theme`).

See the source file `funcs.go` for a list of all functions.

### Blog Migration (Beta)

Supports simple Jeklly/Hexo post convertions. Usage:
Expand All @@ -94,13 +147,13 @@ ink convert /path/_posts

### Building from source

Local Build ([for go 1.18](https://go.dev/doc/go-get-install-deprecation)
**Local Build**

1. Install [Golang](http://golang.org/doc/install) environment
2. Run `go get github.com/InkProject/ink`, compile and get ink
3. Run `ink preview $GOPATH/src/github.com/InkProject/ink/template`, preview blog
2. Run `git clone https://github.com/InkProject/ink && cd ink && go install` to compile and install ink
3. Run `ink preview $GOPATH/src/github.com/InkProject/ink/template` to preview blog

Docker Build (Example)
**Docker Build (Example)**

1. Clone code `git clone git@github.com:InkProject/ink.git`
2. Build image `docker build -t ink .` in source directory
Expand Down
14 changes: 4 additions & 10 deletions template/source/ink-blog-tool-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ preview: InkPaper is a static blog generator developed in Golang. No dependencie

---

> **⚠Note:** This is a copy of the old version of Ink documentation, only for showing rendering effect, and its content is not up to date. **DO NOT rely on the instructions below to use Ink!** Please visit [our repository](https://github.com/InkProject/ink/) to get the latest documentation.
## Introduction

InkPaper is a static blog generator developed in Golang. No dependencies, cross platform, easy to use, fast building times and an elegant theme.
Expand Down Expand Up @@ -160,8 +162,8 @@ ink convert /path/_posts
Local Build

1. Install [Golang](http://golang.org/doc/install) environment
2. Run `go get github.com/InkProject/ink`, compile and get ink
3. Run `ink preview $GOPATH/src/github.com/InkProject/ink/template`, preview blog
2. Run `git clone https://github.com/InkProject/ink && cd ink && go install` to compile and install ink
3. Run `ink preview $GOPATH/src/github.com/InkProject/ink/template` to preview blog

Docker Build (Example)

Expand All @@ -184,14 +186,6 @@ Docker Build (Example)

[https://github.com/InkProject/ink/issues](https://github.com/InkProject/ink/issues)

## Change Log

- [2016-07-11] Fix bugs and merge many PRs
- [2015-08-15] Bug fix, support RSS feed, improve theme
- [2015-07-04] Bug fix, improve theme, support top, i18n, subtemplate
- [2015-06-04] Build more platform, add archive and tag page
- [2015-03-01] Release first beta version

## Development Roadmap

- Improve Theme
Expand Down
14 changes: 4 additions & 10 deletions template/source/ink-blog-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ preview: 纸小墨(InkPaper)是一个GO语言编写的开源静态博客构

---

> **⚠注意:** 这是纸小墨的旧版本文档的副本,仅用于展示渲染效果,内容不具有参考性,**请勿依赖下文的内容使用纸小墨**!请访问[我们的仓库](https://github.com/InkProject/ink/)以获取最新文档。
## 纸小墨简介

纸小墨(InkPaper)是一个GO语言编写的开源静态博客构建工具,可以快速搭建博客网站。它无依赖跨平台,配置简单构建快速,注重简洁易用与更优雅的排版。
Expand All @@ -18,7 +20,7 @@ preview: 纸小墨(InkPaper)是一个GO语言编写的开源静态博客构

### 开始上手

- 下载并解压 [Ink](https://imeoer.github.io/),运行命令 `ink preview`
- 下载并解压 [Ink](https://github.com/InkProject/ink/releases),运行命令 `ink preview`

> 注意:Linux/macOS下,使用 `./ink preview`
Expand Down Expand Up @@ -162,7 +164,7 @@ ink convert /path/_posts
本地运行

1. 配置[GO](http://golang.org/doc/install)语言环境。
2. 运行命令`go get github.com/InkProject/ink`,编译并获取ink
2. 运行命令`git clone https://github.com/InkProject/ink && cd ink && go install`编译并安装纸小墨
3. 运行命令`ink preview $GOPATH/src/github.com/InkProject/ink/template`,预览博客。

Docker构建(示例)
Expand All @@ -184,14 +186,6 @@ Docker构建(示例)

纸小墨基于 [CC Attribution-NonCommercial License 4.0](https://creativecommons.org/licenses/by-nc/4.0/) 协议,目前为止它仍然是个非成熟的开源项目,非常欢迎任何人的任何贡献。如有问题可报告至 [https://github.com/InkProject/ink/issues](https://github.com/InkProject/ink/issues)。

## 更新历史

- [2016-07-11] 修复诸多Issue与合并一些PR。
- [2015-08-15] 一些Bug修复,新增RSS订阅支持,主题改善。
- [2015-07-04] 数项Bug修复与主题改善,支持置顶,多语言,子模板。
- [2015-06-04] 编译更多平台版本,增加标签与存档页。
- [2015-03-01] Beta版本,基础功能完成。

## 更新计划

- 排版深度优化
Expand Down

0 comments on commit 382d373

Please sign in to comment.