question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow linking to versioned docs from footer and page

See original GitHub issue

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I’m using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

I’m expecting to be able to use links in pages (such as index.js) and in the footer config to docs.

We would like to have all files under the docs directory to be served at the root of the site. We would also like to have the URLs for all docs versioned, so we’re following the setup for the second use case described here: https://docusaurus.io/docs/versioning#configuring-versioning-behavior.

When doing this, the links on the included reproduction site on index.js as well as the footer are broken.

Reproducible demo

https://stackblitz.com/edit/github-pryivb?file=docusaurus.config.js

Steps to reproduce

  1. In docusaurus.config.js, in the docs preset object, set routeBasePath to “/” and add the following object under `versions’:
current: {
  label: 'v1',
  path: 'v1'
}
  1. See how the footer link and the tutorial link on the index page are now broken

Expected behavior

Docusaurus should be able to build the urls similar to how it is in the navBar (by introducing an item option to the footer to be able to specify type: 'doc' and docId: 'your-doc-id-here. If there is not currently a way to reference a page like this from a non-doc page (such as index.js), I would expect some sort of API from Docusaurus to allow it to build out this link dynamically (similar to how the navbar links are)

Actual behavior

The links to docs are broken (see Docs -> Tutorial in the footer and the “Docusaurus Tutorial - 5min” button link on index.js)

Your environment

Self-service

  • I’d be willing to fix this bug myself.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
slorbercommented, May 25, 2022

👍 for DocLink as a public API and usable in footer.It can use useLayoutDoc(docId, docsPluginId) similarly to DocNavbarItem

It would be fine to replace the setup we have for NavbarItems because users may also want custom footer items later and we could also introduce other item types

1reaction
Josh-Cenacommented, May 13, 2022

That could work, yeah. If you want to make a POC, feel free to!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use versioning with Word. - Microsoft Support
To use versioning in Word, you need to store your documents in either OneDrive or in a SharePoint Library. When documents are stored...
Read more >
How can I add version control info (to footers say?) - TeX
I've added a command to print a preliminary page containing the title, author etc. and a table of revision information for all files...
Read more >
Versioning - Docusaurus
You can use the versioning CLI to create a new documentation version based on the latest ... A typical versioned doc site looks...
Read more >
Make Google Docs, Sheets, Slides & Forms public
After you publish your file you can send a new URL to anyone or embed into your website. Important: Based on your account's...
Read more >
Version Control: A Good Practice Guide - University of Glasgow
It is a tool which tracks a series of draft documents, culminating in a final version. ... title page, and also in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found