makepythonpoetry
- I've created a tool to render from markdown file to static site by
Pythonfor my self. - To use this template, you need to clone the repo first. The project should have this structure:
|_ prototypes/ # contains .md file, you will write your posts in here.
|_ posts/ # contains all html posts file after run ./render
|_ tags/ # contains all html tags file after run ./render
|_ templates/ # contains jinja templates for constructing posts, tags html files
|_ static/ # contains static file like styles or script for your pages
|_ index.html # home page of blog
|_ app.py # blog generator tool
|_ test_app.py # test all functions of blog generator tool
|_ Makefile # command for render html files
|_ requirements.txt # for create environment for github actions
|_ poetry.lock
|_ pyproject.toml
-
Firstly, if this is the first time you use this tool:
- You need to
forkthis repo to your, then change the name of repo following this format:<your_github_username>.github.io. And cloning it to your local machine:git clone https://github.com/.... - After that, you need to create
prototypes,tagsandpostsfolder by run:make init.
- You need to
-
Secondly, you need to install environment to render blog. Run:
poetry install. -
Then go to
prototypesfolder and write the your posts in.mdformat, edit the metadata and push them intoprototypesfolder. Notice that, the metadata of .md file you need to keep following these formats
title: ....
date: ....
tags: ....
name: ....
summary: ....
------------------------
-
After the first time, you only need to write posts and render to html.
-
To render blog posts:
- Run
make cleanto delete old html files. - Run
make testto run test. - Run
make runto render all html files topostsandtagsfolder.
- Run
-
Push to your repo, and go to
https://<your_github_username>.github.io/to see. -
To read more about
github pages. Read this guide -
In addition, you can add a comment plugin your self call utterances. After that, go to
templates/post.htmland replace the script in{% block script %}{% endblock %}with your script. -
You can put your information into
config.ymlfile
@LICENSE: MIT