Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.
/ dblog Public archive

dblog blog generator, that generates blog from Markdown and JSON file. dblog handles technical parts, so you can focus on hard part writing.

License

Notifications You must be signed in to change notification settings

AnzenKodo/dblog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dblog

License: MIT GitHub Workflow Status (branch)

dblog blog generator, that generates blog from Markdown and JSON file. dblog handles technical parts, so you can focus on hard part writing.

Features

  • Easy to:
    • Setup
    • Configure
    • Write
  • Supports:
  • Auto generate:
    • GitHub Pages Actions file
    • Favicon
    • Sitemap
    • 404 page
    • CSS
    • mainfest.json file
    • Feeds
      • RSS
      • JSON
      • Atom
  • No Client side JavaScript
  • Minified HTML & Inline CSS
  • Lightweight

Getting Started

Installing

  • Download deno from https://deno.land/ and install it.
  • After installing deno run following commands.
# Install the dblog
deno run https://deno.land/x/dblog/install.js # Add deno to path, if you didn't already.

# See all the options that are available
dblog --help

# Setup the your blog (Skip this if already your blog setup)
dblog --setup

# Make your blog and Run on localhost
dblog --serve

Update

To update dblog, rerun the installation command.

deno run https://deno.land/x/dblog/install.js

Run dblog without installing dblog

deno run -A https://deno.land/x/dblog/mod.js --help

Live Demo & Folder

Configuration

Place config.json in root folder to edit default configuration. The config.json is optional.

The config.json with default configuration:

{
  "name": "dblog",
  "start_url": "https://AnzenKodo.github.io/dblog/",
  "description": "dblog blog generator, that generates blog from Markdown and JSON file. dblog handles technical parts, so you can focus on hard part writing.",
  "email": "",
  "author": "AnzenKodo",
  "posts": "./posts",
  "output": "./site",
  "favicon": "favicon.svg",
  "lang": "en-US",
  "port": 8000,
  "background": "#ffffff",
  "foreground": "#000000",
  "theme": "#01a252",
  "footer": "<p>Made by <a href=\"https://AnzenKodo.github.io/AnzenKodo\">AnzenKodo</a> under <a href=\"https://anzenkodo.github.io/dblog/LICENSE\">MIT</a></p>\n",
  "page404": "404 Page Not Found, Sorry :(",
  "backup": false,
  "exclude": [
    "config.json",
    "backup.json"
  ],
  "nav": {},
  "head": ""
}

Note: Every option is optional.

  • name - Name of your blog.
  • start_url - Start URL of your site. Example: 'https://example.com/', 'https://blog.example.com/', 'https://example.com/blog/'
  • email - Your email address. This will enable 'Reply with Email' button in posts.
  • author - Your name or username.
  • posts - Path of posts.
  • output - Folder where your blog build will be placed. Example: './blog', '../site/blog', 'site/blog'.
  • favicon - Recommended 500x500px. Favicon location. If empty, generated favicon will be used. Example: './favicon.png', './static/favicon.icon', '../favicon.jpg'.
  • lang - Blog language in 'RFC 5646' format. Example: 'ja' for Japanese, 'sv' for Swedish, 'it' for Italian. See List of common primary language subtags in Wikipedia
  • footer - Footer of your website. Supports CommonMark Markdown format. Example: Made by [AnzenKodo](https://AnzenKodo.github.io/AnzenKodo) uder [MIT License](https://anzenkodo.github.io/dblog/LICENSE.html).
  • port - Port of your blog on localhost. Example: '8080', '8300', '8400'.
  • background - Background color in light mode. Becomes foreground color in light mode. Example: '#000000', "#ffffff', '##FEFBFE'.
  • foreground - Foreground color in light mode. Becomes background color in light mode. Example: '#000000', "#ffffff', '##FEFBFE'.
  • theme - Blog theme color. Example: '#0583f2', '#f20544', '#f2b705'.
  • page404 - 404 page message. Example: 'Sorry, page not found :('.
  • backup - Backup file location. Example: false to don't generate backup.json file, './backup.json', './site/backup.json', '../backup.json'.
  • exclude - Exclude files or folder. Example:
    "exclude": [ ".env", "todo.md", "drafts" ],
  • nav - Nav bar item list. Example:
    "nav": {
      "about": "./about.md",
      "stie": "https://anzenkodo.github.io/AnzenKodo"
    }
  • head - If you analytics or any other tags you want to put on head tag. Example: <link rel="preconnect" href="//www.google-analytics.com" crossorigin="">.

CLI Options

dblog blog generator, that generates blog from Markdown and JSON file. dblog handles technical parts, so you can focus on hard part writing.

Website: https://anzenkodo.github.io/dblog
Package: https://deno.land/x/dblog
Repo: https://github.com/AnzenKodo/dblog
Docs: https://anzenkodo.github.io/dblog/posts/dblog-Docs.html

USAGE:
  dblog [OPTIONS]

OPTIONS:
  --serve   Build blog and Start localhost.
    --noopen  Don't open browser, when starting localhost.
  --build   Build blog without starting localhost.
  --setup   Setup new blog.
  --backup  Restore blog if 'backup.json' file available.
  --readme  Generate 'README.md' file.
  --help    Print help information.

File Options

---
title: If empty the file name will be used
description: If empty the first paragraph will be used.
tags: [ "tag1", "tag2" ]
date: 20/08/2020
canonical:
---
  • date - If empty, the file date will be used. Note: The file date might not always right. So always give you own date.
  • canonical - Share content between multiple sites without impacting SEO. Just put canonical URL. Know more about canonical url.

If file name start with underscore "_" it will be consider as draft.

Example: posts/_This is draft.md

Markdown Guide

CommonMark Syntex

Heading

# H1
## H2
### H3
#### H4
##### H5
###### H6

H1

H2

H3

H4

H5
H6

Inline style

**Bold** *Italic* ~~Strikethrough~~

Bold Italic Strikethrough

Link and Image

[website](https://anzenkodo.github.io/dblog)
![Jurassic Deno by Samip Poudel](https://deno.land/images/artwork/jurassicDeno.jpg)

website Jurassic Deno by Samip Poudel

Blockquote

> 'The road to hell is paved with good intentions' by Abbot Bernard

'The road to hell is paved with good intentions' by Abbot Bernard

List

* List
  * List
* List

1. One
2. Two
3. Three
  • List
    • List
  • List
  1. One
  2. Two
  3. Three

Horizontal rule

---

Code block

`Inline code` with backticks
```js
  console.log("Code Blog in JavaScript");
```

Inline code with backticks

console.log("Code Blog in JavaScript");

Additional Markdown syntax

Checkbox

- [ ] Checkbox
- [x] Checkbox with tick
  • Checkbox
  • Checkbox with tick

Image with caption

![Deno](https://deno.land/images/artwork/deno_matrix.png "Matrix by bramaudi")

Deno

Matrix by bramaudi

Footer

Here is a footnote reference[^1].
[^1]: Here is the footnote.

Here is a footnote reference1.

Additional inline syntax

~sub~
^sup^
==mark==
[[kbd]]
_underline_
++insert++
~~delete~~

sub sup mark kbd underline insert delete

Description list

: Definition 1
Term 2 with *inline markup*
: Definition 2
Third paragraph of definition 2.
Definition 1
Term 2 with inline.
Definition 2
Third paragraph of definition 2.

Abbreviation

*[abbr]: Abbreviation

abbr

Table

Normal
| Syntax      | Description |
| ----------- | ----------- |
| Header      | Title       |
| Paragraph   | Text        |
Syntax Description
Header Title
Paragraph Text
Multiline
|   Markdown   | Rendered HTML |
|--------------|---------------|
|    *Italic*  | *Italic*      | \
|              |               |
|    - Item 1  | - Item 1      | \
|    - Item 2  | - Item 2      |
|    ```python | ```python       \
|    .1 + .2   | .1 + .2         |    ```       | ```           |
MarkdownRendered HTML
*Italic* 

Italic

- Item 1 - Item 2
  • Item 1
  • Item 2

```python
.1 + .2
```
.1 + .2
  
Rowspan
Stage | Direct Products | ATP Yields
----: | --------------: | ---------:
Glycolysis | 2 ATP ||
^^ | 2 NADH | 3--5 ATP |
Pyruvaye oxidation | 2 NADH | 5 ATP |
Citric acid cycle | 2 ATP ||
^^ | 6 NADH | 15 ATP |
^^ | 2 FADH2 | 3 ATP |
**30--32** ATP |||
[Net ATP yields per hexose]
Net ATP yields per hexose
Stage Direct Products ATP Yields
Glycolysis 2 ATP
2 NADH 3–5 ATP
Pyruvaye oxidation 2 NADH 5 ATP
Citric acid cycle 2 ATP
6 NADH 15 ATP
2 FADH2 3 ATP
30–32 ATP

Headerless

|--|--|--|--|--|--|--|--|
||  |||||||
|  ||||  ||||
||  ||  |  |  |  |  |
|  ||  |  ||  |  |  |
|  |  |  |  ||  |  |  |
|  |  |  |  |  ||  |  |
|||||  ||||
||||||  |  ||

Footnotes

  1. Here is the footnote.