diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..887fe22 --- /dev/null +++ b/build.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e # Fail fast. + +rm -rf _site + +# Creates all dirs needed. +for dir in $(find site -type d); do + mkdir -p "_$dir" +done + +for file in $(find site -type f); do + if [[ ! "${file##*/}" =~ ^_ ]]; then + if [[ "$file" =~ .nix$ ]]; then + echo "Processing file $file to _${file%.nix}.html..." + TARGET_FILE=$(realpath "$file") nix eval "${HTMNIX_REF:-github:RGBCube/HTMNIX}#result" --impure --raw --apply toString > "_${file%.nix}.html" + else + echo "Copying file $file to _$file..." + cp "$file" "_$file" + fi + fi +done diff --git a/site/_base.nix b/site/_base.nix new file mode 100644 index 0000000..c9e999e --- /dev/null +++ b/site/_base.nix @@ -0,0 +1,29 @@ +{ title }: body: +withDoctype ( +{lang="en";} + + {charset="UTF-8";} + {name="viewport"; content="width=device-width, initial-scale=1.0";} + + title<.title> + <.head> + <body> + <style>(raw '' + /* overpass-latin-wght-normal */ + @font-face { + font-family: "Overpass"; + font-style: normal; + font-display: auto; + font-weight: 100 900; + src: url(https://cdn.jsdelivr.net/fontsource/fonts/overpass:vf@latest/latin-wght-normal.woff2) format('woff2-variations'); + unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; + } + + html { + font-family: "Overpass"; + } + '')<.style> + + body + <.body> +<.html>) diff --git a/site/cube.png b/site/cube.png new file mode 100644 index 0000000..673a0aa Binary files /dev/null and b/site/cube.png differ diff --git a/site/index.nix b/site/index.nix new file mode 100644 index 0000000..d6e72ce --- /dev/null +++ b/site/index.nix @@ -0,0 +1,8 @@ +(call ./_base.nix) { + title = "Hello, Nix!"; +} ( +<h1>"Hello, Nix!"<.h1> + +<p>"This site was made using Nix!"<.p> +<p>"Yes, you read that right! 100% Nix!"<.p> +)