Compare commits
13 Commits
97c6462254
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
9752501ee5
|
|||
|
75f7f4b09c
|
|||
|
21b28ba376
|
|||
|
bbf1f0dde7
|
|||
|
7b63c0c922
|
|||
|
93bbfee7f7
|
|||
|
c81cc54d91
|
|||
|
88f0e84537
|
|||
|
502bc1765f
|
|||
|
4a79266a27
|
|||
|
27808cfd0e
|
|||
|
9a84e9003a
|
|||
|
56b2377cd1
|
27
.devcontainer/devcontainer.json
Normal file
27
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"name": "mail-landing",
|
||||||
|
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm",
|
||||||
|
"onCreateCommand": "npm install -g pnpm@10",
|
||||||
|
"postCreateCommand": "pnpm install",
|
||||||
|
"forwardPorts": [3000],
|
||||||
|
"portsAttributes": {
|
||||||
|
"3000": {
|
||||||
|
"label": "Preview",
|
||||||
|
"onAutoForward": "notify"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": [
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"stylelint.vscode-stylelint",
|
||||||
|
"dbaeumer.vscode-eslint"
|
||||||
|
],
|
||||||
|
"settings": {
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"remoteUser": "node"
|
||||||
|
}
|
||||||
@@ -1,9 +1,16 @@
|
|||||||
# Avoid sending secrets or dev tooling into the build context
|
# Avoid sending secrets or dev tooling into the build context
|
||||||
# config/ and plugins/ are included (no secrets; PHP configs read from ENV at runtime)
|
# config/ and plugins/ are included (no secrets; PHP configs read from ENV at runtime)
|
||||||
|
.devcontainer
|
||||||
|
.pnpm-store
|
||||||
|
.vscode
|
||||||
|
.woodpecker
|
||||||
node_modules
|
node_modules
|
||||||
|
scripts
|
||||||
.git
|
.git
|
||||||
.prettierrc
|
.prettierrc
|
||||||
.prettierignore
|
.prettierignore
|
||||||
*.md
|
*.md
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
|
stylelint.config.js
|
||||||
|
eslint.config.js
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
.pnpm-store
|
||||||
|
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
!.env.example
|
!.env.example
|
||||||
|
|||||||
@@ -1,2 +1,6 @@
|
|||||||
|
.pnpm-store
|
||||||
|
|
||||||
node_modules
|
node_modules
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
|
|
||||||
|
dist
|
||||||
26
.prettierrc
26
.prettierrc
@@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"semi": false,
|
"semi": false,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"tabWidth": 2,
|
"tabWidth": 4,
|
||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": "*.yml",
|
"files": "*.yml",
|
||||||
"options": {
|
"options": {
|
||||||
"tabWidth": 4,
|
"tabWidth": 4,
|
||||||
"proseWrap": "preserve"
|
"proseWrap": "preserve"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ steps:
|
|||||||
- pnpm install --frozen-lockfile
|
- pnpm install --frozen-lockfile
|
||||||
- pnpm lint
|
- pnpm lint
|
||||||
depends_on:
|
depends_on:
|
||||||
- install
|
- Prettier Format Check
|
||||||
|
|
||||||
- name: Send Lint Status Notification (failure)
|
- name: Send Lint Status Notification (failure)
|
||||||
image: curlimages/curl
|
image: curlimages/curl
|
||||||
@@ -76,7 +76,7 @@ steps:
|
|||||||
- pnpm install --frozen-lockfile
|
- pnpm install --frozen-lockfile
|
||||||
- pnpm build
|
- pnpm build
|
||||||
depends_on:
|
depends_on:
|
||||||
- install
|
- Lint Check
|
||||||
|
|
||||||
- name: Send Build Status Notification (failure)
|
- name: Send Build Status Notification (failure)
|
||||||
image: curlimages/curl
|
image: curlimages/curl
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ when:
|
|||||||
evaluate: 'CI_PIPELINE_DEPLOY_TARGET == "production"'
|
evaluate: 'CI_PIPELINE_DEPLOY_TARGET == "production"'
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- ci
|
- build
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger Portainer stack redeploy
|
- name: Trigger Portainer stack redeploy
|
||||||
|
|||||||
36
README.md
36
README.md
@@ -70,9 +70,9 @@ Static landing site for **mifi.holdings** (and www). Plain HTML/CSS/JS source; a
|
|||||||
|
|
||||||
- **Output**: `dist/` (gitignored). Do not edit `dist/`; it is generated.
|
- **Output**: `dist/` (gitignored). Do not edit `dist/`; it is generated.
|
||||||
- **Steps** (see `scripts/build.js`):
|
- **Steps** (see `scripts/build.js`):
|
||||||
1. Clean and copy `src/` → `dist/`.
|
1. Clean and copy `src/` → `dist/`.
|
||||||
2. Minify all `.js` (terser) and `.css` (clean-css).
|
2. Minify all `.js` (terser) and `.css` (clean-css).
|
||||||
3. Inline critical CSS with **Critters** (lazy-loads the rest; no browser required, so it works in CI).
|
3. Inline critical CSS with **Critters** (lazy-loads the rest; no browser required, so it works in CI).
|
||||||
- **When**: Run before `docker build`. CI and the build pipeline both run `pnpm build` before packaging.
|
- **When**: Run before `docker build`. CI and the build pipeline both run `pnpm build` before packaging.
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -81,7 +81,7 @@ Static landing site for **mifi.holdings** (and www). Plain HTML/CSS/JS source; a
|
|||||||
|
|
||||||
- **Frontend**: Static HTML + CSS + JS in `src/`; production build minifies and inlines critical CSS.
|
- **Frontend**: Static HTML + CSS + JS in `src/`; production build minifies and inlines critical CSS.
|
||||||
- **Server**: nginx (Alpine) in Docker.
|
- **Server**: nginx (Alpine) in Docker.
|
||||||
- **Tooling**: **pnpm**; Prettier (format); ESLint (JS), Stylelint (CSS), yamllint (YAML); **terser**, **clean-css**, **critters** (build).
|
- **Tooling**: **pnpm**; Prettier (format); ESLint (JS), Stylelint (CSS), yamllint (YAML); **terser**, **clean-css**, **beasties** (build).
|
||||||
- **Deployment**: Docker image (from `dist/`) → Gitea registry → Portainer stack redeploy.
|
- **Deployment**: Docker image (from `dist/`) → Gitea registry → Portainer stack redeploy.
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -93,9 +93,9 @@ Static landing site for **mifi.holdings** (and www). Plain HTML/CSS/JS source; a
|
|||||||
- **Lint**: `pnpm lint` (ESLint for `src/**/*.js`, Stylelint for `src/**/*.css`, yamllint for Woodpecker + docker-compose). Use `pnpm lint:fix` to auto-fix where supported.
|
- **Lint**: `pnpm lint` (ESLint for `src/**/*.js`, Stylelint for `src/**/*.css`, yamllint for Woodpecker + docker-compose). Use `pnpm lint:fix` to auto-fix where supported.
|
||||||
- **Build**: `pnpm build` → produces `dist/`. Required before building the Docker image.
|
- **Build**: `pnpm build` → produces `dist/`. Required before building the Docker image.
|
||||||
- **Run locally (Docker)**:
|
- **Run locally (Docker)**:
|
||||||
- Build site: `pnpm build`.
|
- Build site: `pnpm build`.
|
||||||
- Image: `pnpm docker:build` (or `docker build --platform linux/amd64 -t git.mifi.dev/mifi-holdings/landing:latest .`).
|
- Image: `pnpm docker:build` (or `docker build --platform linux/amd64 -t git.mifi.dev/mifi-holdings/landing:latest .`).
|
||||||
- Run: use `docker-compose up` **only** on a host that has `marina-net` and Traefik; otherwise run the image with a port map and open `http://localhost:<port>`.
|
- Run: use `docker-compose up` **only** on a host that has `marina-net` and Traefik; otherwise run the image with a port map and open `http://localhost:<port>`.
|
||||||
|
|
||||||
No dev server; edit `src/` and run `pnpm build` (and optionally `docker run` or a local static server on `dist/`) to test.
|
No dev server; edit `src/` and run `pnpm build` (and optionally `docker run` or a local static server on `dist/`) to test.
|
||||||
|
|
||||||
@@ -114,16 +114,16 @@ No dev server; edit `src/` and run `pnpm build` (and optionally `docker run` or
|
|||||||
Three pipelines:
|
Three pipelines:
|
||||||
|
|
||||||
1. **ci** (`.woodpecker/ci.yml`)
|
1. **ci** (`.woodpecker/ci.yml`)
|
||||||
- **When**: Every PR and every push to `main`.
|
- **When**: Every PR and every push to `main`.
|
||||||
- **Steps**: Install deps → Prettier format check → lint (ESLint, Stylelint, yamllint) → **Build** (`pnpm build`). Mattermost notifications on success/failure.
|
- **Steps**: Install deps → Prettier format check → lint (ESLint, Stylelint, yamllint) → **Build** (`pnpm build`). Mattermost notifications on success/failure.
|
||||||
|
|
||||||
2. **build** (`.woodpecker/build.yml`)
|
2. **build** (`.woodpecker/build.yml`)
|
||||||
- **When**: Push/tag/manual on `main` (and deployment to production); **depends_on: ci**.
|
- **When**: Push/tag/manual on `main` (and deployment to production); **depends_on: ci**.
|
||||||
- **Steps**: **Site build** (`pnpm install`, `pnpm build`) → Docker image build (linux/amd64, up to 3 retries) → push `:latest` and `:<CI_COMMIT_SHA>` to `git.mifi.dev/mifi-holdings/landing`. Mattermost notifications.
|
- **Steps**: **Site build** (`pnpm install`, `pnpm build`) → Docker image build (linux/amd64, up to 3 retries) → push `:latest` and `:<CI_COMMIT_SHA>` to `git.mifi.dev/mifi-holdings/landing`. Mattermost notifications.
|
||||||
|
|
||||||
3. **deploy** (`.woodpecker/deploy.yml`)
|
3. **deploy** (`.woodpecker/deploy.yml`)
|
||||||
- **When**: Same as build (main / production deploy); **depends_on: ci**.
|
- **When**: Same as build (main / production deploy); **depends_on: ci**.
|
||||||
- **Steps**: Call Portainer webhook to redeploy the stack. Mattermost notifications.
|
- **Steps**: Call Portainer webhook to redeploy the stack. Mattermost notifications.
|
||||||
|
|
||||||
Secrets used: `gitea_registry_username`, `gitea_package_token`, `portainer_webhook_url`, `mattermost_*` (bot token, channel IDs, API URL).
|
Secrets used: `gitea_registry_username`, `gitea_package_token`, `portainer_webhook_url`, `mattermost_*` (bot token, channel IDs, API URL).
|
||||||
|
|
||||||
@@ -134,11 +134,11 @@ Secrets used: `gitea_registry_username`, `gitea_package_token`, `portainer_webho
|
|||||||
- **Orchestration**: Stack defined in `docker-compose.yml`, deployed via **Portainer** (webhook triggered by Woodpecker deploy pipeline).
|
- **Orchestration**: Stack defined in `docker-compose.yml`, deployed via **Portainer** (webhook triggered by Woodpecker deploy pipeline).
|
||||||
- **Network**: Container joins external network `marina-net` (shared with Traefik).
|
- **Network**: Container joins external network `marina-net` (shared with Traefik).
|
||||||
- **Traefik**:
|
- **Traefik**:
|
||||||
- Hosts: `mifi.holdings`, `www.mifi.holdings`.
|
- Hosts: `mifi.holdings`, `www.mifi.holdings`.
|
||||||
- Entrypoint: `websecure` (HTTPS).
|
- Entrypoint: `websecure` (HTTPS).
|
||||||
- TLS: Let's Encrypt (`tls.certresolver=letsencrypt`).
|
- TLS: Let's Encrypt (`tls.certresolver=letsencrypt`).
|
||||||
- Middleware: `security-prison@file`.
|
- Middleware: `security-prison@file`.
|
||||||
- Backend: this service, port 80.
|
- Backend: this service, port 80.
|
||||||
- **Healthcheck**: `wget --spider -q http://localhost/` every 20s (timeout 3s, 3 retries).
|
- **Healthcheck**: `wget --spider -q http://localhost/` every 20s (timeout 3s, 3 retries).
|
||||||
|
|
||||||
To deploy manually: pull the latest image and redeploy the stack in Portainer, or trigger the Portainer webhook (e.g. same URL as in `portainer_webhook_url`).
|
To deploy manually: pull the latest image and redeploy the stack in Portainer, or trigger the Portainer webhook (e.g. same URL as in `portainer_webhook_url`).
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ services:
|
|||||||
mifi-holdings-landing:
|
mifi-holdings-landing:
|
||||||
image: git.mifi.dev/mifi-holdings/landing:latest
|
image: git.mifi.dev/mifi-holdings/landing:latest
|
||||||
container_name: mifi-holdings-landing
|
container_name: mifi-holdings-landing
|
||||||
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- marina-net
|
- marina-net
|
||||||
labels:
|
labels:
|
||||||
@@ -9,7 +10,7 @@ services:
|
|||||||
- 'traefik.docker.network=marina-net'
|
- 'traefik.docker.network=marina-net'
|
||||||
- 'traefik.http.routers.holdings-landing.rule=Host(`mifi.holdings`) || Host(`www.mifi.holdings`)'
|
- 'traefik.http.routers.holdings-landing.rule=Host(`mifi.holdings`) || Host(`www.mifi.holdings`)'
|
||||||
- 'traefik.http.routers.holdings-landing.entrypoints=websecure'
|
- 'traefik.http.routers.holdings-landing.entrypoints=websecure'
|
||||||
- 'traefik.http.routers.holdings-landing.middlewares=security-supermax-with-analytics@file,redirect-www-to-non-www@file'
|
- 'traefik.http.routers.holdings-landing.middlewares=gzip@file,security-supermax-with-analytics@file,redirect-www-to-non-www@file'
|
||||||
- 'traefik.http.routers.holdings-landing.tls=true'
|
- 'traefik.http.routers.holdings-landing.tls=true'
|
||||||
- 'traefik.http.routers.holdings-landing.tls.certresolver=letsencrypt'
|
- 'traefik.http.routers.holdings-landing.tls.certresolver=letsencrypt'
|
||||||
- 'traefik.http.services.holdings-landing.loadbalancer.server.port=80'
|
- 'traefik.http.services.holdings-landing.loadbalancer.server.port=80'
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
import prettierConfig from 'eslint-config-prettier/flat'
|
import prettierConfig from 'eslint-config-prettier/flat'
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
files: ['src/**/*.js'],
|
files: ['src/**/*.js'],
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
ecmaVersion: 'latest',
|
ecmaVersion: 'latest',
|
||||||
sourceType: 'script',
|
sourceType: 'script',
|
||||||
globals: {
|
globals: {
|
||||||
window: 'readonly',
|
window: 'readonly',
|
||||||
document: 'readonly',
|
document: 'readonly',
|
||||||
dataLayer: 'writable'
|
dataLayer: 'writable'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
rules: {
|
prettierConfig
|
||||||
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
prettierConfig
|
|
||||||
]
|
]
|
||||||
|
|||||||
71
package.json
71
package.json
@@ -1,36 +1,39 @@
|
|||||||
{
|
{
|
||||||
"type": "module",
|
"name": "mifi-holdings-landing",
|
||||||
"name": "mifi-holdings-landing",
|
"type": "module",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"packageManager": "pnpm@10.29.3",
|
"packageManager": "pnpm@10.29.3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node scripts/build.js",
|
"build": "node scripts/build.js",
|
||||||
"docker:build": "docker build --platform linux/amd64 -t git.mifi.dev/mifi-holdings/landing:latest .",
|
"docker:build": "docker build --platform linux/amd64 -t git.mifi.dev/mifi-holdings/landing:latest .",
|
||||||
"docker:push": "docker push git.mifi.dev/mifi-holdings/landing:latest",
|
"docker:push": "docker push git.mifi.dev/mifi-holdings/landing:latest",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"format:check": "prettier --check .",
|
"format:check": "prettier --check .",
|
||||||
"lint": "pnpm run lint:yaml && pnpm run lint:js && pnpm run lint:css",
|
"lint": "pnpm run lint:yaml && pnpm run lint:js && pnpm run lint:css",
|
||||||
"lint:css": "stylelint \"src/**/*.css\"",
|
"lint:css": "stylelint \"src/**/*.css\"",
|
||||||
"lint:js": "eslint src/",
|
"lint:js": "eslint src/",
|
||||||
"lint:yaml": "yamllint .woodpecker/ci.yml .woodpecker/build.yml .woodpecker/deploy.yml docker-compose.yml",
|
"lint:yaml": "yamllint .woodpecker/ci.yml .woodpecker/build.yml .woodpecker/deploy.yml docker-compose.yml",
|
||||||
"lint:fix": "pnpm run lint:fix:js && pnpm run lint:fix:css && pnpm run lint:fix:yaml",
|
"lint:fix": "pnpm run lint:fix:js && pnpm run lint:fix:css && pnpm run lint:fix:yaml",
|
||||||
"lint:fix:js": "eslint src/ --fix",
|
"lint:fix:js": "eslint src/ --fix",
|
||||||
"lint:fix:css": "stylelint \"src/**/*.css\" --fix",
|
"lint:fix:css": "stylelint \"src/**/*.css\" --fix",
|
||||||
"lint:fix:yaml": "yamllint .woodpecker/ci.yml .woodpecker/build.yml .woodpecker/deploy.yml docker-compose.yml --fix"
|
"lint:fix:yaml": "yamllint .woodpecker/ci.yml .woodpecker/build.yml .woodpecker/deploy.yml docker-compose.yml --fix",
|
||||||
},
|
"preview": "serve src -l 3000",
|
||||||
"devDependencies": {
|
"preview:prod": "pnpm build && serve dist -l 3000"
|
||||||
"clean-css": "^5.3.3",
|
},
|
||||||
"critters": "^0.0.25",
|
"devDependencies": {
|
||||||
"eslint": "^10.0.0",
|
"clean-css": "^5.3.3",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"beasties": "^0.4.1",
|
||||||
"prettier": "^3.4.2",
|
"eslint": "^10.0.0",
|
||||||
"stylelint": "^17.3.0",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"stylelint-config-standard": "^40.0.0",
|
"prettier": "^3.4.2",
|
||||||
"terser": "^5.46.0",
|
"serve": "^14.2.4",
|
||||||
"yaml-lint": "^1.7.0"
|
"stylelint": "^17.3.0",
|
||||||
},
|
"stylelint-config-standard": "^40.0.0",
|
||||||
"repository": {
|
"terser": "^5.46.0",
|
||||||
"type": "git",
|
"yaml-lint": "^1.7.0"
|
||||||
"url": "https://github.com/mifi-holdings/landing.git"
|
},
|
||||||
}
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/mifi-holdings/landing.git"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
522
pnpm-lock.yaml
generated
522
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,18 +1,18 @@
|
|||||||
/**
|
/**
|
||||||
* Build script: copy src → dist, minify JS/CSS, inline critical CSS (Critters).
|
* Build script: copy src → dist, minify JS/CSS, inline critical CSS (Beasties).
|
||||||
* Run with: pnpm build
|
* Run with: pnpm build
|
||||||
*/
|
*/
|
||||||
import {
|
import {
|
||||||
rmSync,
|
rmSync,
|
||||||
mkdirSync,
|
mkdirSync,
|
||||||
readFileSync,
|
readFileSync,
|
||||||
writeFileSync,
|
writeFileSync,
|
||||||
cpSync,
|
cpSync,
|
||||||
readdirSync
|
readdirSync
|
||||||
} from 'fs'
|
} from 'fs'
|
||||||
import { join, dirname, extname } from 'path'
|
import { join, dirname, extname } from 'path'
|
||||||
import { fileURLToPath } from 'url'
|
import { fileURLToPath } from 'url'
|
||||||
import Critters from 'critters'
|
import Beasties from 'beasties'
|
||||||
import { minify as minifyJs } from 'terser'
|
import { minify as minifyJs } from 'terser'
|
||||||
import CleanCSS from 'clean-css'
|
import CleanCSS from 'clean-css'
|
||||||
|
|
||||||
@@ -22,55 +22,57 @@ const srcDir = join(root, 'src')
|
|||||||
const distDir = join(root, 'dist')
|
const distDir = join(root, 'dist')
|
||||||
|
|
||||||
function getFiles(dir, files = []) {
|
function getFiles(dir, files = []) {
|
||||||
const entries = readdirSync(dir, { withFileTypes: true })
|
const entries = readdirSync(dir, { withFileTypes: true })
|
||||||
for (const e of entries) {
|
for (const e of entries) {
|
||||||
const full = join(dir, e.name)
|
const full = join(dir, e.name)
|
||||||
if (e.isDirectory()) getFiles(full, files)
|
if (e.isDirectory()) getFiles(full, files)
|
||||||
else files.push(full)
|
else files.push(full)
|
||||||
}
|
}
|
||||||
return files
|
return files
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
// 1. Clean and copy src → dist
|
// 1. Clean and copy src → dist
|
||||||
rmSync(distDir, { recursive: true, force: true })
|
rmSync(distDir, { recursive: true, force: true })
|
||||||
mkdirSync(distDir, { recursive: true })
|
mkdirSync(distDir, { recursive: true })
|
||||||
cpSync(srcDir, distDir, { recursive: true })
|
cpSync(srcDir, distDir, { recursive: true })
|
||||||
|
|
||||||
const distFiles = getFiles(distDir)
|
const distFiles = getFiles(distDir)
|
||||||
|
|
||||||
// 2. Minify JS
|
// 2. Minify JS
|
||||||
const jsFiles = distFiles.filter((f) => extname(f) === '.js')
|
const jsFiles = distFiles.filter((f) => extname(f) === '.js')
|
||||||
for (const f of jsFiles) {
|
for (const f of jsFiles) {
|
||||||
const code = readFileSync(f, 'utf8')
|
const code = readFileSync(f, 'utf8')
|
||||||
const result = await minifyJs(code, { format: { comments: false } })
|
const result = await minifyJs(code, { format: { comments: false } })
|
||||||
if (result.code) writeFileSync(f, result.code)
|
if (result.code) writeFileSync(f, result.code)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Minify CSS
|
// 3. Minify CSS
|
||||||
const cleanCss = new CleanCSS({ level: 2 })
|
const cleanCss = new CleanCSS({ level: 2 })
|
||||||
const cssFiles = distFiles.filter((f) => extname(f) === '.css')
|
const cssFiles = distFiles.filter((f) => extname(f) === '.css')
|
||||||
for (const f of cssFiles) {
|
for (const f of cssFiles) {
|
||||||
const code = readFileSync(f, 'utf8')
|
const code = readFileSync(f, 'utf8')
|
||||||
const result = cleanCss.minify(code)
|
const result = cleanCss.minify(code)
|
||||||
if (!result.errors.length) writeFileSync(f, result.styles)
|
if (!result.errors.length) writeFileSync(f, result.styles)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Inline critical CSS with Critters (no browser; works in CI)
|
// 4. Inline critical CSS with Beasties for all HTML files (no browser; works in CI)
|
||||||
const critters = new Critters({
|
const htmlFiles = distFiles.filter((f) => extname(f) === '.html')
|
||||||
path: distDir,
|
const beasties = new Beasties({
|
||||||
preload: 'default',
|
path: distDir,
|
||||||
logLevel: 'warn'
|
preload: 'default',
|
||||||
})
|
logLevel: 'warn'
|
||||||
const indexPath = join(distDir, 'index.html')
|
})
|
||||||
const html = readFileSync(indexPath, 'utf8')
|
for (const htmlFile of htmlFiles) {
|
||||||
const inlined = await critters.process(html)
|
const html = readFileSync(htmlFile, 'utf8')
|
||||||
writeFileSync(indexPath, inlined)
|
const inlined = await beasties.process(html)
|
||||||
|
writeFileSync(htmlFile, inlined)
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Build complete: dist/')
|
console.log('Build complete: dist/')
|
||||||
}
|
}
|
||||||
|
|
||||||
main().catch((err) => {
|
main().catch((err) => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
})
|
})
|
||||||
|
|||||||
1
src/.well-known/appspecific/com.chrome.devtools.json
Normal file
1
src/.well-known/appspecific/com.chrome.devtools.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
@@ -1,70 +1,90 @@
|
|||||||
|
.skip-link {
|
||||||
|
position: absolute;
|
||||||
|
top: -100%;
|
||||||
|
left: 0;
|
||||||
|
z-index: 100;
|
||||||
|
padding: 0.75rem 1.25rem;
|
||||||
|
background: #70ffd7;
|
||||||
|
color: #1b1e22;
|
||||||
|
font-weight: 700;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 0 0 0.25rem;
|
||||||
|
transition: top 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skip-link:focus {
|
||||||
|
top: 0;
|
||||||
|
outline: 2px solid #70ffd7;
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
background: #121212;
|
background: #121212;
|
||||||
color: #f4f4f4;
|
color: #f4f4f4;
|
||||||
font-family: Inter, Arial, sans-serif;
|
font-family: Inter, Arial, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background: rgb(34 39 44 / 92%);
|
background: rgb(34 39 44 / 92%);
|
||||||
padding: 3rem 2rem;
|
padding: 3rem 2rem;
|
||||||
border-radius: 1.5rem;
|
border-radius: 1.5rem;
|
||||||
box-shadow: 0 2px 24px 0 rgb(0 0 0 / 13%);
|
box-shadow: 0 2px 24px 0 rgb(0 0 0 / 13%);
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
margin: 1rem;
|
margin: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.emoji {
|
.emoji {
|
||||||
font-size: 2.8rem;
|
font-size: 2.8rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
letter-spacing: -1px;
|
letter-spacing: -1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
color: #babed8;
|
color: #babed8;
|
||||||
margin-bottom: 1.7rem;
|
margin-bottom: 1.7rem;
|
||||||
font-size: 1.14rem;
|
font-size: 1.14rem;
|
||||||
line-height: 1.55;
|
line-height: 1.55;
|
||||||
}
|
}
|
||||||
|
|
||||||
.scram {
|
.scram {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 0.7rem 1.4rem;
|
padding: 0.7rem 1.4rem;
|
||||||
background: #70ffd7;
|
background: #70ffd7;
|
||||||
color: #1b1e22;
|
color: #1b1e22;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
transition: background 0.2s;
|
transition: background 0.2s;
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.5rem;
|
||||||
box-shadow: 0 1px 4px 0 rgb(112 255 215 / 10%);
|
box-shadow: 0 1px 4px 0 rgb(112 255 215 / 10%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.scram:hover {
|
.scram:hover {
|
||||||
background: #50bf9c;
|
background: #50bf9c;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (width <= 430px) {
|
@media (width <= 430px) {
|
||||||
.container {
|
.container {
|
||||||
padding: 2rem 0.6rem;
|
padding: 2rem 0.6rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
;(function () {
|
;(function () {
|
||||||
var script = document.currentScript
|
var script = document.currentScript
|
||||||
var id = script && script.getAttribute('data-ga-id')
|
var id = script && script.getAttribute('data-ga-id')
|
||||||
if (!id) return
|
if (!id) return
|
||||||
window.dataLayer = window.dataLayer || []
|
window.dataLayer = window.dataLayer || []
|
||||||
function gtag() {
|
function gtag() {
|
||||||
window.dataLayer.push(arguments)
|
window.dataLayer.push(arguments)
|
||||||
}
|
}
|
||||||
gtag('js', new Date())
|
gtag('js', new Date())
|
||||||
gtag('config', id, { anonymize_ip: true })
|
gtag('config', id, { anonymize_ip: true })
|
||||||
})()
|
})()
|
||||||
|
|||||||
131
src/index.html
131
src/index.html
@@ -1,51 +1,94 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<!-- Google tag (gtag.js) -->
|
<!-- Google tag (gtag.js) -->
|
||||||
<script
|
<script
|
||||||
async
|
async
|
||||||
src="https://www.googletagmanager.com/gtag/js?id=G-4000VNMXLK"
|
src="https://www.googletagmanager.com/gtag/js?id=G-4000VNMXLK"
|
||||||
></script>
|
></script>
|
||||||
<script
|
<script
|
||||||
defer
|
defer
|
||||||
src="/assets/js/ga-init.js"
|
src="/assets/js/ga-init.js"
|
||||||
data-ga-id="G-4000VNMXLK"
|
data-ga-id="G-4000VNMXLK"
|
||||||
></script>
|
></script>
|
||||||
|
<script
|
||||||
|
defer
|
||||||
|
src="https://analytics.mifi.holdings/script.js"
|
||||||
|
data-website-id="ce2a7f8a-95e9-4bc5-93cb-2e6075d836b8"
|
||||||
|
></script>
|
||||||
|
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||||
|
|
||||||
<title>mifi.holdings</title>
|
<title>mifi.holdings</title>
|
||||||
<meta
|
<meta
|
||||||
name="description"
|
name="description"
|
||||||
content="This is just a landing page so something exists at the root domain of all the digital holdings of mifi."
|
content="This is just a landing page so something exists at the root domain of all the digital holdings of mifi."
|
||||||
/>
|
/>
|
||||||
<link rel="canonical" href="https://mifi.holdings" />
|
<link rel="canonical" href="https://mifi.holdings" />
|
||||||
<meta name="robots" content="index, follow" />
|
<meta name="robots" content="index, follow" />
|
||||||
<meta name="author" content="mifi" />
|
<meta name="author" content="mifi" />
|
||||||
|
|
||||||
<link rel="stylesheet" href="assets/css/style.css" />
|
<link rel="stylesheet" href="assets/css/style.css" />
|
||||||
|
|
||||||
<link rel="icon" type="image/svg+xml" href="/assets/images/favicon.svg" />
|
<link
|
||||||
<link rel="icon" type="image/x-icon" href="/assets/images/favicon.ico" />
|
rel="icon"
|
||||||
<link
|
type="image/svg+xml"
|
||||||
rel="apple-touch-icon"
|
href="/assets/images/favicon.svg"
|
||||||
sizes="180x180"
|
/>
|
||||||
href="/assets/images/apple-touch-icon.png"
|
<link
|
||||||
/>
|
rel="icon"
|
||||||
</head>
|
type="image/x-icon"
|
||||||
<body>
|
href="/assets/images/favicon.ico"
|
||||||
<div class="container">
|
/>
|
||||||
<div class="emoji">🛸</div>
|
<link
|
||||||
<h1>Nothing to See Here</h1>
|
rel="apple-touch-icon"
|
||||||
<p>
|
sizes="180x180"
|
||||||
You've stumbled onto <b>mifi.holdings</b> — the legendary vault of
|
href="/assets/images/apple-touch-icon.png"
|
||||||
digital oddities, curios, and coffee-fueled experiments belonging to a
|
/>
|
||||||
possibly-human, definitely-mysterious entity named
|
|
||||||
<b>mifi</b>.<br /><br />
|
<script type="application/ld+json">
|
||||||
There's nothing here for you.<br />
|
{
|
||||||
Go on. Shoo. Scram. Or just keep wondering.
|
"@context": "https://schema.org",
|
||||||
</p>
|
"@type": "WebSite",
|
||||||
</div>
|
"name": "mifi Holdings",
|
||||||
</body>
|
"url": "https://mifi.holdings",
|
||||||
|
"description": "This is just a landing page so something exists at the root domain of all the digital holdings of mifi.",
|
||||||
|
"publisher": {
|
||||||
|
"@type": "Organization",
|
||||||
|
"name": "mifi Ventures",
|
||||||
|
"url": "https://mifi.ventures",
|
||||||
|
"email": "postmaster@mifi.holdings"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<a
|
||||||
|
href="#main-content"
|
||||||
|
class="skip-link"
|
||||||
|
data-umami-event="skip to main content"
|
||||||
|
>Skip to main content</a
|
||||||
|
>
|
||||||
|
<main id="main-content" class="container" tabindex="-1">
|
||||||
|
<div class="emoji">🛸</div>
|
||||||
|
<h1>Nothing to See Here</h1>
|
||||||
|
<p>
|
||||||
|
You've stumbled onto <b>mifi.holdings</b> — the legendary
|
||||||
|
vault of digital oddities, curios, and coffee-fueled experiments
|
||||||
|
belonging to a possibly-human, definitely-mysterious entity
|
||||||
|
named <b>mifi</b>.<br /><br />
|
||||||
|
There's nothing here for you.<br />
|
||||||
|
Go on. Shoo. Scram. Or just keep wondering.
|
||||||
|
</p>
|
||||||
|
</main>
|
||||||
|
<img
|
||||||
|
src="https://analytics.mifi.holdings/p/wQ9GYnLIg"
|
||||||
|
alt=""
|
||||||
|
width="1"
|
||||||
|
height="1"
|
||||||
|
role="presentation"
|
||||||
|
loading="eager"
|
||||||
|
/>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
4
src/robots.txt
Normal file
4
src/robots.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
User-agent: *
|
||||||
|
Allow: /
|
||||||
|
|
||||||
|
Sitemap: https://mifi.holdings/sitemap.xml
|
||||||
8
src/sitemap.xml
Normal file
8
src/sitemap.xml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
<url>
|
||||||
|
<loc>https://mifi.holdings/</loc>
|
||||||
|
<changefreq>monthly</changefreq>
|
||||||
|
<priority>1.0</priority>
|
||||||
|
</url>
|
||||||
|
</urlset>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
export default {
|
export default {
|
||||||
extends: ['stylelint-config-standard'],
|
extends: ['stylelint-config-standard'],
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
files: ['src/**/*.css']
|
files: ['src/**/*.css']
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user