【问题标题】:How to host a static blog through Pelican on Github [closed]如何在 Github 上通过 Pelican 托管静态博客 [关闭]
【发布时间】:2015-08-06 00:19:32
【问题描述】:

我正在尝试通过 Pelican 生成一个静态博客,然后将其托管在 GitHub 上。

我在本地生成博客没有问题,但是当我尝试将其推送到 GitHub 时我很吃力。我在网上搜寻了指导,但似乎作者跳过了对有经验的人来说微不足道的步骤,但对初学者来说却不是。

谁能提供关于如何在 GitHub 上托管使用 Pelican 生成的静态博客的分步指南?

【问题讨论】:

  • 官方文档有一个最好的方法来做到这一点。无需等待。

标签: python github pelican


【解决方案1】:

考虑到您希望将其推送到您的用户存储库:

要以用户页面的形式发布 Pelican 站点,您需要将 Pelican 生成的输出目录的内容推送到 GitHub 上您的 .github.io 存储库的主分支。

您可以利用 ghp-import:

$ pelican content -o output -s pelicanconf.py
$ ghp-import output
$ git push git@github.com:elemoine/elemoine.github.io.git gh-pages:master

git push 命令将本地 gh-pages 分支(由 ghp-import 命令新更新)推送到 GitHub 上 elemoine.github.io 存储库的主分支。

我自己也用一个班轮做同样的事情:

$pelican && ghp-import output && git push git@github.com:maggick/maggick.github.io.git gh-pages:master

(来源:http://docs.getpelican.com/en/latest/tips.html

【讨论】:

    猜你喜欢
    • 2013-07-24
    • 1970-01-01
    • 2013-05-13
    • 1970-01-01
    • 1970-01-01
    • 2015-12-30
    • 2020-08-02
    • 2020-11-01
    • 1970-01-01
    相关资源
    最近更新 更多