Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
danicheg opened this issue Jan 16, 2024 · 1 comment

Comments

@danicheg
Copy link

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.

@danicheg
Copy link
Author

I managed to solve the issue by changing a little bit the approach of publishing a website to GH pages — by using external Github Action instead of mdoc/docusaurusPublishGhpages. If one expresses interest, you can find the workflow for publishing here https://github.com/scalacenter/scalac-profiling/blob/42ea7396f0cdabf5ed5dd91f7aa3769537ef4870/.github/workflows/publish-website.yml

I will leave this issue open and delegate deciding to maintainers on whether something should be tweaked in the mdoc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant