V2
Use this guide to migrate your project from Doks v1 to Doks v2.
Prerequisites
- Hugo (latest extended or extended/deploy edition)
- Dart Sass (latest version)
- Node.js/npm (latest LTS version)
Updating
Follow the steps below to update your project.
Remove currently installed dependencies to avoid version conflicts:
Update
package.jsonReplace the contents of your project’s
package.jsonwith the following template:{ "name": "doks", "version": "0.0.0", "description": "Doks theme", "author": "Thulite", "license": "MIT", "scripts": { "create": "hugo new", "dev": "hugo server --disableFastRender --noHTTPCache", "portless": "portless run thulite-portless", "format": "prettier **/** -w -c", "build": "hugo --minify --gc", "preview": "vite preview --outDir public" }, "engines": { "node": ">=20.11.0" } }Install the latest Thulite and Doks dependencies in your project:
Install the latest versions of Portless, Prettier, and Vite as
devDependencies:Install the recommended integrations in your project:
Add the following to
layouts/_partials/head/dartsass.html:{{- /* Transpile SCSS with Dart Sass and silence legacy dependency warnings. */ -}} {{ with resources.Get . -}} {{ $opts := dict "enableSourceMap" hugo.IsDevelopment "outputStyle" (cond hugo.IsDevelopment "expanded" "compressed") "transpiler" "dartsass" "includePaths" (slice "node_modules") "silenceDeprecations" (slice "import" "if-function" "global-builtin" "color-functions") "silenceDependencyDeprecations" true -}} {{ with . | css.Sass $opts -}} {{ if hugo.IsDevelopment -}} <link rel="stylesheet" href="{{ .RelPermalink }}"> {{ else -}} {{/* PostProcess defers PostCSS until hugo_stats.json is complete. */ -}} {{ with . | postCSS (dict "config" "config/postcss.config.js") | fingerprint | resources.PostProcess -}} <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"> {{ end -}} {{ end -}} {{ end -}} {{ end -}}
Need to continue?
After upgrading Doks to the latest version, you may not need to make any changes to your project at all!
If you notice errors or unexpected behavior, review the sections below to identify project changes you may still need to make.
Configuration
Review your project configuration for Doks, Thulite, and the recommended integrations:
Known Issues
ENOENT
If you get an ENOENT error, run the following command: