Skip to content
Snippets Groups Projects
user avatar
Markus Göllnitz authored
The 2018 Akademy slides are broken due to issues with
re-minification of the remark-lates.min.js file.

While excluding that specific file would be an option, as
would any file with a *.min.* indicator of already being
minified (as the issue stems from unusual coding
practices that are the result of the input being minified
already), I suggest—after thinking about it—instead to
exclude the slides from being minified.

The reason for that: I added Flask-Minify to make sure
the website is served fast by reducing its overall size
as well the render blocking components especially. And
I see that as an important feature for most parts of the
website, but the slides serve a different purpose: They
are documentation, more of an archive. I delay of a few
tens to hundreds of milliseconds for those slides is
more than acceptable, I would argue.

I looked at the front page, as well as multiple blog
posts, and most other pages, and intend to continue to do
so. They may continually evolve while the slides are best
served as is. And this argument stands for any future
additions of archive-like content. (And it does so for
static/pdf/* as well, which just is not suspect of HTML,
CSS, or JS minification.)

Fixes: 144a0001 ("app: minify CSS and HTML")
Closes: https://gitlab.com/postmarketOS/postmarketos.org/-/issues/181



Signed-off-by: default avatarMarkus Göllnitz <camelcasenick@bewares.it>
34be4d6d
History

postmarketos.org

Licensing

Code is licensed under AGPL-3.0-or-later, everything else is licensed under CC-BY-SA-4.0 except where otherwise noted. Find full license text in LICENSES.

Dev

Python Requirements Setup

Python 3.4+ is supported. Install all requirements, preferably within a virtualenv:

$ python -m venv .venv
$ source .venv/bin/activate
(venv)$ pip install -r requirements.txt

New Blog Content

Blog content is written in markdown format with metadata in the file header. Filename syntax is yyyy-mm-dd-slug.md.

$ cat >content/blog/2017-12-31-happy-new-year.md << EOF
> ---
> title: Happy New Year!
> ---
>
> This is a *markdown* **formatted** post.
> EOF

Writing responsive content

Use the following custom tags to create responsive sections in the blog posts:

  • [#grid side#]
  • [#grid text#]
  • [#grid bottom#]
  • [#grid end#]

Using any tag except for "end" will encapsulate the following markdown code in the grid area of the same name. If the grid was not opened yet, it will be opened with the first tag. The "end" tag closes the grid.

The grid layout looks like this, in desktop mode:

|text|(20px free space)|side| |bottom|(20px free space)|side|

...and with a lower screen width (mobile phones etc.):

|side| |text| |bottom|

Use the responsive mode tools of your browser to check if it works as expected. For usage examples, look at the existing blog posts and the grid-related code in static/css/page.css. This feature is implemented in page.py.

Dev Server

Run the dev server during local development, changes are auto reloaded:

(venv)$ FLASK_DEBUG=1 FLASK_APP=app.py flask run

Build

To run a static site build, run:

(venv)$ python freeze.py

This will generate a static version in public/. Any manual changes to the public/ directory will be overridden in the next build.

Note that the public/ directory is ignored and not versioned.

Upgrading requirements.txt

(venv)$ pip install pip-upgrader
(venv)$ pip-upgrade