简介
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/
参考文档:http://docs.getpelican.com/en/4.0.1/quickstart.html
页面更新:2024-05-14
本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828
© CopyRight 2020-2024 All Rights Reserved. Powered By 71396.com 闽ICP备11008920号-4
闽公网安备35020302034903号