Dark mode for Ghost
Ghost has code injection in its admin settings. Code in Site header is added to every page.
Add DarkYes to your Ghost site
- 1
Create a free DarkYes account and add your site's address. In your dashboard, press Get the code next to the site, then Copy code.
Your line looks like this, with your own key in place of
YOUR-KEY:<script src="https://darkyes.com/d.js" data-key="YOUR-KEY" async></script> - 2
In Ghost Admin, go to Settings, then Code injection.
- 3
Paste your line into Site header.
- 4
Save.
If your theme already has dark styles that follow the device's setting, the automatic engine of DarkYes uses them, and adds the switch so that visitors can choose.
Check that it works
- 1
Open your site in a private window.
- 2
Look for the switch in the bottom-right corner, and press it.
- 3
In your dashboard, the site changes from “Waiting for the first visit” to “Active”.
Remove it
Delete the line from Site header and save.
Your site then looks exactly as it did before.
These steps were checked against Ghost's guide to code injection on 14 November 2026.
Try it on your own site.
Create a free account, add your site and paste one line. When your first site goes live, you get 14 days of Pro for free.