From 66a8a48f1b0f7c53826248db1c8ef0b99a4a51bc Mon Sep 17 00:00:00 2001 From: "Mr. W" Date: Wed, 9 Sep 2026 12:54:12 -0500 Subject: [PATCH] Your starter files --- .forgejo/workflows/deploy.yml | 60 +++++++++++++++++++++++++++++++++++ .vscode/settings.json | 9 ++++++ README.md | 8 +++++ index.html | 35 ++++++++++++++++++++ style.css | 42 ++++++++++++++++++++++++ 5 files changed, 154 insertions(+) create mode 100644 .forgejo/workflows/deploy.yml create mode 100644 .vscode/settings.json create mode 100644 README.md create mode 100644 index.html create mode 100644 style.css diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml new file mode 100644 index 0000000..7365e68 --- /dev/null +++ b/.forgejo/workflows/deploy.yml @@ -0,0 +1,60 @@ +# Publishes this site when you push to main. +# +# You do not need to change anything in here. It runs on the class server, +# copies your files to the web, and your page is live in about a minute. +name: Deploy my site + +on: + push: + branches: [main] + # Lets you re-run a deploy from the web UI without making a commit — + # useful when a deploy failed for a reason that wasn't your code. + workflow_dispatch: + +jobs: + deploy: + runs-on: docker + steps: + - name: Get my files + uses: actions/checkout@v4 + + - name: Install the AWS tool + run: | + apt-get update -qq + apt-get install -y -qq awscli + + - name: Check there is a home page + run: | + if [ ! -f index.html ]; then + echo "::error::No index.html in the top folder — the site would 404." + echo "Your home page must be called exactly index.html (all lowercase)." + exit 1 + fi + + - name: Copy my site to the web + env: + # These come from this repo's own secrets and are yours alone. They + # can only write to your folder — if you point them somewhere else + # the copy is refused, by design. + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: us-east-1 + STUDENT: ${{ github.repository_owner }} + run: | + if [ -z "$AWS_ACCESS_KEY_ID" ]; then + echo "::error::This repo has no deploy key. Ask Mr. W to run provision-deploy-keys.sh." + exit 1 + fi + aws s3 sync . "s3://classproject-dev-student-sites/${STUDENT}/" \ + --delete \ + --exclude ".git/*" \ + --exclude ".forgejo/*" \ + --exclude ".vscode/*" \ + --exclude "README.md" \ + --cache-control "public, max-age=60" \ + --no-progress + + - name: Show my address + run: | + echo "Live at https://${{ github.repository_owner }}.classproject.dev" + echo "(give it up to a minute)" diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..45e263d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,9 @@ +{ + "editor.linkedEditing": true, + "css.lint.boxModel": "warning", + "css.lint.duplicateProperties": "warning", + "css.lint.important": "warning", + "css.lint.propertyIgnoredDueToDisplay": "warning", + "files.trimTrailingWhitespace": true, + "files.insertFinalNewline": true +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..91b2b49 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# site-class + +Instructor-owned. Holds every session's starter, completion problems at three +fill levels, and crib sheets for the site class. + +Students read this; they never push to it. A session's starter reaches a +student by being fanned out into their own `site` repo before class, so the +only command they run is `git pull`. diff --git a/index.html b/index.html new file mode 100644 index 0000000..81e2aa6 --- /dev/null +++ b/index.html @@ -0,0 +1,35 @@ + + + + + + Change this to your page title + + + + +
+ +

This page is a starting point

+
+ +
+ +

+ Everything on this page is text in a file. Change the text, save the + file, and it changes. That is the whole trick. +

+ + + + +
+ + + + + diff --git a/style.css b/style.css new file mode 100644 index 0000000..6d5c23a --- /dev/null +++ b/style.css @@ -0,0 +1,42 @@ +/* --------------------------------------------------------------------------- + This top block is set up for you. Leave it alone and everything below it + will behave sensibly. + + box-sizing: border-box makes padding and borders count INSIDE an element's + width instead of getting added on top. The default does the opposite, which + means the arithmetic never works out and you spend an hour wondering why + your boxes are too wide. +--------------------------------------------------------------------------- */ +html { box-sizing: border-box; } +*, *::before, *::after { box-sizing: inherit; } + +img { max-width: 100%; height: auto; } + + +/* --------------------------------------------------------------------------- + Your styles start here. Change anything. + + One habit worth keeping: use max-width, not width. A page is responsive by + default — a fixed width is what breaks it on a phone. +--------------------------------------------------------------------------- */ + +body { + font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; + line-height: 1.6; + max-width: 40rem; /* not width */ + margin: 0 auto; + padding: 2rem 1.25rem; + color: #1a1a1a; + background: #fdfdfb; +} + +h1 { + font-size: 2rem; + line-height: 1.2; +} + +a { + color: #2b5eaa; +} + +/* Try changing a colour and pushing. Watch your live page change. */