Skip to content

Unavoidable image compressing when publishing a site built with Docusaurus to GH pages #833

@danicheg

Description

@danicheg

Hey there. I found that every site under the Center organization has compressed images on their websites. I dug into the Docusaurus and mdoc and haven't found a way to workaround this.
For example, in bloop:
The original img: https://github.com/scalacenter/bloop/blob/main/website/static/img/build-tools-logos.png (37.7 KB)
The actual on the site: https://github.com/scalacenter/bloop/blob/gh-pages/img/build-tools-logos.png (28.8 KB)

Set up

In my case, the mdoc version is 2.5.2 and the Docusaurus version is 1.14.7.

Some details

When publishing a site to Github pages, the publish-gh-pages script ignores the options passed to the docusaurus-build (--skip-image-compression in my case). Running docusaurusCreateSite from mdoc before docusaurusPublishGhpages also doesn't help. However, when running docusaurusCreateSite locally, docusaurus-build uses the passed options properly, and ./website/build/foo/img contains uncompressed images.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions