工具癖软件测试Python专家之路python数据分析人工智能机器学习

使用python静态网页生成工具pelican快速在github

2019-01-02  本文已影响19人  python测试开发

简介

Pelican用Python编写的静态站点生成器。亮点:

Pelican 4目前支持:

为什么叫“Pelican”这个名字?

“Pelican”是calepin的字谜,在法语中意为“笔记本”。 ;)

您可以访问以下网址获取源代码:https://github.com/getpelican/pelican。更多相关库参见https://github.com/china-testing/python-api-tesing

安装

pip install pelican markdown

创建项目

mkdir -p ~/projects/yoursite
cd ~/projects/yoursite
pelican-quickstart

创建文章

~/projects/yoursite/content/keyboard-review.md

Title: My First Review
Date: 2010-12-03 10:20
Category: Review

Following is a review of my favorite mechanical keyboard.

参考资料

生成网站

pelican content

预览

pelican --listen

访问:http://localhost:8000/

图片.png

github部署

比如https://github.com/china-testing/china-testing.github.io,这个仓库名要求为username.github.io

上传代码,就可以访问你的网站了。

#!/usr/bin/env bash
DATE=$(date +%Y%m%d)
cd /home/andrew/code/yoursite
rm -rf output/*
pelican content
cd /home/andrew/code/china-testing.github.io
git rm -rf *
cp -rf /home/andrew/code/yoursite/output/* .
git add *
git commit -m $DATE
git push

网站示例: https://china-testing.github.io/

上一篇 下一篇

猜你喜欢

热点阅读