Serve Hugo website during local development using code-server.
I am assuming that you are using default configuration for development.
$ tree config/
config/ ├── _default │ └── config.yml └── production └── config.yml 3 directories, 3 files
Create additional environment.
$ mkdir config/code-server-development
Enforce relative URLs.
$ echo "relativeURLs: true" | tee config/code-server-development/config.yml
Use code-server terminal to start built-in server. Notice that port is hidden, live browser reload is disabled, and environment defined earlier is used.
$ hugo server --clock $(date +"%Y-%m-%d" --date "next week") --appendPort=false --baseURL="/" --disableLiveReload --environment="code-server-development"
Start building sites … hugo v0.108.0-a0d64a46e36dd2f503bfd5ba1a5807b900df231d+extended linux/arm64 BuildDate=2022-12-06T13:37:56Z VendorInfo=gohugoio | EN -------------------+------- Pages | 1571 Paginator pages | 0 Non-page files | 0 Static files | 2078 Processed images | 0 Aliases | 0 Sitemaps | 1 Cleaned | 0 Built in 7213 ms Watching for changes in /home/milosz/Projekty/sleeplessbeastie.eu/{assets,content,layouts,static,themes} Watching for config changes in /home/milosz/Projekty/sleeplessbeastie.eu/config/_default, /home/milosz/Projekty/sleeplessbeastie.eu/config/code-server-development Environment: "code-server-development" Serving pages from memory Web Server is available at / (bind address 127.0.0.1) Press Ctrl+C to stop Change detected, rebuilding site. 2023-01-30 01:00:28.908 +0100 Source changed WRITE "/home/milosz/Projekty/sleeplessbeastie.eu/content/posts/2023/hugo_draft.md" Total in 4892 ms ...
Use ports tab to inspect forwarded port.

Open https://code-server.example.org/proxy/1313/
to access development site.