Documentation


Everything you need to know

Table of contents

Create a website

To install sakin use npm install -g sakin.

Then sakin --init will create a new working directory (website). This contains:

  • contents
    • articles contains all the website posts. By default the homepage displays these articles.
    • pages contains all pages.
  • output
  • static contains the website's assets
  • templates
    • includes
      • after_footer.html
      • footer.html
      • head.html
      • header.html
      • navigation.html
    • article.html
    • base.html
    • category.html
    • index.html
    • page.html
  • .sakin defines a sakin website and contains metadata
  • settings.json

Settings file

settings.json contains all the global settings for the website. Here is the default settings file:

{
    "url": "http://example.com",
    "root_url": "/",
    "author": "Change me",
    "author_page": "http://change-me.com",
    "title": "My awesome blog",
    "subtitle": "Powered by sakin",
    "description": "An amazing blog",
    "page_size": 10,
    "smart_generation": true,
    "custom_index": false,

    "style": {
        "header_background": "#336B59"
    },

    "menu": {
        "Blog": "index",
        "Example": "contents/pages/example.md"
    },

    "disqus": {
        "enabled": false,
        "short_name": "",
        "comment_count": false
    },

    "social": {
        "twitter": true,
        "facebook": true,
        "twitter_page": "#",
        "facebook_page": "#",
        "github_page": "#"
    },

    "tracking": {
        "enabled": false,
        "google_id": ""
    },

    "publish": {
        "medium": "github",

        "github": {
            "repo": "",
            "project": false
        },

        "rsync": {
            "user": "",
            "server": "",
            "location": ""
        }
    }
}

Description

  • author_page: the author website
  • page_size: pagination size for articles/posts displayed in the homepage
  • smart_generation: enables/disables smart generation
  • custom_index: if enabled uses a custom homepage created using the command: sakin --index
  • menu: is a mapping of menu items to locations
  • disqus: defines disqus comment system settings
  • social: the boolean settings indicate the buttons to share articles
  • tracking: defines the Google Analytics settings
  • publish: defines the medium with which you want to deploy your website using sakin --publish

Create an article

sakin --article "Article name here" creates an article with Article name here as a title. The created article is saved in the articles directory with the name article-name-here.md (i.e. slugified).

The file will be structured as follows:

---
title: Article name here
subtitle: An awesome article
author: Change me
author_page: http://change-me.com
categories: examples, tests
date: 2016-04-10
description: Enter description
---

After the metadata you can write the content using Markdown.

If custom_index is set to false then the article will appear in the homepage.

Create a page

sakin --page "Page name here" create a page with Page name here as a title. The created page is saved in the pages directory with the name page-name-here.md.

The file will be structured as follows:

---
title: Page name here
subtitle: An awesome page
description: Enter description
---

N.B. If the page is named index and custom_index is set to true then this will be the homepage.

Content generation

Content generation is the process of taking the markdown content, injecting it in the templates and creating additional pages (such as categories).

To generate use: sakin --generate. If the global setting smart_generation (SG) is set to true then only the modified content items are generated. You can override this behaviour by using the appropriate option: sakin --generate --off-smart (in this case turns SG off).

Previewing

To preview your website use: sakin --serve. This will create a local server using the port 8000. To use another port just supply it in the command as in: sakin --serve 8080.

Publishing

Once you have finished writing you can manually upload the website from the output directory (FTP etc...). If you are using GitHub Pages or rsync use the appropriate setting in settings.json.

Themes

Currently sakin support only the default theme.

Custom themes (coming soon)