From 19fc8f3cd179073a60883a6b1fdf59753c982a05 Mon Sep 17 00:00:00 2001 From: L3D Date: Sun, 21 Jan 2024 21:25:29 +0100 Subject: [PATCH] Change html minification --- chaoswest.tv.lektorproject | 1 + models/blog.ini | 4 -- models/post.ini | 4 +- poetry.lock | 81 +++++++++++++++++++++++++------------- pyproject.toml | 6 +-- templates/blog.html | 5 +-- templates/layout.html | 2 +- 7 files changed, 61 insertions(+), 42 deletions(-) diff --git a/chaoswest.tv.lektorproject b/chaoswest.tv.lektorproject index bbc13e0..4bd0092 100644 --- a/chaoswest.tv.lektorproject +++ b/chaoswest.tv.lektorproject @@ -28,3 +28,4 @@ url_prefix = /en/ # [packages] # lektor-pythonmarkdown = 1.2 # lektor-scss = 1.4.2 +# lektor-html-pretify = 2.0.0 diff --git a/models/blog.ini b/models/blog.ini index ef0fc31..5feada2 100644 --- a/models/blog.ini +++ b/models/blog.ini @@ -10,7 +10,3 @@ type = string [children] model = post order_by = -event_start_date,title - -[pagination] -enabled = true -per_page = 7 diff --git a/models/post.ini b/models/post.ini index ef1e4d5..f85c063 100644 --- a/models/post.ini +++ b/models/post.ini @@ -1,5 +1,5 @@ [model] -name = Blog Post +name = Event Name label = {{ this.title }} hidden = yes @@ -22,4 +22,4 @@ type = pythonmarkdown [fields.body] label = Body -type = pythonmarkdown +type = pythonmarkdown diff --git a/poetry.lock b/poetry.lock index 3de5abb..a5302c4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -14,6 +14,27 @@ files = [ [package.extras] dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] +[[package]] +name = "beautifulsoup4" +version = "4.12.3" +description = "Screen-scraping library" +optional = false +python-versions = ">=3.6.0" +files = [ + {file = "beautifulsoup4-4.12.3-py3-none-any.whl", hash = "sha256:b80878c9f40111313e55da8ba20bdba06d8fa3969fc68304167741bbf9e082ed"}, + {file = "beautifulsoup4-4.12.3.tar.gz", hash = "sha256:74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051"}, +] + +[package.dependencies] +soupsieve = ">1.2" + +[package.extras] +cchardet = ["cchardet"] +chardet = ["chardet"] +charset-normalizer = ["charset-normalizer"] +html5lib = ["html5lib"] +lxml = ["lxml"] + [[package]] name = "blinker" version = "1.7.0" @@ -25,6 +46,20 @@ files = [ {file = "blinker-1.7.0.tar.gz", hash = "sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182"}, ] +[[package]] +name = "bs4" +version = "0.0.2" +description = "Dummy package for Beautiful Soup (beautifulsoup4)" +optional = false +python-versions = "*" +files = [ + {file = "bs4-0.0.2-py2.py3-none-any.whl", hash = "sha256:abf8742c0805ef7f662dce4b51cca104cffe52b835238afc169142ab9b3fbccc"}, + {file = "bs4-0.0.2.tar.gz", hash = "sha256:a48685c58f50fe127722417bae83fe6badf500d54b55f7e39ffe43b798653925"}, +] + +[package.dependencies] +beautifulsoup4 = "*" + [[package]] name = "certifi" version = "2023.11.17" @@ -36,17 +71,6 @@ files = [ {file = "certifi-2023.11.17.tar.gz", hash = "sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1"}, ] -[[package]] -name = "chardet" -version = "5.2.0" -description = "Universal encoding detector for Python 3" -optional = false -python-versions = ">=3.7" -files = [ - {file = "chardet-5.2.0-py3-none-any.whl", hash = "sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970"}, - {file = "chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7"}, -] - [[package]] name = "charset-normalizer" version = "3.3.2" @@ -232,16 +256,6 @@ Werkzeug = ">=2.3.7" async = ["asgiref (>=3.2)"] dotenv = ["python-dotenv"] -[[package]] -name = "htmlmin" -version = "0.1.12" -description = "An HTML Minifier" -optional = false -python-versions = "*" -files = [ - {file = "htmlmin-0.1.12.tar.gz", hash = "sha256:50c1ef4630374a5d723900096a961cff426dff46b48f34d194a81bbe14eca178"}, -] - [[package]] name = "idna" version = "3.6" @@ -339,18 +353,18 @@ feedgenerator = "*" MarkupSafe = "*" [[package]] -name = "lektor-htmlmin" -version = "1.0.3" -description = "HTML minifier for Lektor. Based on htmlmin." +name = "lektor-html-pretify" +version = "2.0.0" +description = "Lektor Plugin to pretify your HTML DOM using BeautifulSoup" optional = false python-versions = "*" files = [ - {file = "lektor-htmlmin-1.0.3.tar.gz", hash = "sha256:3771b6ffcfaf833ff6ea639dcd7b278c0a658bb5057be8fad6a595b50368c950"}, + {file = "lektor-html-pretify-2.0.0.tar.gz", hash = "sha256:639deac66fc00847e324be17c4aa605c30cdd5147ce243d94f873e48f915d0c5"}, + {file = "lektor_html_pretify-2.0.0-py3-none-any.whl", hash = "sha256:147bc9c2388fea8b0eab6ea845fd051c148fa7b6d52cb2d640e3b93aa0adf955"}, ] [package.dependencies] -chardet = "*" -htmlmin = "*" +bs4 = "*" [[package]] name = "lektor-pythonmarkdown" @@ -582,6 +596,17 @@ docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] +[[package]] +name = "soupsieve" +version = "2.5" +description = "A modern CSS selector implementation for Beautiful Soup." +optional = false +python-versions = ">=3.8" +files = [ + {file = "soupsieve-2.5-py3-none-any.whl", hash = "sha256:eaa337ff55a1579b6549dc679565eac1e3d000563bcb1c8ab0d0fefbc0c2cdc7"}, + {file = "soupsieve-2.5.tar.gz", hash = "sha256:5663d5a7b3bfaeee0bc4372e7fc48f9cff4940b3eec54a6451cc5299f1097690"}, +] + [[package]] name = "termcolor" version = "2.4.0" @@ -682,4 +707,4 @@ watchdog = ["watchdog (>=2.3)"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "502907d60ac974bddeecccdeaa9287cd951fb202f511cda142811df6bec5cc97" +content-hash = "8712bb56210536275d76f7dca4967c6388bb2c202ab1d0489547becd69877681" diff --git a/pyproject.toml b/pyproject.toml index d66241f..1c7d176 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,16 @@ [tool.poetry] name = "chaoswest.tv" version = "0.1.0" -description = "" -authors = ["Your Name "] +description = "Lektor and dependencys for chaoswest.tv Page" +authors = ["L3D "] [tool.poetry.dependencies] python = "^3.10" lektor-scss = "^1.4.1" -lektor-htmlmin = "^1.0.3" lektor-pythonmarkdown = "^1.2" Pygments = "^2.12.0" lektor-atom = "^0.4.0" +lektor-html-pretify = "^2.0.0" [tool.poetry.dev-dependencies] Lektor = "^3.3" diff --git a/templates/blog.html b/templates/blog.html index 8bfe935..6d38f6b 100644 --- a/templates/blog.html +++ b/templates/blog.html @@ -1,7 +1,6 @@ {% extends "layout.html" %} {% from "macros/blog.html" import render_blog_post %} -{% from "macros/pagination.html" import render_pagination %} {% block title %}{{ this.title }}{% endblock %} @@ -9,6 +8,4 @@ {% for child in this.pagination.items %} {{ render_blog_post(child, from_index=true) }} {% endfor %} - - {{ render_pagination(this.pagination) }} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/layout.html b/templates/layout.html index 6970fef..2c247d3 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -37,7 +37,7 @@ {%- endblock %}