博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python3 pelican 搭建静态博客
阅读量:6274 次
发布时间:2019-06-22

本文共 1949 字,大约阅读时间需要 6 分钟。

hot3.png

安装pelican

$ pip3 install pelican markdown ghp-import...$ pelican --version4.0.0

快速开始一个博客项目

$ pelican-quickstartWelcome to pelican-quickstart v4.0.0.This script will help you create a new Pelican-based website.Please answer the following questions so this script can generate the filesneeded by Pelican.> Where do you want to create your new web site? [.]> What will be the title of this web site? my blog> Who will be the author of this web site? atyang> What will be the default language of this web site? [zh]> Do you want to specify a URL prefix? e.g., https://example.com   (Y/n) n> Do you want to enable article pagination? (Y/n) y> How many articles per page do you want? [10]> What is your time zone? [Europe/Paris] Asia/Shanghai> Do you want to generate a tasks.py/Makefile to automate generation and publishing? (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 using Dropbox? (y/N) n> Do you want to upload your website using S3? (y/N) n> Do you want to upload your website using Rackspace Cloud Files? (y/N) n> Do you want to upload your website using GitHub Pages? (y/N) y> Is this your personal page (username.github.io)? (y/N) yDone. Your new project is available at /Users/xxx/projs/python/pelican/helloworld$ lsMakefile       output         publishconf.pycontent        pelicanconf.py tasks.py

时间区域,参考

查看生成的文件

$ tree.├── Makefile├── content├── output├── pelicanconf.py├── publishconf.py└── tasks.py2 directories, 4 files

添加markdown文件,并生成html

到content目录下,添加first.md文件,并加入内容:

$ cd content$ vim first.mdTitle: My first postDate: 2014-12-23 17:49Modified: 2014-12-23 17:49Category: miscTags: first, miscSlug: My-first-postAuthors: Adrien LegerSummary: Short version of my first blog postThis is my **first blog post with pelican**

保存后,生成html文件

$ make html

启动服务

$ make serve

浏览器访问

参考

转载于:https://my.oschina.net/yimingkeji/blog/2876061

你可能感兴趣的文章
socket通信Demo
查看>>
技术人员的焦虑
查看>>
js 判断整数
查看>>
建设网站应该考虑哪些因素
查看>>
mongodb $exists
查看>>
js实现页面跳转的几种方式
查看>>
sbt笔记一 hello-sbt
查看>>
常用链接
查看>>
pitfall override private method
查看>>
!important 和 * ----hack
查看>>
聊天界面图文混排
查看>>
控件的拖动
查看>>
svn eclipse unable to load default svn client的解决办法
查看>>
Android.mk 文件语法详解
查看>>
QT liunx 工具下载
查看>>
内核源码树
查看>>
Java 5 特性 Instrumentation 实践
查看>>
AppScan使用
查看>>
Java NIO框架Netty教程(三) 字符串消息收发(转)
查看>>
Ucenter 会员同步登录通讯原理
查看>>