{"id":19690940,"url":"https://github.com/insidegui/darkimagepublishplugin","last_synced_at":"2026-02-25T08:38:29.419Z","repository":{"id":40479794,"uuid":"243304904","full_name":"insidegui/DarkImagePublishPlugin","owner":"insidegui","description":"Publish plugin that lets you have both light and dark mode variants for images on your site 😎","archived":false,"fork":false,"pushed_at":"2022-05-05T17:52:26.000Z","size":579,"stargazers_count":52,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-22T09:26:23.552Z","etag":null,"topics":["publish-plugin"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/insidegui.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}},"created_at":"2020-02-26T16:04:37.000Z","updated_at":"2025-08-30T04:20:05.000Z","dependencies_parsed_at":"2022-08-09T21:40:52.515Z","dependency_job_id":null,"html_url":"https://github.com/insidegui/DarkImagePublishPlugin","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/insidegui/DarkImagePublishPlugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insidegui%2FDarkImagePublishPlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insidegui%2FDarkImagePublishPlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insidegui%2FDarkImagePublishPlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insidegui%2FDarkImagePublishPlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insidegui","download_url":"https://codeload.github.com/insidegui/DarkImagePublishPlugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insidegui%2FDarkImagePublishPlugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29815024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T05:36:42.804Z","status":"ssl_error","status_checked_at":"2026-02-25T05:36:31.934Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["publish-plugin"],"created_at":"2024-11-11T19:07:22.317Z","updated_at":"2026-02-25T08:38:29.398Z","avatar_url":"https://github.com/insidegui.png","language":"Swift","readme":"# DarkImagePublishPlugin 😎\n\nA plugin for [Publish](https://github.com/JohnSundell/Publish) that lets you have two variants for images on your site: one for light mode, and one for dark mode. This is currently used in [rambo.codes](https://rambo.codes).\n\n![demo](./demo.gif)\n\n## How to use it\n\nJust use the regular markdown syntax for images and the plugin takes care of the rest, so that the following markdown:\n\n```markdown\n![some image](/assets/img/2/1.png)\n```\n\nBecomes this in HTML:\n\n```html\n\u003cfigure\u003e\n\t\u003cpicture\u003e\n\t\t\u003csource srcset=\"/assets/img/2/1-dark.png\" media=\"(prefers-color-scheme: dark)\"\u003e\n\t\t\u003cimg src=\"/assets/img/2/1.png\" alt=\"some image\"\u003e\n\t\u003c/picture\u003e\n\u003c/figure\u003e\n```\n\n## Installing the plugin\n\nTo install the plugin, add it to your site's publishing steps:\n\n```swift\ntry mysite().publish(using: [\n    .installPlugin(.darkImage()),\n    // ...\n])\n```\n\nYou can customize the suffix that's used for the dark variant by passing the `suffix` parameter:\n\n```swift\ntry mysite().publish(using: [\n    .installPlugin(.darkImage(suffix: \"bestmode\")),\n    // ...\n])\n```\n\n## Light-only images\n\nIn some cases, you might have just a single variant of an image, so trying to load the dark variant would fail. If you have an image with only a single variant, add the `?nodark` suffix to your image's path/URL:\n\n```markdown\n![some image](/assets/img/2/1.png?nodark)\n```\n\nIn that case, the generated HTML will look like this:\n\n```html\n\u003cfigure\u003e\n\t\u003cpicture\u003e\n\t\t\u003cimg src=\"/assets/img/2/1.png\" alt=\"some image\"\u003e\n\t\u003c/picture\u003e\n\u003c/figure\u003e\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsidegui%2Fdarkimagepublishplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsidegui%2Fdarkimagepublishplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsidegui%2Fdarkimagepublishplugin/lists"}