{"id":17658645,"url":"https://github.com/ruuda/minimizer","last_synced_at":"2025-03-30T10:27:23.827Z","repository":{"id":66191229,"uuid":"581325007","full_name":"ruuda/minimizer","owner":"ruuda","description":"Site minifier for MkDocs sites that use the Kilsbergen theme","archived":false,"fork":false,"pushed_at":"2024-09-08T09:06:16.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T12:23:03.748Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://codeberg.org/ruuda/minimizer","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruuda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-22T21:49:24.000Z","updated_at":"2024-09-08T09:06:19.000Z","dependencies_parsed_at":"2024-09-08T10:35:58.732Z","dependency_job_id":"14a7eb9f-4bd3-4946-a9c7-39678ba89ba6","html_url":"https://github.com/ruuda/minimizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruuda%2Fminimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruuda%2Fminimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruuda%2Fminimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruuda%2Fminimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruuda","download_url":"https://codeload.github.com/ruuda/minimizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246305327,"owners_count":20756068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-23T15:27:49.485Z","updated_at":"2025-03-30T10:27:23.810Z","avatar_url":"https://github.com/ruuda.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minimizer\n\nMinimizer is a utility that minimizes and compresses html of an [MkDocs][mkdocs]\nsite. It is made to work with the [Kilsbergen][kilsbergen] theme. I use\nMinimizer to deploy my documentation sites, the tool is intentionally not\ngeneric.\n\n[mkdocs]:     https://www.mkdocs.org/\n[kilsbergen]: https://github.com/ruuda/kilsbergen\n\n## Operation\n\nMinimizer acts on Git repositories, it creates a minimized tree from a given\ntree that the `gh-pages` branch points to, and then checks it out in a\nparticular location. By leveraging Git, we get:\n\n * A content-addressable store for minified pages, so we can cache them.\n * The ability to quickly switch between different versions of the site.\n * A convenient way to make a given directory match the site.\n\nThe minimizer generates:\n\n * A minified version of every .html file. It also minifies inline css.\n * A gzipped version of the minified html, generated with the [Zopfli][zopfli]\n   compressor, which is slow but achieves better density than zlib.\n * A [Brotli][brotli]-compressed version of the minified html.\n\nThe compressed versions can then be used by the [`gzip_static`][gzstatic] and\n`brotli_static` modules in Nginx.\n\n[zopfli]:   https://github.com/google/zopfli\n[brotli]:   https://github.com/google/brotli\n[gzstatic]: https://nginx.org/en/docs/http/ngx_http_gzip_static_module.html\n\n## Usage\n\nThe following will minimize the `gh-pages` branch of `\u003cinput-repo\u003e` and check\nout the result into `\u003coutput-directory\u003e`. The output directory does not need to\nbe a Git repository.\n\n    cargo build --release\n    target/release/minimizer \u003cinput-repo\u003e \u003coutput-directory\u003e\n\nA call to `minimizer` is useful to set up in a [post-receive hook][hook],\nespecially when combined with `mkdocs gh-deploy`. I personally use this like so:\n\n * My webserver has bare repository, `project.git`, with a post-receive hook\n   that runs `minimizer project.git /var/www/docs.ruuda.nl/project`.\n * I deploy docs with `mkdocs gh-deploy --remote-name webserver:project.git`.\n * The hook minimizes any changed pages, and then checks out the result in my\n   web root.\n\n[hook]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks\n\n## Building\n\nYou can do a regular build with Cargo, although it may not be very portable, as\nit depends on e.g. `libbrotlienc`, `libgit2`, etc. Alternatively, you can build\na static executable with Nix (2.10 or later, for flake support):\n\n    $ nix build\n    $ ldd result/bin/minimizer\n    statically linked\n\nThe static binary works on [Flatcar][flatcar] without the need to install any\ndependencies, so it works well in combination with a [Miniserver][miniserver]\ndeployment of Nginx on Flatcar.\n\n[flatcar]: https://www.flatcar.org/\n[miniserver]: https://github.com/ruuda/miniserver\n\n## License\n\nMinimizer is licensed under the [Apache 2.0][apache2] license.\n\n[apache2]: https://www.apache.org/licenses/LICENSE-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruuda%2Fminimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruuda%2Fminimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruuda%2Fminimizer/lists"}