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

As a maintainer, I want the links for navigation to be in a json/yaml, so that I can easily reuse them in different components without having to hardcode the data #62

Open
simon-wg opened this issue Apr 19, 2024 · 3 comments · May be fixed by #121
Labels
suggestion This is a suggestion for a new feature or change

Comments

@simon-wg
Copy link
Contributor

simon-wg commented Apr 19, 2024

📝 Description

I want to have a file containing all links and texts so that it can be reused in multiple components.
One example would be something like:

Navigation:
  Sektionen:
    Link:
      URL: "/groups"
      Text: "Kommittéer, föreningar och andra instanser"
    Link:
      URL: "https://dokument.chalmers.it"
      Text: "Dokument"
  Link:
    URL: "/contact"
    Text: "Kontakt"

✅ Acceptance Criteria

-[] All navmenus use data from a file instead of hardcoded values.
-[] We have a file containing mappings of links, and dropdowns containing links.

💡 Additional context

No response

@simon-wg simon-wg added the suggestion This is a suggestion for a new feature or change label Apr 19, 2024
@simon-wg simon-wg assigned simon-wg and unassigned simon-wg Apr 19, 2024
@simon-wg
Copy link
Contributor Author

@GAsplund opinions on this? I came up with the idea after discussing how to manage the mobilenav I'm currently designing with some people. If we implement this we could also allow for editing links and texts directly on the website and keep the file in a volume for persistence between redeploys.

@GAsplund
Copy link
Member

GAsplund commented Apr 19, 2024

I like the idea, as it would greatly decrease the need for pushing new commits if the header needs to change. However, I think using the database for storing these would be a better way to do it. I could see there being links stored in a key-value fashion (like they are on nollk.it) in order to store arbitrary links, but for this site I don't see other cases than the header for having editable links.

My pseudocode for this looks like:

categories:
id: number
nameEn: string
nameSv: string
url: string (nullable)

categoryLinks:
id: number [id]
nameEn: string
nameSv: string
category: number (FK -> categories.id)
url: string

@simon-wg
Copy link
Contributor Author

That's a fair argument, I agree that the links are unlikely to be updated often.
I will take a look at implementing something similar to your code, as well as the mobile nav-drawer during the next workshop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion This is a suggestion for a new feature or change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants