An elegant static blog generator
InkPaper is a static blog generator developed in Golang. No dependencies, cross platform, easy to use, fast building times and an elegant theme.
$$ \int_{-\infty}^\infty g(x) dx = \frac{1}{2\pi i} \oint_{\gamma} \frac{f(z)}{z-g(x)} dz $$
Download & Extract Ink and run ink preview
Tip:Linux/macOS, use
./ink preview
Open http://localhost:8000 in your browser to preview
Edit config.yml, use this format:
…
Create a .md file in the source directory (Supports subdirectories). Use this format:
…
ink publish in the blog directory to automatically build and publishink build to manually deploy generated public directoryTips: 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/_posts
Local Build
git clone https://github.com/InkProject/ink && cd ink && go install to compile and install inkink preview $GOPATH/src/github.com/InkProject/ink/template to preview blogDocker Build (Example)
git clone [email protected]:InkProject/ink.gitdocker build -t ink . in source directorydocker run -p 8888:80 inkCC Attribution-NonCommercial License 4.0
https://github.com/InkProject/ink/issues
No open issues yet, or sync has not completed.