Skip to content

feat(site): restructure website with alvu #15

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

Merged
merged 8 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions www/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
root = true

[*]
indent_style = tab
1 change: 1 addition & 0 deletions www/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GOBLIN_ORIGIN_URL=
10 changes: 3 additions & 7 deletions www/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
/bin/
/node_modules/
dist
1 change: 0 additions & 1 deletion www/.npmrc

This file was deleted.

42 changes: 42 additions & 0 deletions www/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.PHONY: build install clean watchStyles watchPages watch

build:
./bin/alvu
./bin/tailwindcss -i ./assets/main.css -o ./dist/style.css --minify

install:
mkdir -p ./bin
# Downloading alvu
# https://github.com/barelyhuman/alvu
curl -sf https://goblin.run/github.com/barelyhuman/alvu | PREFIX=./bin sh
chmod +x ./bin/alvu
# Downloading Tailwind CSS CLI for macOS arm64
# https://github.com/tailwindlabs/tailwindcss/releases/latest
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-macos-arm64
chmod +x ./tailwindcss-macos-arm64
mv tailwindcss-macos-arm64 ./bin/tailwindcss

installLinux:
mkdir -p ./bin
# Downloading alvu
# https://github.com/barelyhuman/alvu
curl -sf https://goblin.run/github.com/barelyhuman/alvu | PREFIX=./bin sh
chmod +x ./bin/alvu
# Downloading Tailwind CSS CLI for linux amd64
# https://github.com/tailwindlabs/tailwindcss/releases/latest
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64
chmod +x ./tailwindcss-linux-x64
mv tailwindcss-linux-x64 ./bin/tailwindcss


clean:
rm ./bin/alvu ./bin/tailwindcss

watchStyles:
./bin/tailwindcss -i ./assets/main.css -o ./dist/style.css --watch

watchPages:
alvu -serve

watch:
${MAKE} -j4 watchPages watchStyles
146 changes: 146 additions & 0 deletions www/assets/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
color-scheme: light dark;

--page-top: 2rem;
--page-gutter: 1.5rem;
--header-height: 80px;
--content-height: calc(100vh - var(--header-height));
--content-width: 44rem;

--color-base: 250 250 250;
--color-surface: 244 244 245;
--color-overlay: 228 228 231;
--color-subtle: 113 113 122;
--color-text: 24 24 24;
--color-primary: 253 126 20;
--color-secondary: 250 176 5;
}

@media screen(sm) {
:root {
--page-top: 5rem;
--page-gutter: 2rem;
}
}

@media (prefers-color-scheme: dark) {
:root {
--color-base: 24 24 27;
--color-surface: 39 39 42;
--color-overlay: 63 63 58;
--color-subtle: 161 161 170;
--color-text: 228 228 231;
}
}

html {
@apply motion-safe:scroll-smooth;
}

body {
@apply bg-base text-text antialiased;
}

[id] {
@apply scroll-mt-3;
}

pre {
@apply overflow-x-auto rounded-md border bg-surface p-3;
}

code {
@apply rounded bg-surface px-1 py-0.5 text-sm;
}

pre > code {
@apply p-0;
}

pre > code.language-command::before {
@apply text-subtle content-['$_'];
}

article > *:not(:first-child):not(pre) {
@apply mt-8;
}
article > pre {
@apply mt-5;
}
article h2,
article h2 > * {
@apply border-b pb-3 text-xl font-bold;
}
article h3,
article h3 > * {
@apply text-lg font-semibold;
}
article h2:not(:first-child),
article h3,
article h4,
article h5 {
@apply mt-14;
}
.link,
article a {
@apply inline text-primary underline-offset-2;
}
.link::after,
article a::after {
@apply inline-block whitespace-pre;
}
.link[href^="http"]::after,
article a[href^="http"]::after {
@apply content-['_↗'];
}
.link:hover,
article a:hover {
@apply underline;
}
article blockquote {
@apply border-l-[3px] pl-3 text-sm font-medium text-subtle;
}
article strong {
@apply font-semibold;
}
article ul > li,
article ol > li {
@apply pb-1;
}

.animate.fade-in-y,
.animate-kids.fade-in-y > * {
opacity: 0;
animation: fade-in-y var(--duration, 800ms) var(--direction, forwards);
animation-delay: calc(var(--delay, 0) * 100ms);
}

@keyframes fade-in-y {
from {
opacity: 0;
transform: translateY(var(--from, 20px));
}

to {
opacity: 1;
transform: none;
}
}

@media (prefers-reduced-motion: reduce) {
*,
::before,
::after {
animation-delay: -1ms !important;
animation-duration: 1ms !important;
animation-iteration-count: 1 !important;
background-attachment: initial !important;
scroll-behavior: auto !important;
transition-duration: 0s !important;
transition-delay: 0s !important;
}
}
14 changes: 14 additions & 0 deletions www/hooks/define-env.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
local json = require("json")
local alvu = require("alvu")

function Writer(filedata)
local envData = {}

envData["GOBLIN_ORIGIN_URL"] = alvu.get_env(".env","GOBLIN_ORIGIN_URL")

return json.encode({
data = {
env = envData
},
})
end
37 changes: 0 additions & 37 deletions www/package.json

This file was deleted.

Loading