poster-cli
v0.0.1
Published
A simple cli to build a blog server
Downloads
2
Readme
Hello
Welcome using Poster, a lightweight blog building command line tool!
Getting Started
To build your own blog, choose a nice directory and enter:
npm install -g poster-cli
poster init my-blog
cd my-blog
npm install
npm run server
then open http://localhost:8080
in your browser, you would be able to visit your own blog.
To stop the server, press Ctrl+C (Control+C in macOS)
.
Posting
To put a post on your blog, simply add a markdown file (such as my-first-post.md
in this example) in the /posts directory and enter:
poster post my-first-post.md
Then you can see your post on your blog!
To remove it, simply enter:
poster remove my-first-post.md
After you hit Enter
, your original .md
file will still exist, but it's not visible on your blog now.
Edit your blog settings
Your blog's settings is in settings.json
. here is how does it look (The usage are in the comments):
{
"title": "Poster", // The title of your blog;
"author": "me", // The author, which is probably yourself;
"license": "Creative Commons 4.0 BY-NC-SA License", // The license your blog uses;
"theme": "default", // The theme, for more infomation, look at ## Themes
"postsPerPage": 5, // How many posts are there on one page.
"links": [ // Links are icons link to other websites/social medias of you.
{
"href": "https://trustgit.github.io/poster", // Where will the link go to?
"name": "Powered by poster", // When a mouse is hovering on it, this will appear.
"icon": "icon.png" // The icon.
}
],
"port": 8080 // The port. Usually if you just want to have a test drive, use 8080. If you are ready to show your blog to others, use 80.
}
Themes
When your blog is first installed, it uses the theme default
, which is a .css
file in directory /theme
. You can write another css file(new-theme.css
in this example) to make it a theme of your own. Then change theme
in settings.json
to your css filename(such as new-theme
).
Enjoy some theme-changing experience!
Modifying other files
The server is based on koa2, its file is SERVER/index.js
. It requires SERVER/renderer.js
, which is a very bad template engine wrote by myself(trustgit). It mainly renders SERVER/template.html
. You can modify these 3 files to get better experience(maybe?) if you are able to do that ;-).
Contribution
If you want to contribute, visit here
Finally
Please enjoy. We wish you a happy posting experience!