commit fa2f964efa8a2ecb9a277c3573e84659e1ce0de7 Author: Julien Malka Date: Tue Oct 8 01:04:47 2024 +0200 init diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..1d953f4 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..abf6e54 --- /dev/null +++ b/default.nix @@ -0,0 +1,63 @@ +let + inputs = import ./lon.nix; + pkgs = import inputs.nixpkgs { }; + description = "La Délégation Générale Numérique est une association loi 1901 domiciliée à l'ENS dont les buts sont de promouvoir la chose numérique ainsi que son usage."; + logo = ./img/dgnum.png; + links = [ + { + text = "Page d'état des services"; + target = "https://status.dgnum.eu"; + svgFile = ./svgs/status.html; + linkClass = "status"; + } + { + text = "Notre site"; + target = "https://dgnum.eu"; + svgFile = ./svgs/site.html; + } + { + text = "Forge Git"; + target = "https://git.dgnum.eu"; + svgFile = ./svgs/git.html; + linkClass = "git"; + } + { + text = "Instagram"; + target = "https://www.instagram.com/dgnum_eu/"; + svgFile = ./svgs/insta.html; + linkClass = "instagram"; + } + { + text = "Mastodon"; + target = "https://social.dgnum.eu/@dgnum"; + svgFile = ./svgs/mastodon.html; + linkClass = "mastodon"; + } + + { + text = "Nous contacter"; + target = "mailto:contact@dgnum.eu"; + svgFile = ./svgs/contact.html; + } + ]; + indexHtml = import ./landing.nix { + inherit description links logo; + lib = pkgs.lib; + writeText = pkgs.writeText; + }; +in + +pkgs.stdenv.mkDerivation { + name = "dgnum-landing"; + version = "1.0.0"; + src = ./.; + + buildInputs = [ pkgs.tailwindcss ]; + buildPhase = '' + mkdir -p $out/img + cp ${logo} $out/img/${builtins.baseNameOf logo} + cp -r ${indexHtml} $out/index.html + cp -r ${indexHtml} index.html + tailwindcss -i style.css -o $out/main.css + ''; +} diff --git a/img/dgnum.png b/img/dgnum.png new file mode 100644 index 0000000..30bfe8b Binary files /dev/null and b/img/dgnum.png differ diff --git a/img/dgnum.svg b/img/dgnum.svg new file mode 100644 index 0000000..7cc5fa0 --- /dev/null +++ b/img/dgnum.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/landing.nix b/landing.nix new file mode 100644 index 0000000..9646a1b --- /dev/null +++ b/landing.nix @@ -0,0 +1,51 @@ +{ + lib, + writeText, + logo, + description, + links, +}: + +writeText "index.html" '' + + + + + + + + Liens DGNum + + + + +
+ +
+ + + + +'' diff --git a/lon.lock b/lon.lock new file mode 100644 index 0000000..fe1ce05 --- /dev/null +++ b/lon.lock @@ -0,0 +1,25 @@ +{ + "version": "1", + "sources": { + "lon": { + "type": "GitHub", + "fetchType": "tarball", + "owner": "nikstur", + "repo": "lon", + "branch": "main", + "revision": "a8b4406e5151af87b989564d4aa98ecd6d4d3500", + "url": "https://github.com/nikstur/lon/archive/a8b4406e5151af87b989564d4aa98ecd6d4d3500.tar.gz", + "hash": "sha256-VGvK0ahBl440NMs03WqmP7T4a1DP13yfX47YI84rlGU=" + }, + "nixpkgs": { + "type": "GitHub", + "fetchType": "tarball", + "owner": "nixos", + "repo": "nixpkgs", + "branch": "master", + "revision": "b53cf65876d5b5dd6fc8d0df3f3f3f185fee164a", + "url": "https://github.com/nixos/nixpkgs/archive/b53cf65876d5b5dd6fc8d0df3f3f3f185fee164a.tar.gz", + "hash": "sha256-IoiRey6txrqjtmzMcw2Uwwj3t6fPo2pkaoKdkfRezuc=" + } + } +} diff --git a/lon.nix b/lon.nix new file mode 100644 index 0000000..5f320ea --- /dev/null +++ b/lon.nix @@ -0,0 +1,41 @@ +# Generated by lon. Do not modify! +let + + lock = builtins.fromJSON (builtins.readFile ./lon.lock); + + # Override with a path defined in an environment variable. If no variable is + # set, the original path is used. + overrideFromEnv = + name: path: + let + replacement = builtins.getEnv "LON_OVERRIDE_${name}"; + in + if replacement == "" then + path + else + # this turns the string into an actual Nix path (for both absolute and + # relative paths) + if builtins.substring 0 1 replacement == "/" then + /. + replacement + else + /. + builtins.getEnv "PWD" + "/${replacement}"; + + fetchSource = + args@{ fetchType, ... }: + if fetchType == "git" then + builtins.fetchGit { + url = args.url; + ref = args.branch; + rev = args.revision; + narHash = args.hash; + } + else if fetchType == "tarball" then + builtins.fetchTarball { + url = args.url; + sha256 = args.hash; + } + else + builtins.throw "Unsupported source type ${fetchType}"; + +in +builtins.mapAttrs (name: args: overrideFromEnv name (fetchSource args)) lock.sources diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..ce09ab9 --- /dev/null +++ b/shell.nix @@ -0,0 +1,11 @@ +let + inputs = import ./lon.nix; + pkgs = import inputs.nixpkgs { }; + lon = pkgs.callPackage "${inputs.lon}/nix/packages/lon.nix" { }; +in +pkgs.mkShell { + nativeBuildInputs = [ + lon + pkgs.tailwindcss + ]; +} diff --git a/style.css b/style.css new file mode 100644 index 0000000..f4ae2fa --- /dev/null +++ b/style.css @@ -0,0 +1,38 @@ +@tailwind base; +@tailwind components; + +.icon svg { + height: 1em; + width: 1em; +} + +.link { + @apply bg-primary-700 text-white hover:brightness-90; +} + +.link-dev { + background-color: #0a0a0a; +} +.link-git { + background-color: #333; +} +.link-gitlab { + background-color: #554488; +} +.link-instagram { + background-color: #c13584; + background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d); +} +.link-mastodon { + background-color: #6364ff; +} + +.link-status { + background-color: #33754b; +} + +.prose .chroma { + @apply rounded-md bg-neutral-50 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-200; +} + +@tailwind utilities; diff --git a/svgs/contact.html b/svgs/contact.html new file mode 100644 index 0000000..46d84a6 --- /dev/null +++ b/svgs/contact.html @@ -0,0 +1,3 @@ + diff --git a/svgs/git.html b/svgs/git.html new file mode 100644 index 0000000..bf7dde1 --- /dev/null +++ b/svgs/git.html @@ -0,0 +1,6 @@ + diff --git a/svgs/insta.html b/svgs/insta.html new file mode 100644 index 0000000..6545145 --- /dev/null +++ b/svgs/insta.html @@ -0,0 +1,4 @@ + + diff --git a/svgs/mastodon.html b/svgs/mastodon.html new file mode 100644 index 0000000..fbf9b1f --- /dev/null +++ b/svgs/mastodon.html @@ -0,0 +1,4 @@ + + diff --git a/svgs/site.html b/svgs/site.html new file mode 100644 index 0000000..f1ae5ec --- /dev/null +++ b/svgs/site.html @@ -0,0 +1,4 @@ + + diff --git a/svgs/status.html b/svgs/status.html new file mode 100644 index 0000000..105dfc6 --- /dev/null +++ b/svgs/status.html @@ -0,0 +1,4 @@ + + diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 0000000..dd57b83 --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,97 @@ +const colors = require("tailwindcss/colors"); + +module.exports = { + content: [ + "*.html", + ], + darkMode: "media", + theme: { + colors: { + white: "#fff", + neutral: colors.gray, + primary: colors.purple, + }, + extend: { + typography: (theme) => ({ + DEFAULT: { + css: { + "--tw-prose-body": theme("colors.neutral.700"), + "--tw-prose-headings": theme("colors.neutral.800"), + "--tw-prose-lead": theme("colors.neutral.500"), + "--tw-prose-links": theme("colors.primary.700"), + "--tw-prose-bold": theme("colors.neutral.900"), + "--tw-prose-counters": theme("colors.neutral.800"), + "--tw-prose-bullets": theme("colors.neutral.500"), + "--tw-prose-hr": theme("colors.neutral.200"), + "--tw-prose-quotes": theme("colors.neutral.700"), + "--tw-prose-quote-borders": theme("colors.primary.200"), + "--tw-prose-captions": theme("colors.neutral.500"), + "--tw-prose-code": theme("colors.primary.700"), + "--tw-prose-pre-code": theme("colors.neutral.700"), + "--tw-prose-pre-bg": theme("colors.neutral.50"), + "--tw-prose-th-borders": theme("colors.neutral.500"), + "--tw-prose-td-borders": theme("colors.neutral.300"), + "--tw-prose-invert-body": theme("colors.neutral.300"), + "--tw-prose-invert-headings": theme("colors.neutral.50"), + "--tw-prose-invert-lead": theme("colors.neutral.500"), + "--tw-prose-invert-links": theme("colors.primary.400"), + "--tw-prose-invert-bold": theme("colors.neutral.DEFAULT"), + "--tw-prose-invert-counters": theme("colors.neutral.400"), + "--tw-prose-invert-bullets": theme("colors.neutral.600"), + "--tw-prose-invert-hr": theme("colors.neutral.500"), + "--tw-prose-invert-quotes": theme("colors.neutral.200"), + "--tw-prose-invert-quote-borders": theme("colors.primary.900"), + "--tw-prose-invert-captions": theme("colors.neutral.400"), + "--tw-prose-invert-code": theme("colors.primary.400"), + "--tw-prose-invert-pre-code": theme("colors.neutral.200"), + "--tw-prose-invert-pre-bg": theme("colors.neutral.700"), + "--tw-prose-invert-th-borders": theme("colors.neutral.500"), + "--tw-prose-invert-td-borders": theme("colors.neutral.700"), + a: { + textDecoration: "underline", + textDecorationColor: theme("colors.primary.300"), + fontWeight: "500", + "&:hover": { + color: theme("colors.neutral.DEFAULT"), + textDecoration: "none", + backgroundColor: theme("colors.primary.600"), + borderRadius: "0.09rem", + }, + }, + "a code": { + color: "var(--tw-prose-code)", + }, + kbd: { + backgroundColor: theme("colors.neutral.200"), + padding: "0.1rem 0.4rem", + borderRadius: "0.25rem", + fontSize: "0.9rem", + fontWeight: "600", + }, + mark: { + color: theme("colors.neutral.800"), + backgroundColor: theme("colors.primary.200"), + padding: "0.1rem 0.2rem", + borderRadius: "0.12rem", + }, + }, + }, + invert: { + css: { + a: { + textDecorationColor: theme("colors.neutral.600"), + }, + kbd: { + color: theme("colors.neutral.200"), + backgroundColor: theme("colors.neutral.700"), + }, + mark: { + backgroundColor: theme("colors.primary.400"), + }, + }, + }, + }), + }, + }, + plugins: [require("@tailwindcss/typography")], +};