Reputation: 1
I created a conlang with my friend and we decided to make an online dictionary for it. All of the pages are dynamically generated using node.js, express, and handlebars. The data for the pages are stored in .json files to allow for easy editing.
An issue arises when I give a word multiple english translations, it all shows up in a string 'at, on, in' on the words page. This was bound to happen cause I never implemented a system to account for this.
What I need is to have these translations show up separately on the words page under the correct letter heading but still link to the same word page. I do not want to restructure my data majorly, but if it's required I will. The result should look like this (This is an old static site)
I apologise for the lack of comments, I will be adding more in a little bit. I also apologise if I have forgotten and important piece of information.
I have tried automatically formatting english translations into arrays and the looping through it, but I couldn't find a working solution that was neat, didn't require ridiculous amounts of changes, and still auto sorted the words into groups. The results of that attempt, just broke every page on the site. Adding multiple word entries in the .json file also doesn't work as it link to the one highest in the file and it makes data more clunky.
I could not find any similar questions anywhere else on the internet and AI did not help in anyway.
Is there also anyway to make the URL https://grifeng.org/word/d%C3%BCf.html
look like https://grifeng.org/word/düf.html
instead?
CODE: https://github.com/mcl-playz/grifeng WEBSITE: https://grifeng.org The related code is in words.json, server.js, templates/words.html, templates/word.html
Upvotes: 0
Views: 36