Browse Source

build static files

pull/5/head
Justin Duch 1 year ago
parent
commit
53d24f9eee
  1. 9
      .dockerignore
  2. 15
      Dockerfile
  3. 4
      LICENSE
  4. 2
      Makefile
  5. 9
      nginx/default.conf
  6. 4
      package.json
  7. 24
      src/routes/_error.svelte
  8. 12
      src/routes/about.svelte
  9. 308
      src/template.html
  10. 0
      static/gif/hass1.gif
  11. 1
      static/icon-dark.svg
  12. 0
      static/icon.svg
  13. 0
      static/img/cal_form_1.png
  14. 0
      static/img/cal_form_1_code_dm.png
  15. 0
      static/img/cal_form_1_code_eq.png
  16. 0
      static/img/cal_form_1_code_sn.png
  17. 0
      static/img/cal_form_2.png
  18. 0
      static/img/cal_form_2_code.png
  19. 0
      static/img/hass1.jpg
  20. 0
      static/img/hass2.jpg
  21. 0
      static/img/mouth.jpg
  22. 0
      static/thumbnails/antigrav-thumb.png
  23. 0
      static/thumbnails/copypaste-compromises-thumb.png
  24. 0
      static/thumbnails/gpt3-thumb.png
  25. 0
      static/thumbnails/speaking-simulator-thumb.png

9
.dockerignore

@ -1,9 +0,0 @@
/*
!/__sapper__
/__sapper__/*
!/__sapper__/build
!/Dockerfile
!/package.json
!/yarn.lock
!/_posts
!/static

15
Dockerfile

@ -1,12 +1,3 @@
FROM mhart/alpine-node:10.21
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install
FROM mhart/alpine-node:10.21
COPY --from=0 /app .
COPY . .
EXPOSE 3000
CMD ["node", "__sapper__/build"]
FROM nginx:alpine
COPY __sapper__/export/. /usr/share/nginx/html
COPY nginx/default.conf /etc/nginx/conf.d/default.conf

4
LICENSE

@ -1,4 +1,4 @@
Copyright (c) 2019 Justin Duch
Copyright (c) 2020 Justin Duch
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
@ -22,4 +22,4 @@ SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
DEALINGS IN THE SOFTWARE.

2
Makefile

@ -3,7 +3,7 @@ IMAGE := docker.duch.me/jd/blog:latest
docker:
@echo "\n~> building docker image"
@yarn install
@yarn build
@yarn export
@docker build . -t $(IMAGE)

9
nginx/default.conf

@ -0,0 +1,9 @@
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
error_page 404 /404/index.html;
}
}

4
package.json

@ -6,7 +6,7 @@
"author": "Justin Duch <justin@justinduch.com>",
"scripts": {
"build": "sapper build",
"export": "sapper export",
"export": "sapper export --entry '/ /404'",
"start": "node __sapper__/build",
"start:dev": "sapper dev",
"lint": "eslint ."
@ -45,4 +45,4 @@
"resolutions": {
"minimist": ">= 1.2.2"
}
}
}

24
src/routes/_error.svelte

@ -5,33 +5,11 @@
const dev = process.env.NODE_ENV !== "production";
</script>
<style>
h1,
p {
margin: 0 auto;
}
h1 {
font-size: 2.8em;
font-weight: 700;
margin: 0 0 0.5em 0;
}
p {
margin: 1em auto;
}
@media (min-width: 480px) {
h1 {
font-size: 4em;
}
}
</style>
<svelte:head>
<title>{status}</title>
</svelte:head>
<a href=".">retour</a>
<h1>{status}</h1>
<p>{error.message}</p>

12
src/routes/about.svelte

@ -10,8 +10,16 @@
justin@duch.me
<a href="/publickey.justin@duch.me.txt">(PGP)</a>
</p>
<p><strong>Code: </strong><a href="https://github.com/beanpuppy/justin.duch.me">github.com/beanpuppy/justin.duch.me</a></p>
<p><strong>RSS: </strong><a href="https://justin.duch.me/api/feed">justin.duch.me/api/feed</a></p>
<p>
<strong>Code:</strong>
<a href="https://github.com/beanpuppy/justin.duch.me">
github.com/beanpuppy/justin.duch.me
</a>
</p>
<p>
<strong>RSS:</strong>
<a href="/api/feed">justin.duch.me/api/feed</a>
</p>
<p>
It should go without saying that all opinions are my own and do not reflect
those of anyone I work for.

308
src/template.html

@ -1,170 +1,168 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta name="theme-color" content="#333333" />
%sapper.base%
<link href="manifest.json" rel="manifest" />
<link href="favicon.ico" rel="icon" type="image/icon" />
<!-- Web sign in links -->
<link href="https://github.com/beanpuppy" rel="me" />
<link href="https://twitter.com/beanpup_py" rel="me" />
<link href="mailto:justin@justinduch.com" rel="me" />
<link href="/publickey.txt" rel="pgpkey authn" />
<link href="https://eldritch.cafe/@beanpup_py" rel="me" />
<link rel="preconnect" href="https://cdn.halcyonnouveau.xyz" crossorigin />
<link rel="dns-prefetch" href="//cdn.halcyonnouveau.xyz" />
<style>
@font-face {
font-family: "Signifier";
src: url("/webfonts/Signifier-Black.woff2") format("woff2"),
url("/webfonts/Signifier-Black.woff") format("woff");
font-weight: 900;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Signifier";
src: url("/webfonts/Signifier-Bold.woff2") format("woff2"),
url("/webfonts/Signifier-Bold.woff") format("woff");
font-weight: bold;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Signifier";
src: url("/webfonts/Signifier-Light.woff2") format("woff2"),
url("/webfonts/Signifier-Light.woff") format("woff");
font-weight: 300;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Signifier";
src: url("/webfonts/Signifier-Extralight.woff2") format("woff2"),
url("/webfonts/Signifier-Extralight.woff") format("woff");
font-weight: 200;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Signifier";
src: url("/webfonts/Signifier-Medium.woff2") format("woff2"),
url("/webfonts/Signifier-Medium.woff") format("woff");
font-weight: 500;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Signifier";
src: url("/webfonts/Signifier-Regular.woff2") format("woff2"),
url("/webfonts/Signifier-Regular.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Signifier";
src: url("/webfonts/Signifier-Thin.woff2") format("woff2"),
url("/webfonts/Signifier-Thin.woff") format("woff");
font-weight: 100;
font-style: normal;
font-display: swap;
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta name="theme-color" content="#333333" />
%sapper.base%
<link href="manifest.json" rel="manifest" />
<link href="favicon.ico" rel="icon" type="image/icon" />
<!-- Web sign in links -->
<link href="https://github.com/beanpuppy" rel="me" />
<link href="https://twitter.com/beanpup_py" rel="me" />
<link href="mailto:justin@duch.me" rel="me" />
<link href="/publickey.justin@duch.me.txt" rel="pgpkey authn" />
<link href="https://eldritch.cafe/@beanpup_py" rel="me" />
<link rel="preconnect" href="https://cdn.halcyonnouveau.xyz" crossorigin />
<link rel="dns-prefetch" href="//cdn.halcyonnouveau.xyz" />
<style>
@font-face {
font-family: "Signifier";
src: url("/webfonts/Signifier-Black.woff2") format("woff2"),
url("/webfonts/Signifier-Black.woff") format("woff");
font-weight: 900;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Signifier";
src: url("/webfonts/Signifier-Bold.woff2") format("woff2"),
url("/webfonts/Signifier-Bold.woff") format("woff");
font-weight: bold;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Signifier";
src: url("/webfonts/Signifier-Light.woff2") format("woff2"),
url("/webfonts/Signifier-Light.woff") format("woff");
font-weight: 300;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Signifier";
src: url("/webfonts/Signifier-Extralight.woff2") format("woff2"),
url("/webfonts/Signifier-Extralight.woff") format("woff");
font-weight: 200;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Signifier";
src: url("/webfonts/Signifier-Medium.woff2") format("woff2"),
url("/webfonts/Signifier-Medium.woff") format("woff");
font-weight: 500;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Signifier";
src: url("/webfonts/Signifier-Regular.woff2") format("woff2"),
url("/webfonts/Signifier-Regular.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Signifier";
src: url("/webfonts/Signifier-Thin.woff2") format("woff2"),
url("/webfonts/Signifier-Thin.woff") format("woff");
font-weight: 100;
font-style: normal;
font-display: swap;
}
body {
margin: 0;
font-family: Signifier, -apple-system, BlinkMacSystemFont,
Helvetica Neue, sans-serif !important;
font-size: 20px;
font-weight: 200;
line-height: 1.3;
color: #e1e1e1;
background-color: #191919;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0 0 0.5em;
font-style: normal;
letter-spacing: 0.1em;
font-weight: 400;
text-transform: lowercase;
}
a {
color: inherit;
font-weight: 100;
text-decoration: none;
text-decoration-color: #ccc;
padding: 1px;
}
a:hover {
color: #ec53dd;
}
.space-yo {
display: flex;
justify-content: space-between;
width: 100%;
align-items: center;
}
@media screen and (max-width: 648px) {
.space-column {
flex-direction: column;
align-items: initial;
}
}
</style>
body {
margin: 0;
font-family: Signifier, -apple-system, BlinkMacSystemFont,
Helvetica Neue, sans-serif !important;
font-size: 20px;
font-weight: 200;
line-height: 1.3;
color: #e1e1e1;
background-color: #191919;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0 0 0.5em;
font-style: normal;
letter-spacing: 0.1em;
font-weight: 400;
text-transform: lowercase;
}
<!-- Defer non-critical css -->
<link href="/css/tomorrow.min.css" rel="stylesheet" media="print" onload="this.media='all'" />
a {
color: inherit;
font-weight: 100;
text-decoration: none;
text-decoration-color: #ccc;
padding: 1px;
}
a:hover {
color: #ec53dd;
}
<!-- Load anyway if JS is disabled -->
<noscript>
<link href="/css/tomorrow.min.css" rel="stylesheet" />
</noscript>
.space-yo {
display: flex;
justify-content: space-between;
width: 100%;
align-items: center;
}
@media screen and (max-width: 648px) {
.space-column {
flex-direction: column;
align-items: initial;
}
}
</style>
<!-- Defer non-critical css -->
<link
href="/css/tomorrow.min.css"
rel="stylesheet"
media="print"
onload="this.media='all'"
/>
<!-- Load anyway if JS is disabled -->
<noscript>
<link href="/css/tomorrow.min.css" rel="stylesheet" />
</noscript>
<!-- Sapper generates a <style> tag containing critical CSS
<!-- Sapper generates a <style> tag containing critical CSS
for the current page. CSS for the rest of the app is
lazily loaded when it precaches secondary pages -->
%sapper.styles%
%sapper.styles%
<!-- This contains the contents of the <svelte:head> component, if
<!-- This contains the contents of the <svelte:head> component, if
the current page has one -->
%sapper.head%
</head>
<body>
<!-- The application will be rendered inside this element,
%sapper.head%
</head>
<body>
<!-- The application will be rendered inside this element,
because `src/client.js` references it -->
<div id="sapper">%sapper.html%</div>
<div id="sapper">%sapper.html%</div>
<!-- Sapper creates a <script> tag containing `src/client.js`
<!-- Sapper creates a <script> tag containing `src/client.js`
and anything else it needs to hydrate the app and
initialise the router -->
%sapper.scripts%
</body>
</html>
%sapper.scripts%
</body>
</html>

0
static/gif/hass1.gif

Before

Width: 540  |  Height: 304  |  Size: 1.4 MiB

After

Width: 540  |  Height: 304  |  Size: 1.4 MiB

1
static/icon-dark.svg
File diff suppressed because it is too large
View File

0
static/icon.svg

0
static/img/cal_form_1.png

Before

Width: 482  |  Height: 550  |  Size: 20 KiB

After

Width: 482  |  Height: 550  |  Size: 20 KiB

0
static/img/cal_form_1_code_dm.png

Before

Width: 887  |  Height: 633  |  Size: 54 KiB

After

Width: 887  |  Height: 633  |  Size: 54 KiB

0
static/img/cal_form_1_code_eq.png

Before

Width: 680  |  Height: 455  |  Size: 32 KiB

After

Width: 680  |  Height: 455  |  Size: 32 KiB

0
static/img/cal_form_1_code_sn.png

Before

Width: 521  |  Height: 268  |  Size: 19 KiB

After

Width: 521  |  Height: 268  |  Size: 19 KiB

0
static/img/cal_form_2.png

Before

Width: 468  |  Height: 329  |  Size: 58 KiB

After

Width: 468  |  Height: 329  |  Size: 58 KiB

0
static/img/cal_form_2_code.png

Before

Width: 676  |  Height: 975  |  Size: 68 KiB

After

Width: 676  |  Height: 975  |  Size: 68 KiB

0
static/img/hass1.jpg

Before

Width: 1920  |  Height: 1080  |  Size: 122 KiB

After

Width: 1920  |  Height: 1080  |  Size: 122 KiB

0
static/img/hass2.jpg

Before

Width: 1920  |  Height: 1080  |  Size: 216 KiB

After

Width: 1920  |  Height: 1080  |  Size: 216 KiB

0
static/img/mouth.jpg

Before

Width: 308  |  Height: 300  |  Size: 20 KiB

After

Width: 308  |  Height: 300  |  Size: 20 KiB

0
static/thumbnails/antigrav-thumb.png

Before

Width: 1920  |  Height: 1080  |  Size: 94 KiB

After

Width: 1920  |  Height: 1080  |  Size: 94 KiB

0
static/thumbnails/copypaste-compromises-thumb.png

Before

Width: 1920  |  Height: 1080  |  Size: 104 KiB

After

Width: 1920  |  Height: 1080  |  Size: 104 KiB

0
static/thumbnails/gpt3-thumb.png

Before

Width: 1920  |  Height: 1080  |  Size: 90 KiB

After

Width: 1920  |  Height: 1080  |  Size: 90 KiB

0
static/thumbnails/speaking-simulator-thumb.png

Before

Width: 1920  |  Height: 1080  |  Size: 97 KiB

After

Width: 1920  |  Height: 1080  |  Size: 97 KiB

Loading…
Cancel
Save