InkPaper is a static blog generator developed in Golang. No dependencies, cross platform, easy to use, fast building times and an elegant theme.
- 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):
Download & Extract Ink and run
ink previewTip:Linux/macOS, use
./ink previewOpen
http://localhost:8000in your browser to preview
Edit config.yml, use this format:
site:
title: Website Titlesubtitle: Website Subtitlelimit: Max Article Count Per Pagetheme: Website Theme Directorycomment: Comment Plugin Variable (Default is disqus username)root: Website Root Path # Optionallang: Website Language # Support en, zh, ru, ja, de, pt-br, configurable in theme/lang.ymlurl: Website URL # For RSS generatinglink: Article Link Scheme # Default is {title}.html, Support {year}, {month}, {day}, {hour}, {minute}, {second}, {title} variablesauthors:
AuthorID: # Your author ID, used in article's author fieldname: Author Nameintro: Author Mottoavatar: Author Avatar Pathbuild:
output: Build Output Directory # Optional, default is "public"port: Preview Portcopy:
- Copied Files When Buildpublish: | Excuted command when 'ink publish' is usedCreate a .md file in the source directory (Supports subdirectories). Use this format:
title: Article Titledate: 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: AuthorIDcover: Article Cover Path # Optionaldraft: false # Is draft or not, optionaltop: false # Place article to top or not, optionalpreview: Article Preview, Also use <!--more--> to split in body # Optionaltags: # Optional
- Tag1
- Tag2type: post # Specify type is post or page, optionalhide: false # Hide article or not. Hidden atricles still can be accessed via URL, optionaltoc: false # Show table of contents or not, optional
---
Markdown Format's Body- Run
ink publishin the blog directory to automatically build and publish - Or run
ink buildto manually deploy generatedpublicdirectory
Tips: When files changed,
ink previewwill automatically rebuild the blog. Refresh browser to update.
The default theme is placed in the theme folder, run npm install and npm run build to rebuild in this folder.
page page.html (article list) and article.html (article), use variable with Golang Template syntax.
Created any .html file will be copied to source directory, could use all variables on site field in config.yml.
InkPaper supports defining custom variables in pages, which must be placed under site.config in config.yaml, such as:
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.yamlare all lowercase, the name of the custom variable must be used correctly. Otherwises, such a variable:site: config: MYVAR_aAa: "Hello World"must be referenced in the page as
{{.Site.Config.MYVAR_aAa}}.
InkPaper defines a minimal set of functions that can be used in HTML pages (except for .md source files), such as
{{ 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.
Supports simple Jeklly/Hexo post convertions. Usage:
ink convert /path/_postsLocal Build
- Install Golang environment
- Run
git clone https://github.com/InkProject/ink && cd ink && go installto compile and install ink - Run
ink preview $GOPATH/src/github.com/InkProject/ink/templateto preview blog
Docker Build (Example)
- Clone code
git clone git@github.com:InkProject/ink.git - Build image
docker build -t ink .in source directory - Run container
docker run -p 8888:80 ink
- Dark (Official Theme): https://github.com/InkProject/ink-theme-dark
- Simple: https://github.com/myiq/ink-simple
- Story: https://github.com/akkuman/ink-theme-story
- Material2: https://github.com/w568w/InkMaterialTheme
