基于简单降价的低带宽静态站点生成器

Statisk的Python项目详细描述


PyStatisk Ascii Logo

皮斯塔茨克

KotlinStatisk项目的Python端口,设计为在低功耗设备(raspberrypizero)上运行。将降价文件转换为简单的Html格式,并为极低带宽的网页减少图像大小。在

安装

通过PIP安装:

pip install Statisk

然后运行:

stsk /path/to/blog/

如果在运行stsk时遇到类似以下错误:

ImportError: libopenjp2.so.7: cannot open shared object file: No such file or directory

执行以下操作以修复:sudo apt-get install libopenjp2-7-dev

设置

_template.html应该放在网站的根目录中,简单的例子:

<!DOCTYPE html><html><head><!-- Optional --><title>{{ title }}</title></head><body>
        {{ content }}
        <footer><!-- Optional -->
            {{ page_size }}
        </footer></body></html>

博客结构

降价帖子必须在根目录posts/内的年/月/日(YYYY/MM/DD)结构中:

^{pr2}$

样式参数

降价公告可以设置参数来覆盖图像的处理方式,并设置页面背景,这是使用降价文件顶部的隐藏注释完成的,例如:

<!--- -algorithm 5by3Bayer -threshold 100 -background #efefef -image_foreground #002233 -image_background #dedede -->

ArgumentBehaviour
^{}Sets dither algorithm (see below), eg. ^{}
^{}Set threshold of dither algorithms in range 0 to 255, eg. ^{}
^{}Set the foreground colour of dithered images, eg. ^{}
^{}Set the background colour of dithered images, eg. ^{}
^{}Override the page background colour, eg. ^{}

抖动

可用抖动算法(来自DitherKt):

{},2by2Bayer3by3Bayer4by4Bayer5by3Bayer5by3Bayer8by8BayerFloydSteinbergFalseFloydSteinbergNewspaperHalftoneJarvisJudiceNinkeSierra,^{},TwoRowSierra,^{的,^{的,^{的{{},^{},,^{},Random

还有一个greyscale过滤器(-algorithm greyscale),阈值被忽略。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java为什么这一行是charg=(char)(br.read());被跳过?   java三重DES中的IV在哪里?   java Lombok注释不在Intellij idea下编译   java为什么我不能使用过滤器作为流中的最后一步   sqlite Java编译错误找不到符号方法next()   在Java中解析处理对int来说太大的数字   java摄像头不工作   java是“断言错误”好的做法?   java确定api请求是来自CURL还是POSTMAN?   JavaSpringMVC导航   java使单例模式代码更强大   当Java(解释器)区分大小写时,为什么Java编译器(javac)不区分大小写?   java注释字符串[]oneArr();vs字符串[][]twoArr();公告   java命名查询的利弊   java使用log4jweb在web应用程序中配置Log4j2。罐子   java正则表达式查找以开头和结尾的所有可能出现的文本~   java从字符串执行方法