基于Python语言的Nikola静态框架安装

install

$ mkdir nikola && cd nikola
$ mkvirtualenv blog - -python = python3.6
$ pip install Nikola
$ pip install aiohttp watchdog ghp-import2 # requirements for nikola auto
# initial
$ nikola init
$ nikola auto
# visit localhost:8000
# first post
$ nikola new_post -f markdown
$ git init
$ vi .gitignore
# cache
# .doit.db*
# __pycache__
# output
# .ipynb_checkpoints
# .DS_Store
$ git remote add origin git@github.com:[username]/[username].github.io.git
# create branch src for storing source, like: conf.py,*.rst,*.md
$ git checkout -b src
$ 

In conf.py, double-check that branch names are correct:

GITHUB_SOURCE_BRANCH = 'src'
GITHUB_DEPLOY_BRANCH = 'master'
GITHUB_REMOTE_NAME = 'origin'

I also recommend setting:

GITHUB_COMMIT_SOURCE = False

So that the nikola github_deploy command below won't touch your src branch.
To deploy the content on master, run:
nikola github_deploy

References

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容