Skip to content

Instant navigation not working when using mike versioning with alias #126

@kimdre

Description

@kimdre

Context

I have the following site versions using your fork of mike with latest being the default alias that I try to get working with alias-type symlink (the default mode):

  • next
  • v0.81 [latest]
  • v0.80

Bug description

When I visit my site at the domain example.com and then get redirected to example.com/latest/ (the default alias), the instant navigation (especially instant prefetching and instant previews (with automatic previews)) do not work.
When I visit the site on the version behind latest directly (in my case example.com/v0.81/), the features work fine.

I think this is caused because the sitemap.xml is built with urls being something like example.com/v0.81/foo instead of example.com/latest/foo

Using the alias type redirect in mike (which does a 301 html redirect latest -> v0.81 works, but I would prefer to use alias-type symlink if possible.

Related links

Reproduction

Set in zensical.toml:

[project]
site_url = "https://example.com/"

[project.extra.version]
provider = "mike"
default = "latest"
alias = true

Versions

  • next -> works
  • v0.81 directly -> works
  • v0.81 behind latest alias -> not working
  • v0.80 -> works

Steps to reproduce

  1. Create docs version with alias: mike deploy --push --update-aliases v0.81 latest
  2. Set default mike set-default --push latest
  3. Run server mike serve or deploy to production
  4. Visit the site on / or /latest/
  5. Check for tooltips when hovering over links and check network tab in browser dev tools for loading pages
  6. Check urls in sitemap.xml

Browser

Chrome

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs investigationIssue must be investigated by the maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions