commit db03535ee91b25ffcf1b58ebbedb05d8689ebcda Author: Klemek Date: Tue Jun 18 19:54:58 2019 +0200 Initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2d2b47d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +node_modules \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..a30a6d7 --- /dev/null +++ b/README.md @@ -0,0 +1,73 @@ +# GitBlog.md (WIP) +> This is a work in progress, some information written here might not be true yet. + +A static blog using Markdown pulled from your git repository. + +## Flow + +![root](./uml/root.png) + +![article](./uml/article.png) + +![webhook](./uml/webhook.png) + +![rss](./uml/rss.png) + +## Installation +**1. Download the latest version from the repo** +```bash +git clone https://github.com/klemek/gitblog.md.git +``` +**2. Create your config file** +```bash +cd gitblog.md +cp config.example.json config.json +``` +then edit the config.json file with your values : +> default values for config.json +````json +{ + "node_port": 3000, + "data_dir": "data", + "modules" : { + "plantuml" : true, + "rss": true, + "webhook": true + }, + "home" : { + "index" : "index.ejs" + }, + "article" : { + "index" : "index.md" + }, + "rss" : { + "endpoint" : "/rss", + "length" : 10 + }, + "webhook" : { + "endpoint": "/webhook", + "secret_file": "git_secret" + } +} +```` +**3. Create and init your git source** + +You need to [create a new repository](https://github.com/new) on your favorite Git service. + +```bash +#gitblog.md/ +cd data +git remote add origin +git push -u origin master +``` + +**4. Refresh content with a webhook (optional)** + +At first start, a `git_secret` file will be generated, use it to create a new webhook as following : + +* Payload URL : `https:///webhook` +* Content type : `application/json` +* Secret : `` +* Events : Just the push event + +On GitHub, webhooks can be created in the `Settings/Webhooks` part of the repository. \ No newline at end of file diff --git a/uml/article.png b/uml/article.png new file mode 100644 index 0000000..59b76f3 Binary files /dev/null and b/uml/article.png differ diff --git a/uml/article.txt b/uml/article.txt new file mode 100644 index 0000000..9116053 --- /dev/null +++ b/uml/article.txt @@ -0,0 +1,28 @@ +@startuml + +title Article + +cloud web + +node nodejs { + TCP -right- [express] + [showdown] +} + +package data { + package "2019/06/18" { + component index [ + index.md + image.png + ... + ] + } +} + +web -down-> TCP : 1. /2019/06/18/title +express -down-> index : 2. fetch +index -up-> showdown : 3. markdown +showdown -left-> express : 4. html +express -up-> web : 5. html + +@enduml \ No newline at end of file diff --git a/uml/root.png b/uml/root.png new file mode 100644 index 0000000..dc68055 Binary files /dev/null and b/uml/root.png differ diff --git a/uml/root.txt b/uml/root.txt new file mode 100644 index 0000000..3f40ccc --- /dev/null +++ b/uml/root.txt @@ -0,0 +1,27 @@ +@startuml + +title Homepage + +cloud web + +node nodejs { + TCP -right- [express] +} + +package data { + component index [ + index.ejs + style.css + ... + ] +} + +database list + +web -down-> TCP : 1. root +express -down-> index : 2 +index --> express : 3 +list -left-> express : 3 +express -up-> web : 4. html + +@enduml \ No newline at end of file diff --git a/uml/rss.png b/uml/rss.png new file mode 100644 index 0000000..8b2d4b8 Binary files /dev/null and b/uml/rss.png differ diff --git a/uml/rss.txt b/uml/rss.txt new file mode 100644 index 0000000..387b19b --- /dev/null +++ b/uml/rss.txt @@ -0,0 +1,17 @@ +@startuml + +title RSS feed + +cloud web + +node nodejs { + TCP -right- [express] +} + +database list + +web -down-> TCP : 1. /rss +list -left-> express : 2. +express -up-> web : 3. xml + +@enduml \ No newline at end of file diff --git a/uml/webhook.png b/uml/webhook.png new file mode 100644 index 0000000..a9d8460 Binary files /dev/null and b/uml/webhook.png differ diff --git a/uml/webhook.txt b/uml/webhook.txt new file mode 100644 index 0000000..78fc865 --- /dev/null +++ b/uml/webhook.txt @@ -0,0 +1,22 @@ +@startuml + +title Refresh content + +cloud web + +node nodejs { + TCP -right- [express] +} + +package data { + +} + +database list + +web -down-> TCP : 1. /webhook +express -down-> data : 2. git pull +data -up-> express : 3. files data +express -right-> list : 4. writes + +@enduml \ No newline at end of file