diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 655f60d58..d895d4148 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -2,6 +2,8 @@ #### Improvements 🧹 +- `` attribute of HTML in watch mode is the base file name, instead of the whole path. [#1054](https://github.com/terrastruct/d2/pull/1054) + #### Bugfixes ⛑️ - Code blocks are not affected by uppercasing from special themes like Terminal. [#1053](https://github.com/terrastruct/d2/pull/1053) diff --git a/d2cli/watch.go b/d2cli/watch.go index ca2280dc0..9e3e80010 100644 --- a/d2cli/watch.go +++ b/d2cli/watch.go @@ -433,7 +433,7 @@ func (w *watcher) handleRoot(hw http.ResponseWriter, r *http.Request) { <div id="d2-err" style="display: none"></div> <div id="d2-svg-container"></div> </body> -</html>`, w.outputPath, w.devMode) +</html>`, filepath.Base(w.outputPath), w.devMode) } func (w *watcher) handleWatch(hw http.ResponseWriter, r *http.Request) error {