Skip to content

Commit

Permalink
WWW rearch
Browse files Browse the repository at this point in the history
- Using metalsmith instead of jekyll, i strongly dislike jekyll
- splitting things out into multiple pages
- rewriting docs to reflect new architecture. not complete fully, but
  mostly there, and way more info than what was in the original project
  page, and much better organized, so i feel fine deploying as is
- adding download links to releases! wooo
  • Loading branch information
orthecreedence committed Feb 16, 2024
1 parent e46babb commit 61e5e95
Show file tree
Hide file tree
Showing 25 changed files with 1,221 additions and 732 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/www.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy site to Pages

on:
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: node
uses: actions/setup-node@v4
with:
node-verseion: 18.x
cache: 'pnpm'
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Setup deps
run: pnpm i
- name: Build
run: make
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3
with:
path: dist/

# Deployment job
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@
# non-versioned include
-include vars.mk

SRC := www
SRC := src
BUILD := dist
MKDIR = mkdir -p ${dir $@}

allwww := $(shell find $(SRC) -type f)
allsrc := main.js $(shell find plugins/)

all: $(BUILD)/assets/zefram.stamp $(BUILD)/index.html

$(BUILD)/assets/zefram.stamp: $(SRC)/assets/zefram.stamp
@$(MKDIR)
cp $^ $@
all: $(BUILD)/index.html $(BUILD)/assets/zefram.stamp

$(BUILD)/index.html: $(allsrc) $(allwww) tailwind.config.js postcss.config.js
@echo "url is $(URL)"
SRC=$(SRC) DEST=$(BUILD) URL=$(URL) node main
npx postcss $(BUILD)/css/**/*.css --base $(BUILD)/ --dir $(BUILD)/

# this is *required* as a build step because the public stamp file is parsed by frontmatter by metalsmith...
$(BUILD)/assets/zefram.stamp: $(SRC)/assets/zefram.stamp $(BUILD)/index.html
@$(MKDIR)
cp $< $@

clean:
rm -rf $(BUILD)

watch: all
while true; do inotifywait -qr -e close_write *.js www/ plugins/; make; done
while true; do inotifywait -qr -e close_write *.js $(SRC)/ plugins/; make; done

publish: override URL := ''
publish:
Expand Down
7 changes: 4 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ const sass = require('./plugins/sass');
const page_ref = require('./plugins/page_ref');
const toc = require('./plugins/toc');

const SRC = process.env['SRC'] || 'www';
const SRC = process.env['SRC'] || 'src';
const DEST = process.env['DEST'] || 'dist';
const URL = process.env['URL'] || 'https://stamp-protocol.github.io';
const DRAFTS = process.env['DRAFTS'] === '1';

const NUNJUCK_OPTS = {
autoescape: false,
root: `${__dirname}/www`,
root: `${__dirname}/${SRC}`,
};

Metalsmith(__dirname)
Expand All @@ -34,13 +34,14 @@ Metalsmith(__dirname)
})
.source(`${SRC}/`)
.destination(`${DEST}/`)
.ignore('**/zefram.stamp')
.clean(true)
// we never process these directly, so no point in having them LOL
.use(remove([
'layouts/**/*',
'includes/**/*',
'css/includes/**/*',
// metalsmith parses this as one giant front matter file, so we ignore and solve in the Makefile...
'assets/zefram.stamp',
]))
// deal with drafts
.use((files, metalsmith, done) => {
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
23 changes: 15 additions & 8 deletions www/css/main.scss → src/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@tailwind utilities;

@layer components {
.st-container {@apply block max-w-4xl mx-auto px-4;}
.st-container {@apply block max-w-5xl mx-auto px-4;}
.container-wide {@apply max-w-5xl;}
.button-plain {@apply inline-block text-center py-4 px-8;}
.button {@apply button-plain bg-primary text-white sm:bg-primary/[0.80] sm:hover:bg-primary sm:transition-colors;}
Expand All @@ -18,7 +18,7 @@ header, .main-content {
.logo {
svg {@apply w-full;}
#g21753, #text21224-5 {
path {@apply fill-highlight;}
path {@apply fill-primary;}
}
#text111 {
path {@apply fill-slate-700;}
Expand All @@ -33,9 +33,9 @@ post, page {
&, .date {}
}
h1 {@apply text-5xl mb-8;}
h2 {@apply text-4xl mb-7;}
h3 {@apply text-2xl mb-6;}
h4 {@apply text-xl mb-5;}
h2 {@apply text-4xl mb-5;}
h3 {@apply text-2xl mb-4;}
h4 {@apply text-xl mb-3;}
p, ul, ol {
& {@apply mb-4;}
& + h1 {@apply mt-12;}
Expand All @@ -52,13 +52,20 @@ post, page {
ol {@apply list-decimal ml-8;}
code {@apply p-1 whitespace-nowrap text-red-900 bg-slate-100 text-base p-1;}
pre {
& {@apply mb-4 border p-2 whitespace-pre bg-slate-100 overflow-auto max-h-80;}
& {@apply mb-4 border p-2 whitespace-pre bg-slate-100 overflow-auto max-h-96;}
code {@apply p-0 whitespace-pre text-red-900 bg-inherit;}
}
hr {@apply mb-4;}
em {@apply text-yellow-700;}
em {@apply text-green-900;}

table {
blockquote {@apply rounded p-4 mb-4 bg-indigo-100;}

details {@apply bg-slate-100 px-4 mb-4;}
details {
summary {@apply text-primary cursor-pointer py-4;}
}

table:not(.transaction) {
& {@apply mb-4;}
thead th {@apply text-left;}
tbody td {vertical-align: top;}
Expand Down
Loading

0 comments on commit 61e5e95

Please sign in to comment.