Skip to content

Commit

Permalink
converted to 100% static file server site
Browse files Browse the repository at this point in the history
  • Loading branch information
traceypooh committed Nov 3, 2024
1 parent b28f6c7 commit 370c562
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 109 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.git
.git*
11 changes: 11 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on: [push, workflow_dispatch]
jobs:
cicd:
# https://github.com/internetarchive/cicd
uses: internetarchive/cicd/.github/workflows/cicd.yml@main
with:
NOMAD_VAR_PORTS: '{ 80 = "http" }'
NOMAD_VAR_HOSTNAMES: '["tracey.archive.org"]'
PLATFORMS: 'linux/amd64,linux/arm64'
secrets:
NOMAD_TOKEN_EXT: ${{ secrets.NOMAD_TOKEN_EXT }}
11 changes: 11 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on:
workflow_call:

jobs:
lint:
runs-on: ubuntu-latest
container:
image: ghcr.io/internetarchive/dyno:main
steps:
- uses: actions/checkout@v4
- run: /app/lint
11 changes: 0 additions & 11 deletions .gitlab-ci.yml

This file was deleted.

16 changes: 2 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
FROM denoland/deno:alpine
FROM nginx:alpine

LABEL maintainers=tracey

EXPOSE 5000

# needed for `env -S`
RUN apk add coreutils

WORKDIR /app/
WORKDIR /usr/share/nginx/html/
COPY . .

USER deno

RUN deno cache index.js

CMD ./index.js
7 changes: 7 additions & 0 deletions bootstrap.min.css

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta property="title" content="Tracey Jaquith, Internet Archive πŸ›οΈ">
<!--
<link href="https://esm.archive.org/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
-->
<link href="bootstrap.min.css" rel="stylesheet" type="text/css"/>
<style>
.list {
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
align-items: top;
}
h2 {
margin-top: 75px;
}
.card {
text-align: center;
display: initial;
}
.card a img {
max-width: 250px;
max-height: 250px;
}
.card a {
display: block;
}
a {
text-decoration: none;
}
</style>
</head>

<body>
<div class="container" style="width:98%; max-width:98%">
<h1>
Tracey Jaquith<br>
Founding Coder, Internet Archive πŸ›οΈ<br>
TV Architect
</h1>
<h3>
I focus on TV, video/audio, UI/UX, javascript πŸ¦•, markdown, 🦭 containers & devops πŸ‹
</h3>
<b>
Find me at:
<a href="https://mastodon.social/@traceypooh">🦣 mastodon</a>
<a href="https://twitter.com/tracey_pooh">🐦 twitter/X</a>
</b>

<main></main>

<hr>
πŸ‘† <i>i'm an expert plastic square presser</i>
</div>
</body>

<script type="module" src="./index.js"></script>
88 changes: 5 additions & 83 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
#!/usr/bin/env -S deno run --location https://tracey.dev.archive.org --allow-read --allow-net --watch

/**
* Our little web server
*/
import httpd from 'https://deno.land/x/httpd/mod.js'

const SLIDES = 'https://archive.org/~tracey/slides/'
const ME = {
// When updating a "slides only" w/ a new video link:
Expand Down Expand Up @@ -190,68 +183,7 @@ We use ffmpeg to crop the image area; tesseract to OCR the image into text; and
}


/**
* Returns beginning static markup for @see markup()
*
* @param string title Page / H1 title
*/
function markup_pre() {
return `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta property="title" content="Tracey Jaquith, Internet Archive πŸ›οΈ">
<link href="https://esm.archive.org/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<style>
.list {
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
align-items: top;
}
h2 {
margin-top: 75px;
}
.card {
text-align: center;
display: initial;
}
.card a img {
max-width: 250px;
max-height: 250px;
}
.card a {
display: block;
}
a {
text-decoration: none;
}
</style>
</head>
<body>
<div class="container" style="width:98%; max-width:98%">
<h1>
Tracey Jaquith<br>
Founding Coder, Internet Archive πŸ›οΈ<br>
TV Architect
</h1>
<h3>
I focus on TV, video/audio, UI/UX, javascript πŸ¦•, markdown, 🦭 containers & devops πŸ‹
</h3>
<b>
Find me at:
<a href="https://mastodon.social/@traceypooh">🦣 mastodon</a>
<a href="https://twitter.com/tracey_pooh">🐦 twitter/X</a>
</b>
`
}


function markup() {
function main() {
let str = ''

for (const [header, list] of Object.entries(ME)) {
Expand All @@ -278,20 +210,10 @@ function markup() {
str += '</div>'
}

return str
document.querySelector('main').innerHTML = str
}


function markup_post() {
return `
<hr>
πŸ‘† <i>i'm an expert plastic square presser</i>
`
}

// Main web server
// eslint-disable-next-line consistent-return
httpd((req, headers) => {
if (new URL(req.url).pathname === '/')
return new Response(`${markup_pre()}${markup()}${markup_post()}`, { headers })
}, { ls: false })
document.addEventListener('DOMContentLoaded', () => {
main()
})

0 comments on commit 370c562

Please sign in to comment.