From 1713c9e01e00b6f4b5814d68e47642a012eb7ae4 Mon Sep 17 00:00:00 2001 From: Ananth Venkatesh Date: Sun, 16 Feb 2025 02:14:38 -0500 Subject: [PATCH 1/9] docs(readme): add build instructions --- .pre-commit-config.yaml | 2 +- README.md | 15 +++++++++++++++ flake.nix | 1 - 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8194def..8b50766 120000 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1 +1 @@ -/nix/store/i4wcn83p1273vgv0nggpdbjqppq33aj7-pre-commit-config.json \ No newline at end of file +/nix/store/4wj49hvsmkannf285i53qczyjggvly5w-pre-commit-config.json \ No newline at end of file diff --git a/README.md b/README.md index 7f349ce..8cf032a 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,19 @@ The all-new (very experimental) MacGregor House website +## Building + +To build, run + +`nix build .` + +For live preview, run + +`bash watch.sh` and +`nix run nixpkgs#live-server` + +then navigate to the `src` directory. + +## Models + ![A 3D model of MacGregor House](./assets/img/macg.png) diff --git a/flake.nix b/flake.nix index 67eeeb4..2200896 100644 --- a/flake.nix +++ b/flake.nix @@ -70,7 +70,6 @@ nil.enable = true; statix.enable = true; markdownlint.enable = true; - mdsh.enable = true; typos.enable = true; check-merge-conflicts.enable = true; commitizen.enable = true; From 21b946568d1acdfdc9e2b8556cf12de4793b7d87 Mon Sep 17 00:00:00 2001 From: Ananth Venkatesh Date: Sun, 16 Feb 2025 02:14:56 -0500 Subject: [PATCH 2/9] build(lock): update --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 6ad6258..74d8689 100644 --- a/flake.lock +++ b/flake.lock @@ -88,11 +88,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1739064336, - "narHash": "sha256-LTZznyurm9WWchG3uPH+8Sf5hkzZyHoa9FvDW0cLk0M=", + "lastModified": 1739669300, + "narHash": "sha256-+FBpxx535UFK2vDW6yJkGA/7pgwVW7wsG7dnUejmGGA=", "owner": "jeslie0", "repo": "mkElmDerivation", - "rev": "2d5f1acc6da7e6d5deeff5c9f47729a671ab8f9a", + "rev": "009e5994ec2978c2876229cefadc20d2765f2e50", "type": "github" }, "original": { From 713d6d4486d9982098f3a3dd7f05752502779d12 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 16 Feb 2025 12:43:27 -0800 Subject: [PATCH 3/9] feat: install entire site using nix --- flake.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 2200896..ca78c72 100644 --- a/flake.nix +++ b/flake.nix @@ -48,8 +48,10 @@ elm make src/Main.elm --output Main.js --optimize ''; installPhase = '' - mkdir $out - cp Main.js $out + mkdir -p $out/dist/elm + cp Main.js $out/dist/elm + sed 's/..compiled\/Main.js/\/elm\/Main.js/' src/index.html > $out/dist/index.html + cp -r assets $out/dist/assets ''; }; }; From 508c457ffb3bd5fdfd28dd8fd23ebc6e369694f7 Mon Sep 17 00:00:00 2001 From: Ananth Venkatesh Date: Fri, 28 Feb 2025 01:56:03 -0500 Subject: [PATCH 4/9] feat: add entry descriptions --- src/Main.elm | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Main.elm b/src/Main.elm index e83b61c..98b4618 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -395,7 +395,7 @@ bodyText = [ Font.color white , Font.family [ Font.typeface "Inter" ] , Font.size 20 - , width (px 600) + , width (px 500) ] @@ -940,7 +940,7 @@ pageEntries model = [ entryLink "A entry" "A" , text ", " , entryLink "Bentry" "B" - , text " (Office of the President), " + , text ", " , entryLink "Centry" "C" , text " (the C is silent), " , entryLink "Dentry" "D" @@ -998,7 +998,7 @@ pageEntries model = , image [ width (px 80), padding 12 ] { description = "flag of j entry", src = "../assets/img/jentry.png" } ] , paragraph (bodyText ++ [ Font.size 32 ]) - [ text "(J Entry) The heart of MacGregor. Historic culture, big lore. Jentry memes. Greatest MacGregor Housecomm representation of any entry. Jamily is forever." + [ text "(J Entry) The heart of MacGregor. Historic culture, big lore. Jentry memes. J is for Jamily. We're an eclectic community, filled with everyone from introverts to extroverts, crazy vibes, chill vibes, and everything in between." ] ] , el @@ -1031,7 +1031,7 @@ pageEntries model = subheading [ text "Welcome to A Entry." ] , paragraph (bodyText ++ [ Font.size 32 ]) - [ text "Top floor. Top dog. Lots of dogs, in fact. Historic MacGregor cultural epicenter." + [ text "Top floor. Top dog. Alpha wolf. Unity and strength. Positive, above average." ] ] , el @@ -1064,7 +1064,7 @@ pageEntries model = subheading [ text "Welcome to Bentry." ] , paragraph (bodyText ++ [ Font.size 32 ]) - [ text "(B Entry) Office of the President. Sweeping views. Crossroads of the High Rise. B is for burgers?" + [ text "(B Entry) Bentry is loud and fun and very social. We like to hang out with each other and check in, catch up, and go out. We banter a lot too but we are always there for each other. We’re a family for sure." ] ] , el @@ -1097,7 +1097,7 @@ pageEntries model = subheading [ text "Welcome to Centry." ] , paragraph (bodyText ++ [ Font.size 32 ]) - [ text "(C Entry) Ceriously quiet. High enough to see the clouds, but low enough to stay grounded. MacGregor's creative capital core." + [ text "(C Entry) Chill. Calmer. Sloths." ] ] , el @@ -1120,7 +1120,7 @@ pageEntries model = ) ] , column - (page model ++ [ id "D", Background.color (rgb255 240 140 40) ]) + (page model ++ [ id "D", Background.color (rgb255 40 140 240) ]) [ column (pageText model) [ row [ spacing 10 ] [ btn "↑" (ScrollToEntry "C") @@ -1130,7 +1130,7 @@ pageEntries model = subheading [ text "Welcome to Dentry." ] , paragraph (bodyText ++ [ Font.size 32 ]) - [ text "(D Entry) Office of the Vice President. Active after dark. Diligently working until dusk. The culture is palpable." + [ text "(D Entry) D is for doing. Whether we stay in or go out (mostly go out), we have fun! D is also for degenerate. We are up the latest of all entries." ] ] , el @@ -1153,7 +1153,7 @@ pageEntries model = ) ] , column - (page model ++ [ id "E", Background.color (rgb255 40 20 30) ]) + (page model ++ [ id "E", Background.color (rgb255 221 162 126) ]) [ column (pageText model) [ row [ spacing 10 ] [ btn "↑" (ScrollToEntry "D") @@ -1163,7 +1163,7 @@ pageEntries model = subheading [ text "Welcome to E entry." ] , paragraph (bodyText ++ [ Font.size 32 ]) - [ text "Board games over Briggs field. Excellence in everything. End of story." + [ text "We're a really cozy and friendly entry! We love having baking/cooking nights, watching movies, playing games, and just hanging out to chat. We also go out for dinners occasionally!" ] ] , el @@ -1186,7 +1186,7 @@ pageEntries model = ) ] , column - (page model ++ [ id "F", Background.color (rgb255 200 50 75) ]) + (page model ++ [ id "F", Background.color (rgb255 200 125 150) ]) [ column (pageText model) [ row [ spacing 10 ] [ btn "↑" (ScrollToEntry "E") @@ -1196,7 +1196,7 @@ pageEntries model = subheading [ text "Welcome to the Fentry." ] , paragraph (bodyText ++ [ Font.size 32 ]) - [ text "(F entry) F is for Food. F is for Feast. F is for First (low rise block). F is Forever." + [ text "(F entry) Typical nights for us look like playing poker, watching a movie, or just chilling and doing homework." ] ] , el @@ -1219,7 +1219,7 @@ pageEntries model = ) ] , column - (page model ++ [ id "G", Background.color (rgb255 200 50 150) ]) + (page model ++ [ id "G", Background.color (rgb255 250 150 50) ]) [ column (pageText model) [ row [ spacing 10 ] [ btn "↑" (ScrollToEntry "F") @@ -1229,7 +1229,7 @@ pageEntries model = subheading [ text "Welcome to the Gentry." ] , paragraph (bodyText ++ [ Font.size 32 ]) - [ text "(G entry) G is for Greatness. Spans the Charles. Overlooks Fenway. Good things start in Gentry." + [ text "(G entry) Chill but welcoming. The G in Gentry stands for Goofy, Gamers, and Good Times." ] ] , el @@ -1252,7 +1252,7 @@ pageEntries model = ) ] , column - (page model ++ [ id "H", Background.color (rgb255 200 150 50) ]) + (page model ++ [ id "H", Background.color (rgb255 50 175 50) ]) [ column (pageText model) [ row [ spacing 10 ] [ btn "↑" (ScrollToEntry "G") @@ -1262,7 +1262,7 @@ pageEntries model = subheading [ text "Welcome to the Hentry." ] , paragraph (bodyText ++ [ Font.size 32 ]) - [ text "(H entry) Lots of chickens. Crossroads of the Low Rise. Largest entry in MacGregor." + [ text "(H entry) Where the walls are hexagonal (not really), the vibes are chaotic-good, and the only thing more structured than our beehive of activity is our legendary group chats." ] ] , el From 4f06d54e420b04960bc30e32ced7a8d8c104f737 Mon Sep 17 00:00:00 2001 From: Ananth Venkatesh Date: Fri, 28 Feb 2025 01:59:51 -0500 Subject: [PATCH 5/9] build(lock): update --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 74d8689..f23cbf4 100644 --- a/flake.lock +++ b/flake.lock @@ -88,11 +88,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1739669300, - "narHash": "sha256-+FBpxx535UFK2vDW6yJkGA/7pgwVW7wsG7dnUejmGGA=", + "lastModified": 1740274080, + "narHash": "sha256-tDNZc/PVt9z2m7i5PKuYJ9Ii60A2oNrtl6qTeqqmoJc=", "owner": "jeslie0", "repo": "mkElmDerivation", - "rev": "009e5994ec2978c2876229cefadc20d2765f2e50", + "rev": "93c08ae888748f71873539bebcae981cf72f3f44", "type": "github" }, "original": { @@ -119,11 +119,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1739446958, - "narHash": "sha256-+/bYK3DbPxMIvSL4zArkMX0LQvS7rzBKXnDXLfKyRVc=", + "lastModified": 1740560979, + "narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2ff53fe64443980e139eaa286017f53f88336dd0", + "rev": "5135c59491985879812717f4c9fea69604e7f26f", "type": "github" }, "original": { From f1e0aa5ec09f619b4f26b18ddfc88e6d06d371e5 Mon Sep 17 00:00:00 2001 From: Ananth Venkatesh Date: Fri, 28 Feb 2025 02:10:18 -0500 Subject: [PATCH 6/9] chore(git): ignore root index.html for deployment --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 76ce412..8d91dc0 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ result-* # ---> Project # Ignore compiled elm files compiled +# Ignore hosting-specific files +/index.html From 86adaa86a2de144894af16ac962c4847d3ef53b5 Mon Sep 17 00:00:00 2001 From: Ananth Venkatesh Date: Sat, 1 Mar 2025 02:38:24 -0500 Subject: [PATCH 7/9] fix: resolve all hosting and url addresses --- flake.lock | 6 +++--- src/Main.elm | 47 +++++++++++++++++++++++++++-------------------- src/index.html | 6 +++++- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index f23cbf4..bba39c3 100644 --- a/flake.lock +++ b/flake.lock @@ -119,11 +119,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1740560979, - "narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=", + "lastModified": 1740695751, + "narHash": "sha256-D+R+kFxy1KsheiIzkkx/6L63wEHBYX21OIwlFV8JvDs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5135c59491985879812717f4c9fea69604e7f26f", + "rev": "6313551cd05425cd5b3e63fe47dbc324eabb15e4", "type": "github" }, "original": { diff --git a/src/Main.elm b/src/Main.elm index 98b4618..9fd5861 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -82,6 +82,7 @@ type alias Model = , h : Int , last : String , url : Url.Url + , path : String , key : Nav.Key , mesh : Maybe Object3d , textures : Maybe (Material.Textured Obj.Decode.ObjCoordinates) @@ -95,19 +96,20 @@ type alias Model = type alias Flags = - ( Int, Int ) + ( Int, Int, String ) init : Flags -> Url.Url -> Nav.Key -> ( Model, Cmd Msg ) init flags url key = let - ( width, height ) = + ( width, height, path ) = flags in ( { w = width , h = height , last = "" , url = url + , path = path , key = key , mesh = Nothing , textures = Nothing @@ -459,12 +461,12 @@ id = Html.Attributes.id >> Element.htmlAttribute -getPaths : String -> List String -getPaths base = +getPaths : String -> String -> List String +getPaths path base = let root : String root = - "/" ++ base + path ++ base in List.map ((++) root) [ "", "/", "/index.html" ] @@ -484,13 +486,18 @@ itemize multikeys entry = [] -sitemap : Dict String (Model -> List (Html Msg)) -sitemap = +sitemap : Model -> Dict String (Model -> List (Html Msg)) +sitemap model = + let + getter : String -> List String + getter = + getPaths model.path + in Dict.fromList - (itemize ([ "/", "/index.html" ] ++ getPaths "src" ++ getPaths "index" ++ getPaths "home") pageHome - ++ itemize (getPaths "entries") pageEntries - ++ itemize (getPaths "about") pageAbout - ++ itemize (getPaths "colophon") colophon + (itemize ([ "/", "/index.html", model.path ] ++ getter "src" ++ getter "index" ++ getter "home") pageHome + ++ itemize (getter "entries") pageEntries + ++ itemize (getter "about") pageAbout + ++ itemize (getter "colophon") colophon ) @@ -499,7 +506,7 @@ loadUrl model = let req : Maybe (Model -> List (Html Msg)) req = - Dict.get model.url.path sitemap + Dict.get model.url.path (sitemap model) in case req of Just builder -> @@ -533,9 +540,9 @@ menu model = , Font.size 18 ] (row [ spacing 20 ] - [ inlineLinkInt "Entries" "/entries" - , inlineLinkInt "Access" "/about" - , inlineLinkInt "Colophon" "/colophon" + [ inlineLinkInt "Entries" (model.path ++ "entries") + , inlineLinkInt "Access" (model.path ++ "about") + , inlineLinkInt "Colophon" (model.path ++ "colophon") ] ) @@ -782,7 +789,7 @@ pageAbout model = , column [ spacing 15 ] [ row [ spacing 15 ] - [ linkBtnInt "← Back" "/" + [ linkBtnInt "← Back" model.path , btn "Directions" (Scroll "one") ] , row [ spacing 15 ] @@ -809,7 +816,7 @@ pageAbout model = , column (page model ++ [ id "one" ]) [ image (fullImage model) - { src = "../assets/img/map.png" + { src = model.path ++ "../assets/img/map.png" , description = "mit campus map with pin at macgregor house" } , column (pageText model) @@ -960,7 +967,7 @@ pageEntries model = [ row [ spacing 15 ] - [ linkBtnInt "← Back" "/" + [ linkBtnInt "← Back" model.path , btn "Explore ↓" (ScrollToEntry "J") ] ] @@ -1341,7 +1348,7 @@ notFound model = [ text "You were likely redirected here by a link to a page on the old website, the last known archive of which can be found " , inlineLink "here" "https://web.archive.org/web/20170529064230/http://macgregor.mit.edu/" , text ". Unless you want to conduct research on ancient MIT traditions, you can probably find what you're looking for on the new " - , inlineLinkInt "main page" "/src" + , inlineLinkInt "main page" (model.path ++ "/src") , text ". If you believe this page really is missing, " , inlineLink "contact the webmaster" "mailto:ananthv@mit.edu" , text "." @@ -1415,7 +1422,7 @@ colophon model = ] [ text "Colophon." , row [ spacing 15 ] - [ linkBtnInt "← Back" "/" + [ linkBtnInt "← Back" model.path , linkBtn "Source" "https://forgejo.mit.edu/ananthv/macgregor" , btn "Literature" (Scroll "one") ] diff --git a/src/index.html b/src/index.html index 453b42a..4d636ac 100644 --- a/src/index.html +++ b/src/index.html @@ -16,7 +16,11 @@