-
Notifications
You must be signed in to change notification settings - Fork 8
Static site generator rewrite #17
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
Draft
kevinkace
wants to merge
90
commits into
Local-Connectivity-Lab:main
Choose a base branch
from
kevinkace:svelte-ssg
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
d5bc204
out with the old
kevinkace 384fa5f
in with the new
kevinkace d90c637
nav
kevinkace a7f8ebf
gh pages prep
kevinkace e75d825
move assets to static
kevinkace 98dce29
homepage
kevinkace d3277ef
header
kevinkace d2255ac
buh bye tailwind
kevinkace 074ceff
nav
kevinkace 3e9ff74
nav polish
kevinkace 9cac04e
nvmrc
kevinkace 28c6d63
nvmrc
kevinkace 577292e
carousel
kevinkace 6a412d3
fix nav borders
kevinkace 2b4294e
npm audit
kevinkace 846489b
get involved
kevinkace 1db1231
overview
kevinkace c10d3ef
calendar and partners
kevinkace 947886a
separate nav component
kevinkace 9cb9653
separate footer component
kevinkace 192f608
footer
kevinkace 6b0f2f2
spacing
kevinkace 9f2d400
wid button
kevinkace 5e3b512
spacing
kevinkace 6af1f92
consistent spaces
kevinkace bf5d671
cspell dictionary file
kevinkace f2c4fff
cspell dictionary file
kevinkace e958b9d
mobile nav
kevinkace 9e9c78d
consistent spaces
kevinkace 772e59d
move images around and favicon
kevinkace 84df5b6
mobile nav polish
kevinkace d25af29
mobile polish
kevinkace 7f99a47
page title and imp optimization
kevinkace 5de3051
page title component and full height content
kevinkace c8b29c4
about page
kevinkace 09d2c22
our sites page
kevinkace 746456b
donate
kevinkace dda3170
gh pages
kevinkace c200f09
updated workflow
kevinkace 3d1cf97
npm not pnpm
kevinkace 3d75489
npm not pnpm
kevinkace c7c1780
delete unused images
kevinkace bc3b0b6
remove unnecessary
kevinkace d6b410a
move prerender and trailingSlash
kevinkace 6fe11fa
fix button
kevinkace b84f450
fix link
kevinkace 0cf131e
fix path
kevinkace 7706145
cleanup
kevinkace cc483ae
cleanup
kevinkace 1654058
fix build base
kevinkace 51854c6
fix build base
kevinkace b3815a3
fix base
kevinkace 186dcd6
add base to imgs
kevinkace 62aab6d
add base to imgs
kevinkace f07c51c
chain build and deploy
kevinkace 060e829
remove vite base
kevinkace 5b8e487
test
kevinkace f146f7b
add gh-pages
kevinkace 85c862f
responsive donate
kevinkace c8c3497
responsive donate
kevinkace d18b27f
responsive styles
kevinkace d227357
comment out unused locale toggle
kevinkace 17b2b21
less magic
kevinkace 43857c1
create redirects
kevinkace 9b3bb59
Merge pull request #1 from kevinkace/ssg-redirects
kevinkace 99eaf94
fix redirects for GH pages
kevinkace 64dcad9
fix redirects for GH pages
kevinkace 3c149d4
error pages
kevinkace d264ed6
404 and 500 error pages
kevinkace 49d9015
fix redirects for GH pages
kevinkace d576c8f
Merge pull request #4 from kevinkace/fix/error-pages
kevinkace 5a33bc0
img cleanup
kevinkace 57b4d03
fix TS type error
kevinkace 642887a
CI should use npm ci not npm install
kevinkace d6af528
replace KCLS with higher res logo
kevinkace aa261a4
update deps
kevinkace 993f2d3
optimize partners img
kevinkace 017b5f4
gitignore /assets dir
kevinkace 88d2082
optimize partners img
kevinkace 65153a4
keep same deploy filename
kevinkace 81764c9
don't use pnpm, do use nvm
kevinkace b543687
comment build
kevinkace eaf68ac
warning about base path
kevinkace 434910f
remove BASE_PATH
kevinkace 9682ee9
remove extraneous dictionary file
kevinkace a78ed3f
how to run site
kevinkace 4911abc
Notes on updating and tests
kevinkace e4b3845
clarify local prod build and tests
kevinkace c252d48
update action to split build and deploy, and only official GH actions
kevinkace a3bc38d
use meta tag instead of JS redirect
kevinkace File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,49 @@ | ||
| # Simple workflow for deploying static content to GitHub Pages | ||
| name: Deploy static content to Pages | ||
| name: Deploy SvelteKit to GitHub Pages | ||
|
|
||
| on: | ||
| # Runs on pushes targeting the default branch | ||
| push: | ||
| branches: ["main"] | ||
| branches: [main] | ||
|
|
||
| # 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 | ||
|
|
||
| # 2 jobs: build the SvelteKit static site, and deploy the built site to GitHub Pages | ||
| jobs: | ||
| # Single deploy job since we're just deploying | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| # Check out the repo code | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| # Use the Node version defined in .nvmrc | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: npm # cache node_modules for faster builds | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci # ci (not install) to install exact versions from package-lock.json | ||
|
|
||
| # Build the SvelteKit project | ||
| - name: Build project | ||
| run: npm run build | ||
|
|
||
| # Upload build output as artifact | ||
| - uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: ./build # SvelteKit static output folder | ||
|
|
||
| deploy: | ||
| needs: build # make the build artifact available here in deploy job | ||
| runs-on: ubuntu-latest | ||
|
|
||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| runs-on: ubuntu-latest | ||
| url: ${{ steps.deploy.outputs.page_url }} # just a convenience, adds page url to action summary page | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
| - name: Setup Pages | ||
| uses: actions/configure-pages@v3 | ||
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v2 | ||
| with: | ||
| # Upload entire repository | ||
| path: '.' | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v2 | ||
| - id: deploy | ||
| uses: actions/deploy-pages@v4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| test-results | ||
| node_modules | ||
|
|
||
| # Output | ||
| .output | ||
| .vercel | ||
| .netlify | ||
| .wrangler | ||
| /.svelte-kit | ||
| /build | ||
|
|
||
| # OS | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Env | ||
| .env | ||
| .env.* | ||
| !.env.example | ||
| !.env.test | ||
|
|
||
| # Vite | ||
| vite.config.js.timestamp-* | ||
| vite.config.ts.timestamp-* | ||
|
|
||
| # Paraglide | ||
| src/lib/paraglide | ||
|
|
||
|
|
||
| /assets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| engine-strict=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| v22.17.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "cSpell.customDictionaries": { | ||
| "custom-dictionary-workspace": { | ||
| "name": "custom-dictionary-workspace", | ||
| "path": "${workspaceFolder:Local-Connectivity-Lab.github.io}/.cspell/custom-dictionary-workspace.txt", | ||
| "addWords": true, | ||
| "scope": "workspace" | ||
| } | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,78 @@ | ||
| #SCN website (operated by LCL) | ||
| # SCN website (operated by LCL) | ||
|
|
||
| Code repo for the seattlecommunitynetwork.org website. | ||
|
|
||
| This site is built using [SvelteKit](https://svelte.dev/docs/kit/introduction). SvelteKit supports building fully static sites - which is how this site is built. SvelteKit uses NodeJS to run the static site build. | ||
|
|
||
| The website is hosted on GitHub pages. See `./.github/workflows/static.yml` for deployment info. | ||
|
|
||
|
|
||
| ## How to update this website | ||
|
|
||
| You'll want to run the site locally so you can preview your changes. It's fairly simple to setup if you have any programming experience. | ||
|
|
||
| Make your changes and confirm them in your locally running site. Commit change to a feature Branch, and create a pull request in GitHub. | ||
|
|
||
| The changes will then need to be reviewed and merged. After merging, a GitHub Action will kick off to build and deploy the site. This should only take 5 mins, after which your changes will be live! | ||
|
|
||
|
|
||
| ### Local setup | ||
|
|
||
| **Install NodeJS** - two options: | ||
|
|
||
| 1. Download and install NodeJS https://nodejs.org/en/download | ||
| See `./.nvmrc` for the version of NodeJS to install | ||
| 1. Use NVM https://github.com/nvm-sh/nvm | ||
|
|
||
| **Setup** | ||
|
|
||
| 1. Clone the repo | ||
| 1. Using NVM? | ||
| 1. `nvm install` to install the correct NodeJS version | ||
| 1. `nvm use` to use the installed NodeJS version | ||
| 1. Install dependencies with `npm install` | ||
| 1. Start a development server `npm run dev` | ||
|
|
||
| Open your browser to http://localhost:5173 | ||
|
|
||
|
|
||
| ### Update text | ||
|
|
||
| All website text is in `./messages/en.json`. | ||
|
|
||
| Adding or removing text sections will most certainly require updating a template | ||
|
|
||
|
|
||
| ### Update templates | ||
|
|
||
| The website is built with a bunch of `*.svelte` files. Each file has a section for JS, HTML, and CSS. | ||
|
|
||
| Each page of the website starts with a `+page.svelte` template, eg: `./src/routes/+page.svelte` for the homepage, and `./src/routes/about-us/+page.svelte` for the About Us. | ||
|
|
||
| There's 1 layout template used for all pages - `./src/routes/+layout.ts`. | ||
|
|
||
| There is a variety of reusable components in `./src/lib/components/*.svelte` | ||
|
|
||
|
|
||
| ## Tests | ||
|
|
||
| There are automated tests using Playwright. | ||
|
|
||
| - run this the first time, to install Playwright dependencies: `npx playwright install` | ||
| - `npm run test` to run tests | ||
|
|
||
|
|
||
| ## Production build | ||
|
|
||
| To create a *local* production version of your app: | ||
|
|
||
| 1. `npm run build` | ||
| 1. `npm run preview` | ||
| 1. open http://localhost:4137 | ||
|
|
||
|
|
||
| ## Redirects | ||
|
|
||
| No good way to do this with GitHub pages, so we need to create stub sveltekit pages that do a client side redirect. | ||
|
|
||
| See `./create-redirect.js`. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed. Only references non-existent ".cspell/custom-dictionary-workspace.txt", which is not included.