quarto-dev / quarto-dev/quarto-cli

Hugo site with subdirectory url opens wrong url on preview

Open
#8,029 0 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Jan 2, 2024.

bug hugo
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

For Hugo sites with a subdirectory baseURL like https://example.com/blog, running hugo serve makes the site available at http://localhost:1313/blog. However, running quarto preview from the project root opens http://localhost:XXX in a browser rather than http://localhost:XXX/blog, and a 404 error is shown rather than the site home page.

Steps to reproduce
  1. git clone --recurse-submodules https://github.com/havijw/quarto-hugo-subdir-bug.git
  2. cd quarto-hugo-subdir-bug
  3. quarto preview
Expected behavior

Browser opens http://localhost:XXXX/subdir.

Actual behavior

Browser opens http://localhost:XXXX and displays 404 page not found. Navigating to http://localhost:XXXX/subdir displays the site as expected.

Your environment
  • MacOS Sonoma 14.1.1
  • VSCode
  • Python 3.11.6
Quarto check output
$ quarto check

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.450
      Path: /Applications/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.11.6
      Path: /opt/homebrew/opt/python@3.11/bin/python3.11
      Jupyter: 5.3.0
      Kernels: python3

(|) Checking Jupyter engine render....0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.3.2
      Path: /opt/homebrew/Cellar/r/4.3.2/lib/R
      LibPaths:
        - /opt/homebrew/lib/R/4.3/site-library
        - /opt/homebrew/Cellar/r/4.3.2/lib/R/library
      knitr: (None)
      rmarkdown: (None)

      The rmarkdown package is not available in this R installation.
      Install with install.packages("rmarkdown")

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.