Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog...
Transcript of Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog...
![Page 1: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/1.jpg)
Shonku DocumentationRelease 0.1
Kushal Das
Jul 14, 2017
![Page 2: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/2.jpg)
![Page 3: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/3.jpg)
Contents
1 History of the project 3
2 Installation 52.1 Install golang . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Install the dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 Get the latest Shonku code 7
4 Building the source 9
5 Rebuilding bindata for default theme 11
6 Usage 136.1 Creating new site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136.2 Writing a new post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136.3 Building your post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136.4 Force rebuild of the whole site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146.5 Details of each post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146.6 Individual author per post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7 Configuration 15
8 Contributors 17
9 Theming 199.1 Secondary Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
10 Indices and tables 21
i
![Page 4: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/4.jpg)
ii
![Page 5: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/5.jpg)
Shonku Documentation, Release 0.1
Shonku is a static blog generator written in golang.
Contents:
Contents 1
![Page 6: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/6.jpg)
Shonku Documentation, Release 0.1
2 Contents
![Page 7: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/7.jpg)
CHAPTER 1
History of the project
More than a year back I was introduced to Nikola, a static blog/site generator written in Python. It completely changedmy view about blogs. Blogging suddenly became simple again and I started spending more time in writing thanthinking about formatting etc.
But I was having problem in maintaining my theme and dependencies between upgrades also increased (which is agood thing in one way as the upstream is adding a lot of features in Nikola).
I started shonku from there with a hope to keep it as simplified Nikola written in golang. It works very fast too.
3
![Page 8: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/8.jpg)
Shonku Documentation, Release 0.1
4 Chapter 1. History of the project
![Page 9: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/9.jpg)
CHAPTER 2
Installation
Install golang
Download golang from here , extract go directory under your home directory.
$ mkdir ~/gocode
Now write the following lines in your ~/.bashrc file.
export PATH=$PATH:~/go/binexport GOPATH=~/gocode/export GOROOT=~/go/
and then
$ source ~/.bashrc
Install the dependencies
After golang installation, get the dependent libraries.
$ go get github.com/russross/blackfriday$ go get github.com/gorilla/feeds
$ go get code.google.com/p/go.net/html
5
![Page 10: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/10.jpg)
Shonku Documentation, Release 0.1
6 Chapter 2. Installation
![Page 11: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/11.jpg)
CHAPTER 3
Get the latest Shonku code
Use git to clone the repository
$ git clone https://github.com/kushaldas/shonku.git
7
![Page 12: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/12.jpg)
Shonku Documentation, Release 0.1
8 Chapter 3. Get the latest Shonku code
![Page 13: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/13.jpg)
CHAPTER 4
Building the source
$ make
This should create a binary called shonku.bin.
9
![Page 14: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/14.jpg)
Shonku Documentation, Release 0.1
10 Chapter 4. Building the source
![Page 15: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/15.jpg)
CHAPTER 5
Rebuilding bindata for default theme
In case you make any changes to the default theme, you want those changes inside the binary file also. For that issuethe following command before building the binary.
$ go-bindata assets/... templates/
Note: Remember to install go-bindata from here.
11
![Page 16: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/16.jpg)
Shonku Documentation, Release 0.1
12 Chapter 5. Rebuilding bindata for default theme
![Page 17: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/17.jpg)
CHAPTER 6
Usage
Note: We support only Markdown format. You can learn it very fast and use any text editor to edit.
Creating new site
First go to an empty directory and run the following command.
$ ./shonku.bin -new_site
This will create the required files and directories for shonku to run.
Writing a new post
To write a new blog post do the following command.
$ ./shonku.bin -newEnter the title of the post: Hello WorldYour new post is ready at ./posts/hello-world.md
As the output shows your first blog post is ready. Make the changes as you want in that file.
Note: Remember to keep a blank line at the end of each post or page.
Building your post
Just run the following command.
13
![Page 18: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/18.jpg)
Shonku Documentation, Release 0.1
$ ./shonku.bin{SITE AUTHOR SITE TITLE http://localhost/ Copyright 2014 yourdisqus author@email→˓Description of the site URL for logo [{/pages/about-me.html About} {/categories/→˓Categories} {/archive.html Archive}]}Building post: ./posts/hello-world.md
You can check the output directory for the finished blog post.
Force rebuild of the whole site
$ ./shonku.bin -force
The above command will rebuild the whole site. You may want to use this command when you make any change toyour theme or configuration file.
Details of each post
When you create a new post it will contain something similar to the details below
<!--.. title: Hello World.. slug: hello-world.. date: 2014-05-19T12:15:41+05:30.. tags: Blog.. link:.. description:.. type: text-->
Write your post here.
You can add more tags to the post, they are comma separated. This post format is same of Nikola v7.x, that means itis interchangable between these two blog engines.
Individual author per post
We can have individual author for each post. Just add the following line in any of the post where you want a differentauthor (do it in the comments as show in above).
.. author: AUTHOR NAME
14 Chapter 6. Usage
![Page 19: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/19.jpg)
CHAPTER 7
Configuration
Shonku works based on a JSON configuration file based on the primary directory. It is conf.json. Various values of thefile is explained below.
• “Author” - is the site author’s name.
• “Title” - is the title of the blog.
• “URL” - is the url of the blog. Remember to give the trailing slash in the url.
• “Description” - long description of the site.
• “Logo” - Url of the logo for the blog.
• “Content_footer” - footer text
• “Email” - Author’s email.
• “Disqus” - your disqus name for dynamic comments.
• “Links” - For the links in the header of each page.
• “WithAMP” - If you have true for this, then it will try to build AMP post pages (you need output/posts/ampdirectory
for this to work.
15
![Page 20: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/20.jpg)
Shonku Documentation, Release 0.1
16 Chapter 7. Configuration
![Page 21: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/21.jpg)
CHAPTER 8
Contributors
Names are not in any particular order.
• Bibhas : Wrote the patch for the slug creation.
• Siddhesh : Contributor to many different parts of the codebase.
17
![Page 22: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/22.jpg)
Shonku Documentation, Release 0.1
18 Chapter 8. Contributors
![Page 23: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/23.jpg)
CHAPTER 9
Theming
We have a very simple theme in Shonku and one can easily modify the theme.
The primary directory to keep in mind is templates. This is where all template files are. If you make any changes tothe templates remember to do a force build of the site.
All static files required for the current theme are located in the assests directory. You can add any static file there.
Secondary Themes
We are slowing building a list of secondary themes. Most of these themes are following Nikola themes only.
• Shankoplast
You can download the latest version of these themes from github. Feel free to submit your own theme.
19
![Page 24: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/24.jpg)
Shonku Documentation, Release 0.1
20 Chapter 9. Theming
![Page 25: Shonku Documentation - Read the Docs · Shonku Documentation, Release 0.1 Shonku is a static blog generator written in golang. Contents: Contents 1](https://reader034.fdocuments.in/reader034/viewer/2022052519/5f816acc28abff3e4b48c718/html5/thumbnails/25.jpg)
CHAPTER 10
Indices and tables
• genindex
• modindex
• search
21