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.

Documentation links change from the "server" mode and "build" mode.

See original GitHub issue

Prerequisites

Description

Documentation links change from the “server” mode and “build” mode.

When linking related documentation pages together using markdown, the links will either work in “server” mode, or “build” mode, but not both.

Given these pages in the docs/ folder:

01-getting-started.md
02-change-log.md

When running in “server” mode, a link from the first page to the second is written as: [Change Log](./change_log).

When running in “build” mode, a link from the first page to the second is written as: [Change Log](./change_log.html)

Steps to Reproduce

  1. Create two markdown pages in the docs/ folder (i.e. “01-getting-started.md” and “02-change-log.md”)
  2. Add a markdown link from one page to another, such as [Change Log](./change-log).
  3. Start fractal in “server” mode.
  4. View the page with the link, and click on the link. It takes you to the second page.
  5. Run fractal build
  6. Start a static web server which serves the content
  7. View the page with the link, and click on the link. It will return an HTTP 404 Not Found error page.

Conversely:

  1. Create two markdown pages in the docs/ folder (i.e. “01-getting-started.md” and “02-change-log.md”)
  2. Add a markdown link from one page to another, such as [Change Log](./change-log.html).
  3. Start fractal in “server” mode.
  4. View the page with the link, and click on the link. It returns a fractal Not Found page.
  5. Run fractal build
  6. Start a static web server which serves the content
  7. View the page with the link, and click on the link. It takes you to the second page.

Expected behavior: Links from the “server” mode and “build” mode will be consistent, and don’t require re-writing, depending on the way that fractal is run.

Actual behavior: Links from the “server” mode and “build” mode must be written differently, meaning that either the links don’t work during development, or the links don’t work in the published static site.

Reproduces how often: 100%

Reduced test case: https://gist.github.com/dzwarg/f555265c7ba1ba789d458dbc578382ea

Versions

  • What version of Fractal are you running? 1.2.0
  • What version of Node.js are you running? 10.16.3

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Chapabucommented, Nov 8, 2019

My worry with the proposed feature is that it’s a big change. Arguably a BC breaking change. It’s something that could potentially be hidden behind a configuration option, but I’m a bit wary that configuring Fractal is already a bit opaque (in that it differs from the way you configure most other Node apps), and adding more options adds overhead.

I think that in general a better way to link between docs/components would be a good compromise. Maybe we could leverage the current handle system, so something like [Foo](@foo) could be re-written to the correct URL. This would also allow components to be moved without docs breaking. The fact that it’s an invalid link may be a concern, but bearing in mind that these links won’t work anyway until Fractal is either built, or running in server mode - maybe that doesn’t matter?

0reactions
mihkeleidastcommented, Apr 16, 2020

Reopened this since this is actually a bug in core.

In order to get the correct URLs, you should use the path helper that’s been provided by most official adapters. For example, with the default handlebars adapter, [Change Log]({{path './change_log'}}) should do the trick.

However, the core utility function that the path helpers in adapters use, returns early for relative paths. This is a bug, since even relative paths should be appended with the proper file extension.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Project configuration - Generate, publish, and share ... - Retype
The path to a logo file (dark mode) relative to the input , or ... Setting a repo value will enable the Edit...
Read more >
Use the Quick Links web part - Microsoft Support
Edit links ​​ If your page is not already in edit mode, select Edit at the top right of the page. Hover over...
Read more >
TeamCity On-Premises - Managing Roles and Permissions
To change the authorization mode, go to Administration | Authentication and enable/disable the Enable per-project permissions option.
Read more >
Server.properties - Minecraft Wiki - Fandom
After changes are made to the server.properties file, the server must be ... Allowed values: Any positive integer online-mode=true # If true then...
Read more >
Deployment - Angular
When you are ready to deploy your Angular application to a remote server, ... On the first terminal, run the ng build command...
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