Skip to content

Conversation

AgniveshChaubey
Copy link
Collaborator

@AgniveshChaubey AgniveshChaubey commented Mar 23, 2025

I have extended the shortcode to accept two more arguments ('vocabulary' and 'dialect'), with 'dialect' being optional. @jviotti, the link you provided here for the ref shortcode seems to be broken, and with quick googling, I couldn't find a way to use one shortcode inside another.
BTW, I'm not sure if we need to use the ref shortcode here, as hugo by default returns a "Page Not Found" response when it cant find the page.

Signed-off-by: Agnivesh Chaubey <agniveshvapi@gmail.com>
@jviotti
Copy link
Member

jviotti commented Mar 24, 2025

Shaping up, but I can see that the keyword names are getting lowercase:

Screenshot 2025-03-24 at 10 14 04 am

@AgniveshChaubey
Copy link
Collaborator Author

Oops! I missed that. Actually I intentionally converted them to lowercase, basause the URL was not working with camelCase words.

I'll make a copy of the keyword before converting it to lowercase in order to preserve its case during render.

@jviotti
Copy link
Member

jviotti commented Mar 25, 2025

Could be a bit overkill, but it might be worth trying to generate keywords links like this. i.e. also putting the vocabulary in parenthesis. Maybe these links we put in the reference tables would just be instances of the same link macro. If it works, it could be interesting as a canonical way of referencing keywords everywhere, also including a link to the vocabulary, which can come handy.

Screenshot 2025-03-25 at 11 30 08 am

Signed-off-by: Agnivesh Chaubey <agniveshvapi@gmail.com>
@AgniveshChaubey
Copy link
Collaborator Author

In the latest changes, keyword casing has been preserved and ref shortcode have been used to catch broken links. Also, as per the suggestion, now, the link shortcode now renders vocabulary name inside parentheses
image

@jviotti
Copy link
Member

jviotti commented Mar 27, 2025

What do you think about mentioning the vocabulary? Does it feel OK to you, or is it too much?

@AgniveshChaubey
Copy link
Collaborator Author

I'd say let's avoid mentioning vocabulary along with keywords. If we really wanna include it, one thing we can do is include the vocabulary name inside a tool tip.

@jviotti
Copy link
Member

jviotti commented Mar 28, 2025

Sounds good. Let's do that then

Signed-off-by: Agnivesh Chaubey <agniveshvapi@gmail.com>
@AgniveshChaubey
Copy link
Collaborator Author

The latest changes should show the vocabulary name inside a tootip. I wasnt able to test that because not sure why all of a sudden I started getting the following error:

ERROR js.Build failed: Could not resolve "@popperjs/core"
WARN found no layout file for "html" for kind "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
Built in 1465 ms
Error: error building site: JSBUILD: failed to transform "main.js" (text/javascript): "C:\Users\agniv\Documents\learnjsonschema\assets\main.js:3:17": Could not resolve "fuse.js"
make: *** [Makefile:12: all] Error 1

I tried deleting node_modules and package-lock.json and then reinstalled them to make sure all the dependencies ware present, but the error still persists.

The changes should show the tooltip as expected. Just give a confirmation for that so that slowly I can start replacing all the keyword occurances with the link shortcode.

Copy link
Member

@jviotti jviotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Looks great! Let's get this one merged and feel free to send more PRs incrementally updating things everywhere. Small PRs per keyword are probably better than a big one. I'm doing various updates to the site, so it will help avoiding potential conflicts.

@jviotti jviotti changed the title follow up: #244 (Link the keywords to their respective pages) Introduce a convenience shortcode to link to keywords Mar 31, 2025
@jviotti jviotti merged commit 74f49f2 into main Mar 31, 2025
1 of 2 checks passed
@jviotti jviotti deleted the link-keyword branch March 31, 2025 13:39
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

Successfully merging this pull request may close these issues.

2 participants