美文网首页
基于Python语言的Nikola静态框架安装

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

作者: 陈灿贻 | 来源:发表于2019-07-10 11:45 被阅读0次

    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

    相关文章

      网友评论

          本文标题:基于Python语言的Nikola静态框架安装

          本文链接:https://www.haomeiwen.com/subject/oawckctx.html