将 Ablog 部署到 github 个页面

Deploy Ablog to github pages

我刚刚开始使用 ABlog plugin for sphinx 创建静态站点博客。

是否容易更改 ablog deploy 以部署到不同的位置, 例如../username.github.io/ 而不是 ./username.github.io/?

我的 ABlog 项目在 git 存储库中受源代码控制。在当前 ABlog 项目中创建我的 username.github.io 会在一个回购中创建一个回购,这会导致错误(而且我不想将构建的站点与 ABlog 存储库一起存储——尽管我可以添加一个 .gitignore).

Is it easy to change ablog deploy to deploy to a different location, e.g. ../username.github.io/ instead of ./username.github.io/?

对于 ABlog ≥ 0.8.0,是

对于 ablog-0.8.0 及更高版本,您可以使用 -p 选项指定一个 github 存储库位置而不是默认 (<location of conf.py>/<your username>.github.io):

ablog deploy -p /the/path/for/your/local/github/pages/repo

也就是说,在你的情况下

ablog deploy -p ../username.github.io/

如何安装最新版本的 ABlog

在 pypi 上可用版本 0.8.0 之前,您可以 tell pip to install ablog directly from git:

pip install git+https://github.com/abakan/ablog.git

对于 Ablog < 0.8.0,否

对于 0.8.0 之前的版本,此答案的旧版本适用:

With the current implementation of ABlog-internal function ablog_deploy, the location of the target repository cannot be changed:

String gitdir (holding the path where the local repository will be created) is set to

<confdir>/<github_pages option>.github.io but the `github_pages` option is also [used to choose the remote

repository](https://github.com/abakan/ablog/blob/0ed765d95a23ad7dce48c755773ac60dd08cf319/ablog/commands.py#L338), so passing something else than the GitHub account name will make the process fail.

Manipulating confdir would be difficult and would result in the configuration file not being found and probably a bunch of other side effects.

However, if you're willing to modify ABlog's source code, it would not be hard to adapt the assignment of gitdir as you see fit (maybe introducing another option) to produce the decided effect. (E.g., make it use confdir if your new option hasn't been set, and have it use your new option instead if that option has been set.)