1
Fork 0
mirror of https://github.com/RGBCube/NixSite synced 2025-07-27 07:37:46 +00:00

Initial commit

This commit is contained in:
RGBCube 2024-02-28 13:59:54 +03:00
parent c69b2eda1e
commit b5ee8e239d
No known key found for this signature in database
4 changed files with 59 additions and 0 deletions

22
build.sh Executable file
View file

@ -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

29
site/_base.nix Normal file
View file

@ -0,0 +1,29 @@
{ title }: body:
withDoctype (
<html>{lang="en";}
<head>
<meta.>{charset="UTF-8";}
<meta.>{name="viewport"; content="width=device-width, initial-scale=1.0";}
<title>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>)

BIN
site/cube.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

8
site/index.nix Normal file
View file

@ -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>
)