Wiki.js comes bundled with a default theme, which supports both light and dark mode, and should be sufficient for most users.
It's not yet possible to change or download new themes. This is planned for a future release.
Custom themes are not yet fully supported. It's however possible to manually create one and compile it as part of the bundle.
The instructions below are for developers that are comfortable with Node.js / Vue.js development.
All aspects of a content page can be modified, with the except of the header (top black navigation bar). Because the header is dynamic and used consistently across all parts of the wiki (admin, editor, profile, etc.), it cannot be modified.
You'll first need to setup your dev environment before going any further.
From the client/themes
folder. Create a copy of the default
folder and rename it to anything you like (e.g. mytheme
). The folder name must be lowercase, no spaces or special characters.
A theme folder is composed of the following elements:
page.vue
and is mandatory.app.js
and is mandatory (can be an empty file).app.scss
and is mandatory (can be an empty file).Use the yarn dev
command to start Wiki.js in development mode. Any changes you make to your theme will automatically rebuild the client assets.
In order for Wiki.js to use your theme, you must first set it as the active theme. It's not possible to do it via the Administration Area just yet. You'll need to modify the database directly:
settings
table, locate the theming
row and edit the JSON value field.theme
property to the name of the folder you created earlier and commit the change.rs
+ ENTER in your terminal to automatically reload the server)The components/page.vue
is the main view. You can include other components from here.
The
props
object and thecreated()
method must stay intact! This is where page data is persisted to the store and is used across the application. Altering them can break the whole page!
Once your theme is ready, you need to compile the project for deployment.
Note that you will need to modify your production database to use your custom theme as well. Use the same instructions as above.
Run the docker build command below (changing the tag to your own docker repository name):
docker build -f dev/build/Dockerfile -t my-org/wiki:some-tag .
Run the build command:
yarn build
This will generate a new folder named assets
along with views under the /server/views
folder. Copy + Paste both folders to your production server and restart your wiki.