-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add functionality for loading in link trees depending on subdomain #7
+347
−212
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
475d725
Add functionality for loading in link trees depending on subdomain
Benjaneb 2f0d2ca
Host images on Yoggi
Benjaneb dcf9b7e
Better formatting for JSON files
Benjaneb 75ca8c3
Functional deliciousness
Benjaneb 4962d6f
Don't set whichLinks
Benjaneb 1bcb2ff
Fix typo
Benjaneb e16c42c
Update dUrn to working image URL
Benjaneb 8972211
I thought I was smart, I was just not in the grindset
Benjaneb 7a883ff
Make more customizeable and use yaml, not json
Benjaneb 7b773a5
go mod tidy and remove indent
Benjaneb 1346394
Update links/systems.yml
Benjaneb e29efb7
Update links/sm.yml
Benjaneb cfa3fc0
Return 404
Benjaneb 2bad62b
Add README.md
Benjaneb 111f22f
Formatting
Benjaneb 19e4f2f
set sm.datasektionen.se explicitly
foodelevator 108af28
smUrn
foodelevator e129f13
Specify how to test link trees in README
Benjaneb 3eda37b
Merge remote-tracking branch 'origin/sm-links' into sm-links
Benjaneb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Aaallt | ||
|
||
Run locally with: `go run .` | ||
|
||
The different versions of Aaallt, with different links, are loaded dynamically depending on the subdomain and loads the corresponding YAML file with the same name in [links/](links/). When testing you can access each link tree at `<file-name>.localhost:3000` or simply `localhost:3000` for default Aaallt. | ||
|
||
[links/systems.yml](links/systems.yml) are the default links loaded for every subdomain. | ||
|
||
To create a new version/link tree, just create a new YAML file in [links/](links/) with the same format and point a subdomain to this system. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
module github.com/datasektionen/aaallt2 | ||
|
||
go 1.22.1 | ||
|
||
require gopkg.in/yaml.v3 v3.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= | ||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,18 +22,13 @@ | |
<script src="https://methone.datasektionen.se/bar.js"></script> | ||
<header> | ||
<div> | ||
<h1>Hoppsan, det där systemet fanns tydligen inte!</h1> | ||
<h1>{{ .Title }}</h1> | ||
</div> | ||
</header> | ||
<main> | ||
<p> | ||
Du har gått in på ett system som inte (längre?) finns. Det är jättesynd. Så synd att vi | ||
skulle vilja gräva upp det begravda Bawangmonstret för att glömma sorgen. | ||
</p> | ||
<h2>Andra system</h2> | ||
<p>Du kanske letade efter något av dessa system?</p> | ||
{{ .BeforeLinks }} | ||
<div id="systems"> | ||
{{ range . }} | ||
{{ range .Links }} | ||
<a href="{{ .URL }}"> | ||
<img style="{{ .IconStyle }}" src="{{ .Icon }}"> | ||
<div> | ||
|
@@ -43,25 +38,12 @@ <h3 style="color: {{ .Color }}">{{ .Name }}</h3> | |
</a> | ||
{{ end }} | ||
</div> | ||
<h2>Bygg ett nytt system på den här domänen!</h2> | ||
<p> | ||
Har du en idé om vad som skulle kunna finnas på den här sidan? Kom då till någon av | ||
Informationsorganets hackerkvällar! Där kan vi berätta lite om hur man kan gå tillväga | ||
och integrerar med våra andra system och till och med erbjuda hjälp på traven. | ||
</p> | ||
<p> | ||
Hackerkvällarna äger rum på torsdagar oftast i någon sal i E-huset. Exakt när och var | ||
bör annonseras på <a href="https://datasektionen.se/nyheter">sektionens webbsida</a>, | ||
men du kan också fråga Systemansvarig på <a href="[email protected]">epost</a>, | ||
eller kolla upp vem det är på | ||
<a href="https://dfunkt.datasektionen.se/position/id/40">dfunkt</a> och fråga denne på | ||
till exempel Discord. | ||
</p> | ||
{{ .AfterLinks }} | ||
</main> | ||
<footer> | ||
<p> | ||
Vänliga hälsningar, <br> | ||
<strong>Informationsorganet</strong> | ||
<strong>Systemgruppen</strong> | ||
</p> | ||
</footer> | ||
</body> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
title: SM Links | ||
beforelinks: "<p>Här finns länkar relevanta på SM samlade.</p>" | ||
afterlinks: | ||
links: | ||
- name: Handlingar | ||
description: Se dagordningen och bilagorna för mötet | ||
url: https://dsekt.se/handlingar | ||
icon: https://dsekt-assets.s3.amazonaws.com/namnder/systemgruppen/sm/handlingar.png | ||
color: "#ab000d" | ||
|
||
- name: Guide | ||
description: Lär dig hur man SM:ar | ||
url: https://dsekt.se/smguide | ||
icon: https://dsekt-assets.s3.amazonaws.com/namnder/systemgruppen/sm/guide.png | ||
color: "#216C2A" | ||
|
||
- name: Närvaro | ||
description: Anmäl att du är närvarande om du inte redan gjort det i dörren | ||
url: https://dsekt.se/smnarvaro | ||
icon: https://dsekt-assets.s3.amazonaws.com/namnder/systemgruppen/sm/narvaro.png | ||
color: "#216C2A" | ||
|
||
- name: VoteIT | ||
description: Rösta här | ||
url: https://ths.voteit.se | ||
icon: https://dsekt-assets.s3.amazonaws.com/namnder/systemgruppen/sm/voteit.png | ||
color: "#216C2A" | ||
|
||
- name: Betting | ||
description: Gissa rätt på när SM slutar och vinn chansen att köpa ett märke | ||
url: https://betting.datasektionen.se | ||
icon: https://dsekt-assets.s3.amazonaws.com/namnder/systemgruppen/sm/betting.png | ||
color: "#216C2A" | ||
|
||
- name: SM-chatter | ||
description: Snacka skit under mötet | ||
url: https://dsekt.se/smchatter | ||
icon: https://dsekt-assets.s3.amazonaws.com/namnder/systemgruppen/sm/chatter.png | ||
color: "#216C2A" | ||
|
||
- name: Valhandlingar | ||
description: Se vilka som ställer upp för vilka poster | ||
url: https://dsekt.se/valhandlingar | ||
icon: https://dsekt-assets.s3.amazonaws.com/namnder/systemgruppen/sm/val.png | ||
color: "#216C2A" | ||
|
||
- name: SM-arkiv | ||
description: Se kallelse handlingar och protokoll för gamla eller kommande SM | ||
url: https://dsekt.se/sm | ||
icon: https://dsekt-assets.s3.amazonaws.com/namnder/systemgruppen/sm/arkiv.png | ||
color: "#216C2A" | ||
Benjaneb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
sensitive: true | ||
|
||
- name: dUrn | ||
description: Rösta i aktiva urnval | ||
url: https://durn.datasektionen.se | ||
icon: https://durn.datasektionen.se/public/favicon.png | ||
color: "#216C2A" | ||
|
||
- name: Schulze-metoden | ||
description: Lär dig hur Schulze-metoden fungerar | ||
url: https://en.wikipedia.org/wiki/Schulze_method | ||
icon: https://dsekt-assets.s3.amazonaws.com/namnder/systemgruppen/sm/schulze.png | ||
color: "#216C2A" | ||
|
||
- name: smUrn | ||
description: Rösta här med | ||
url: https://smurn.datasektionen.se/ | ||
icon: https://smurn.datasektionen.se/public/favicon-sm.png | ||
color: "#e52575" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
title: Hoppsan, det där systemet fanns tydligen inte! | ||
beforelinks: > | ||
<p> | ||
Du har gått in på ett system som inte (längre?) finns. Det är jättesynd. Så synd att vi | ||
skulle vilja gräva upp det begravda Bawangmonstret för att glömma sorgen. | ||
</p> | ||
<h2>Andra system</h2> | ||
<p>Du kanske letade efter något av dessa system?</p> | ||
afterlinks: > | ||
<h2>Bygg ett nytt system på den här domänen!</h2> | ||
<p> | ||
Har du en idé om vad som skulle kunna finnas på den här sidan? Kom då till någon av | ||
Systemgruppens hackerkvällar! Där kan vi berätta lite om hur man kan gå tillväga | ||
och integrerar med våra andra system och till och med erbjuda hjälp på traven. | ||
</p> | ||
<p> | ||
Hackerkvällarna äger rum på torsdagar oftast i någon sal i E-huset. Exakt när och var | ||
bör annonseras på <a href="https://datasektionen.se/nyheter">sektionens webbsida</a>, | ||
men du kan också fråga Systemansvarig på <a href="[email protected]">epost</a>, | ||
eller kolla upp vem det är på | ||
<a href="https://dfunkt.datasektionen.se/position/id/40">dfunkt</a> och fråga denne på | ||
till exempel Discord. | ||
</p> | ||
links: | ||
- name: Datasektionen.se | ||
description: Hitta all information och nyheter om sektionen | ||
url: https://datasektionen.se | ||
icon: https://datasektionen.se/icons/favicon-96x96.png | ||
color: "#ff9800" | ||
|
||
- name: Cashflow | ||
description: Få tillbaka pengar för dina utlägg | ||
url: https://cashflow.datasektionen.se | ||
icon: https://cashflow.datasektionen.se/static/images/logos/favicon-96x96.png | ||
color: "#216C2A" | ||
|
||
- name: METAmost | ||
description: Tyvärr inte Matrix eller Zulip | ||
url: https://mattermost.datasektionen.se | ||
icon: https://mattermost.datasektionen.se/static/images/favicon/favicon-default-96x96.png | ||
color: "#1b1d21" | ||
|
||
- name: Bokningssystemet | ||
description: Boka META, Mötesrummet, bilarna, eller annat | ||
url: https://bokning.datasektionen.se | ||
icon: https://bokning.datasektionen.se/logos/favicon-96x96.png | ||
color: "#03a9f4" | ||
|
||
- name: Valsystemet | ||
description: Se till att någon tar ansvar | ||
url: https://val.datasektionen.se | ||
icon: https://val.datasektionen.se/images/logos/favicon-96x96.png | ||
color: "#07d" | ||
sensitive: true | ||
|
||
- name: Styrdokument | ||
description: Stadgar, reglemente, PM, och policydokument | ||
url: https://styrdokument.datasektionen.se | ||
icon: https://styrdokument.datasektionen.se/static/favicon-96x96.png | ||
color: "#ff9800" | ||
|
||
- name: Budgetsystemet | ||
description: Se vad sektionen gör av sina pengar | ||
url: https://budget.datasektionen.se | ||
icon: https://budget.datasektionen.se/static/images/icons/favicon-96x96.png | ||
color: "#3d3846" | ||
|
||
- name: Dfunkt | ||
description: Vem gör vad egentligen? | ||
url: https://dfunkt.datasektionen.se | ||
icon: https://dfunkt.datasektionen.se/images/logos/favicon-96x96.png | ||
color: "#9c27b0" | ||
|
||
- name: dJulkalendern | ||
description: Vem är bäst på att data™? | ||
url: https://djulkalendern.se | ||
icon: https://djulkalendern.se/images/djuldanke.svg | ||
color: "#B90e0a" | ||
|
||
- name: Aaallt | ||
description: Det här "systemet" | ||
url: https://aaallt.datasektionen.se | ||
icon: https://aaallt.datasektionen.se/favicon-96x96.png | ||
color: "#ffca28" | ||
|
||
- name: Betting | ||
description: När slutar SM? | ||
url: https://betting.datasektionen.se | ||
icon: https://betting.datasektionen.se/images/icons/favicon-96x96.png | ||
color: "#78909c" | ||
|
||
- name: Damm | ||
description: Datasektionens historia | ||
url: https://damm.datasektionen.se | ||
icon: https://damm.datasektionen.se/images/icons/favicon-96x96.png | ||
color: "#000000" | ||
|
||
- name: dbuggen | ||
description: Når ut till hundratals genom allt förutom TV | ||
url: https://dbu.gg | ||
icon: https://dbu.gg/favicon/favicon-96x96.png | ||
color: "#444" | ||
iconstyle: "border-radius: 50%" | ||
|
||
- name: ddagen.se | ||
description: Allt om D-dagen | ||
url: https://ddagen.se | ||
icon: https://ddagen.se/img/favicon.ico | ||
color: "#ec5f99" | ||
|
||
- name: /dev/audio | ||
description: Starkt är vackert | ||
url: https://audio.datasektionen.se | ||
icon: https://audio.datasektionen.se/favicon-32x32.png | ||
color: "#ff7043" | ||
|
||
- name: dJubileet | ||
description: Datasektionens 45-årsjubileum | ||
url: https://djubileet.se | ||
icon: https://djubileet.se/favicon.ico | ||
color: "#4E0093" | ||
|
||
- name: Duckumentation | ||
description: Dokumentation av API:er | ||
url: https://duckumentation.datasektionen.se | ||
icon: https://duckumentation.datasektionen.se/images/icons/favicon-96x96.png | ||
color: "#4caf50" | ||
|
||
- name: DUrn | ||
description: Röstningssystem vid urnval | ||
url: https://durn.datasektionen.se | ||
icon: https://durn.datasektionen.se/public/favicon.png | ||
color: "#0033cc" | ||
|
||
- name: GitHub | ||
description: Datasektionens GitHub | ||
url: https://github.com/datasektionen | ||
icon: https://github.com/favicon.ico | ||
color: "#000" | ||
|
||
- name: Metaspexet | ||
description: Datas och Medias spex! | ||
url: https://metaspexet.se | ||
icon: https://metaspexet.se/images/favicon.svg | ||
color: "#800000" | ||
iconstyle: "background-color: #6f1d1b; border: 2px solid #6f1d1b; border-radius: 50%" | ||
|
||
- name: META-TV | ||
description: Nå ut till hundratals genom META-TV | ||
url: https://tv.datasektionen.se | ||
icon: https://tv.datasektionen.se/favicon.png | ||
color: "#009688" | ||
|
||
- name: Nyhetssystemet | ||
description: Skriv och posta nyheter till hemsidan | ||
url: https://calypso.datasektionen.se | ||
icon: https://calypso.datasektionen.se/favicon-96x96.png | ||
color: "#ec407a" | ||
|
||
- name: Pico | ||
description: Länkförkortare | ||
url: https://dsekt.se | ||
icon: https://dsekt.se/favicon-96x96.png | ||
color: "#03a9f4" | ||
|
||
- name: Pls | ||
description: Lär dig ta ett nej | ||
url: https://pls.datasektionen.se | ||
icon: https://pls.datasektionen.se/images/logos/favicon-96x96.png | ||
color: "#9c27b0" | ||
|
||
- name: Sektionswikin | ||
description: Här hittar du massvis ackumulerad kunskap. | ||
url: https://wiki.datasektionen.se | ||
icon: https://wiki.datasektionen.se/resources/assets/skold_svart_thumb.png | ||
color: "#ff9800" | ||
|
||
- name: Status | ||
description: Ta reda på om något av våra system är nere | ||
url: https://status.datasektionen.se | ||
icon: https://userfiles.uptimerobot.com/img/623458-1649958820-icon.png | ||
color: "#32cd32" | ||
|
||
- name: STÖn | ||
description: Suck | ||
url: https://ston.datasektionen.se | ||
icon: https://ston.datasektionen.se/images/logos/favicon-96x96.png | ||
color: "#ec5f99" | ||
sensitive: true | ||
|
||
- name: Yoggi | ||
description: Ladda upp statiska filer i sektionssyfte | ||
url: https://static.datasektionen.se | ||
icon: https://static.datasektionen.se/favicon-96x96.png | ||
|
||
- name: METAcraft | ||
description: Datas och Medias Minecraftserver | ||
url: https://metacraft.nu | ||
icon: https://metacraft.nu/logo-square.png |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lmao
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
omg