Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with links with alternative title when deploying to GitHub pages #14

Open
bellons91 opened this issue Sep 13, 2023 · 4 comments
Open
Assignees

Comments

@bellons91
Copy link

Hello!

I'm using this theme to render some notes, and I noticed a weird behaviour when I deployed the page using GitHub pages.

When using wikilinks with an alternative name, like this:

text that references [[pagetitle|a name]]

The page link is correctly handled in Visual Studio, but there are some issues on the deployed website:

  1. the alternative name is ignored, and the link text is the whole wikilink text;
  2. the linked page always refers the root folder, even if the link refers to a subfolder;
  3. the graph does not show the correct references.

If I don't use the alternative name, everything works well.

Here's a real example:

Under the /azure folder I have several documents. In particular, I have azure-storage-redundancy-types.md, azure-virtual-machines.md, and azure-availability-zones.md.

Wrong link generation

The first page references the other two like this:

ZRS replicates your Azure Storage data **synchronously** across **three [[azure-availability-zones|availability zones]] in the primary region**.

and

When creating a storage account, you must select the primary region. The paired secondary region is assigned automatically, based on [[azure-region-pairs]], and cannot be changed.

The VSCode extension generates the following links:

[//begin]: # "Autogenerated link references for markdown compatibility"
[azure-availability-zones|availability zones]: azure-availability-zones "Azure Availability Zones"
[azure-region-pairs]: azure-region-pairs "Azure Region Pairs"
[//end]: # "Autogenerated link references"

Notice that the title of the "Availability zone" link is wrong: it should be "availability zones", not "Azure Availability Zones".

The markdown preview on VSCode is correct:

image

while the link on the deployed site uses the wrong title:

image

Wrong link destination

Clicking on the link, you get redirected to a page on the root folder (that does not exist) instead of the correct one under /azure.

Graph

By looking at the graph generated on VSCode, we can see 1 inbound link and 2 outbound links:

image

While on the deployed site, we have only 1 outbound link:

image

@bellons91
Copy link
Author

Ah, I have set foam.edit.linkReferenceDefinitions to withoutExtensions in my settings, under .vscode/foam.json

That file is under source control.

@hikerpig hikerpig self-assigned this Sep 14, 2023
@bellons91
Copy link
Author

Hi @hikerpig, any news on this bug?

@hikerpig
Copy link
Owner

Sorry that I've missed this since I have a very busy year , I will try to have a look on this issue this week.

@hikerpig
Copy link
Owner

hikerpig commented Dec 23, 2023

This will be a missing feature for the gatsby theme https://gatsby-project-kb.vercel.app/features/wiki-links .
Currenty it does not support alternative title - aka the | note .
The Foam extension of VSCode does suppport it so you can get the preview quite right. But gatsby-project-kb does not use any of Foam's code directly so I will have to implement it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants