加入收藏 | 设为首页 | 会员中心 | 我要投稿 温州站长网 (https://www.0577zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 教程 > 正文

安装 Pelican 并创建仓库体现价值

发布时间:2021-06-01 17:55:46 所属栏目:教程 来源:互联网
导读:副标题#e# 首先,你必须在本地计算机上安装 Pelican 和ghp-import。使用 Python 软件包安装工具 pip(你有,对吧?),这非常容易: $ pip install pelican ghp-importMarkdown 然后,打开浏览器并在 GitHub 上为你新鲜出炉的博客创建一个新仓库,命名如下
副标题[/!--empirenews.page--]

首先,你必须在本地计算机上安装 Pelican 和 ghp-import。使用 Python 软件包安装工具 pip(你有,对吧?),这非常容易:

$ pip install pelican ghp-importMarkdown

然后,打开浏览器并在 GitHub 上为你新鲜出炉的博客创建一个新仓库,命名如下(在此处以及整个教程中,用 GitHub 用户名替换 username):

https://GitHub.com/username/username.github.io

让它保持为空,稍后我们用引人注目的博客内容来填充它。

使用命令行(确保正确),将这个空 Git 仓库克隆到本地计算机:

$ gitclone<https://GitHub.com/username/username.github.io> blog

$ cd blog

奇怪的把戏…

在 GitHub 上发布 Web 内容有一个不太引入注意的技巧,对于托管在名为 username.github.io 的仓库的用户页面,其内容由 master 分支提供服务。

我强烈建议所有的 Pelican 配置文件和原始的 Markdown 文件都不要保留在 master 中,master 中只保留 Web 内容。因此,我将 Pelican 配置和原始内容保留在一个我喜欢称为 content 的单独分支中。(你可以随意创建一个分支,但以下内容沿用 content。)我喜欢这种结构,因为我可以放弃掉 master 中的所有文件,然后用 content 分支重新填充它。

$ git checkout -b content

Switched to a new branch 'content'

配置 Pelican

现在该进行内容配置了。Pelican 提供了一个很棒的初始化工具 pelican-quickstart,它会询问你有关博客的一系列问题。

$ pelican-quickstart

Welcome to pelican-quickstart v3.7.1.

 

Thisscript will help you create a newPelican-based website.

 

Please answer the following questions so thisscript can generate the files

needed by Pelican.

 

>Wheredo you want to create your new web site?[.]

>What will be the title of this web site?Super blog

>Who will be the author of this web site? username

>What will be the default language of this web site?[en]

>Do you want to specify a URL prefix? e.g., http://example.com (Y/n) n

>Do you want to enable article pagination?(Y/n)

>How many articles per page do you want?[10]

>Whatis your time zone?[Europe/Paris] US/Central

>Do you want to generate a Fabfile/Makefile to automate generation and publishing?(Y/n) y

>Do you want an auto-reload & simpleHTTP script to assist with theme and site development?(Y/n) y

>Do you want to upload your website using FTP?(y/N) n

>Do you want to upload your website using SSH?(y/N) n

>Do you want to upload your website usingDropbox?(y/N) n

(编辑:温州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读