pelican学习笔记(四)——pelican-themes
前情提要
pelican学习笔记之GITHUB建站(一)
pelican学习笔记(二)之Writing content
pelican学习笔记(三)——Publish your site
2018/01/29
pelican-themes 插入主题
Description 描述
pelican-themes
是 Pelican 用来管理主题的命令行工具。
Usage 用法
pelican-themes [-h] [-l] [-i theme path [theme path ...]][-r theme name [theme name ...]][-s theme path [theme path ...]] [-v] [-version]
Optional arguments 参数
参数 | 说明 |
---|---|
-h, –help | 显示帮助 |
-l, –list | 列出已经安装的主题 |
-i theme_path, –install theme_path | 安装主题(可多个同时安) |
-r theme_path, –remove theme_path | 删除主题 |
-s theme_path, –symlink theme_path | 以符号链接形式安装主题,而非复制,常用于主题开发 |
-v, –verbose | 详细输出 |
–version | 版本 |
Examples 例子s
Listing the installed themes
$ pelican-themes -l
notmyidea
two-column@
simple
$ pelican-themes --list
notmyidea
two-column@
simple
可以看到主题 two-column
后跟着@
,表明此主题没有复制安装而是链接安装。
$ pelican-themes -v -l
/usr/local/lib/python2.6/dist-packages/pelican-2.6.0-py2.6.egg/pelican/themes/notmyidea
/usr/local/lib/python2.6/dist-packages/pelican-2.6.0-py2.6.egg/pelican/themes/two-column (symbolic link to '/home/skami/Dev/Python/pelican-themes/two-column')
/usr/local/lib/python2.6/dist-packages/pelican-2.6.0-py2.6.egg/pelican/themes/simple
Installing themes 安装主题
你可以安装一个或多个主题:
$ pelican-themes --install ~/Dev/Python/pelican-themes/notmyidea-cms --verbose
# pelican-themes --install ~/Dev/Python/pelican-themes/notmyidea-cms\~/Dev/Python/pelican-themes/martyalchin \--verbose
# pelican-themes -vi ~/Dev/Python/pelican-themes/two-column
Removing themes 移除主题
# pelican-themes --remove two-column
# pelican-themes -r martyachin notmyidea-cmd -v
Creating symbolic links 符号安装
# pelican-themes --symlink ~/Dev/Python/pelican-themes/two-column
上面的例子,two-column
主题作为符号安装进了主题目录,我们可以使用它,同时我们可以开发改进主题而不用reinstall。
这在开发主题的过程中很有用:
$ sudo pelican-themes -s ~/Dev/Python/pelican-themes/two-column
$ pelican ~/Blog/content -o /tmp/out -t two-column
$ firefox /tmp/out/index.html
$ vim ~/Dev/Pelican/pelican-themes/two-column/static/css/main.css
$ pelican ~/Blog/content -o /tmp/out -t two-column
$ cp /tmp/bg.png ~/Dev/Pelican/pelican-themes/two-column/static/img/bg.png
$ pelican ~/Blog/content -o /tmp/out -t two-column
$ vim ~/Dev/Pelican/pelican-themes/two-column/templates/index.html
$ pelican ~/Blog/content -o /tmp/out -t two-column
Doing several things an once
--install
, --remove
和 --symlink
可以同时出现在一个命令中:
# pelican-themes --remove notmyidea-cms two-column \--install ~/Dev/Python/pelican-themes/notmyidea-cms-fr \
--symlink ~/Dev/Python/pelican-themes/two-column \
--verbose
学习笔记
pelican 的主题在 https://github.com/getpelican/pelican-themes,页面中有使用说明。选取主题的时候可以看http://www.pelicanthemes.com/页面挑选。
目前喜欢attila, backdrop, blueidea, clean-blog, niu-x2(中文的,不用调整CSS), voidy-bootstrap,
种类太多,大部分好看的都配合着漂亮的拉丁字体,对于中文方块字,很有可能都需要自己手动调整,尽量挑选布局满意的,再做细部修改好了。
假设我们将主题放在 ~/pelican-themes
文件夹下,先将主题拿到本地:
git clone --recursive https://github.com/getpelican/pelican-themes ~/pelican-themes
现在在本地我们拥有了pelican-themes
的分支。安装主题,在blog文件夹下运行:
pipenv run pelican-themes -i ~/pelican-themes/themes-name
还记得吗?我为我的环境配置了pipenv。所以运行的时候要注意。
安装完成后用pipenv run pelican-themes -l
查看主题
选用主题时,修改 pelicanconf.py
文件,添加:
THEME = "themename"
保存文件并生成站点。
开发主题的时候注意修改~/pelican-themes
下的文件,output
文件夹下的修改在站点生成的时候会被覆盖.
pelican学习笔记(四)——pelican-themes相关推荐
- pelican学习笔记(二)之Writing content
学习http://docs.getpelican.com/en/stable/content.html时做非精准翻译,权当笔记 前文见pelican学习笔记之GITHUB建站(一) Writing c ...
- pelican学习笔记(三)——Publish your site
前情提要 pelican学习笔记之GITHUB建站(一) pelican学习笔记(二)之Writing content Publish Your Site 2018/01/29 Site genera ...
- C#可扩展编程之MEF学习笔记(四):见证奇迹的时刻
前面三篇讲了MEF的基础和基本到导入导出方法,下面就是见证MEF真正魅力所在的时刻.如果没有看过前面的文章,请到我的博客首页查看. 前面我们都是在一个项目中写了一个类来测试的,但实际开发中,我们往往要 ...
- IOS学习笔记(四)之UITextField和UITextView控件学习
IOS学习笔记(四)之UITextField和UITextView控件学习(博客地址:http://blog.csdn.net/developer_jiangqq) Author:hmjiangqq ...
- RabbitMQ学习笔记四:RabbitMQ命令(附疑难问题解决)
RabbitMQ学习笔记四:RabbitMQ命令(附疑难问题解决) 参考文章: (1)RabbitMQ学习笔记四:RabbitMQ命令(附疑难问题解决) (2)https://www.cnblogs. ...
- JSP学习笔记(四十九):抛弃POI,使用iText生成Word文档
POI操作excel的确很优秀,操作word的功能却不敢令人恭维.我们可以利用iText生成rtf文档,扩展名使用doc即可. 使用iText生成rtf,除了iText的包外,还需要额外的一个支持rt ...
- Ethernet/IP 学习笔记四
Ethernet/IP 学习笔记四 EtherNet/IP Quick Start for Vendors Handbook (PUB213R0): https://www.odva.org/Port ...
- OpenCV学习笔记四-image的一些整体操作
title: OpenCV学习笔记四-image的一些整体操作 categories: 编程 date: 2019-08-08 12:50:47 tags: OpenCV image的一些操作 sP4 ...
- 吴恩达《机器学习》学习笔记四——单变量线性回归(梯度下降法)代码
吴恩达<机器学习>学习笔记四--单变量线性回归(梯度下降法)代码 一.问题介绍 二.解决过程及代码讲解 三.函数解释 1. pandas.read_csv()函数 2. DataFrame ...
最新文章
- IBM强化Watson对商业语言的理解能力—AI辩论一些关键技术首次商业化
- JavaEE 获取路径全攻略
- IOS线程学习(一)
- 关于python语言的编程模式、哪个说法正确_测验1: Python基本语法元素 (第1周) 单选题+程序题...
- WebSocket 测试
- 笔画最多的汉字和字母最多的单词
- ic启动器怎么导入模组_Model Y和Model 3的模组拆解对比
- 使用boston房价数据进行线性回归分析
- 32位汇编第三讲,RadAsm,IDE的配置和使用,以及汇编代码注入方式
- python 开发框架 ant_Python ant
- Java基础--封装--继承 某公司的雇员分为以下若干类:Employee:这是所有员工总的父类。 SalariedEmployee:Employee的子类
- 多重for循环优化,提升运行效率
- mysql优化之 Using where; Using join buffer (Block Nested Loop) ,索引失效,检查项
- 哈希(Hashing)
- java求质因数算法
- github fatal: Authentication failed for解决方法
- 淘票票sign----js(5: 继续淘票票--sign 生成完成)
- 7-Zip自解压sfx解决方案简介
- 浅谈JVM的双亲委派机制
- 游戏引擎不仅是代码,更多的是完善的工具
热门文章
- 上古神器--vim编辑器
- 2007莆田学院Linux培训课程大纲之一
- Vim跳转到指定行的三种方法
- 软件定义汽车研究:40个细分赛道,数百家供应商,软件自主化水平快速提升
- Ubuntu 安装 mysql 报错 update-alternatives: 错误: 候选项路径 /etc/mysql/mysql.cnf 不存在
- Paho MQTT Python客户端常用API、安装与使用
- 笔记1—身份证排序(截取字符串,比较大小)
- python基础知识学习总结
- ArcMap导入jpg格式图片并进行地理配准
- 安装webpack 后查询webpack版本报错