27 Commits

Author SHA1 Message Date
Sped0n
a909afee97 ci: update bundled artifacts [skip ci] 2025-11-25 13:21:07 +00:00
Ryan
9c15a367ea refactor(gallery): adjust navClose min-width to 25% (#535)
Reduce min-width from 30% to 25% for better mobile gallery layout balance.

Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-25 13:20:22 +00:00
Sped0n
73ee16c6fb ci: update bundled artifacts [skip ci] 2025-11-25 13:14:31 +00:00
Sped0n
91b0314c5d ci(vercel): fix vercel preview
Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-25 21:13:53 +08:00
Sped0n
d1a1dba210 feat(gallery): enhance close button accessibility
Add .navClose styles for 30% min-width, right alignment, and pointer cursor.
Apply class to close div in mobile gallery nav for consistent keyboard support.

Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-25 21:13:53 +08:00
Sped0n
110ff665e7 fix(gallery): add overflow hidden to prevent scrolling
Ensure the fixed gallery modal doesn't allow overflow beyond viewport.

Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-25 21:13:53 +08:00
Ryan
b39d563e77 chore: remove dummy bundled/js/critical.js (#533)
Update .gitignore to reflect the correct path before deletion.

Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-25 12:07:21 +00:00
Sped0n
0e74655820 ci: update bundled artifacts [skip ci] 2025-11-25 11:59:43 +00:00
Sped0n
8926caed69 ci(build): add labels to Hugo matrix for better job names
Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-25 19:59:06 +08:00
Sped0n
19f54640f9 build(deps-dev): bump various dev dependencies
Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-25 19:59:06 +08:00
Sped0n
56b87d6393 fix(gallery): adjust image sizing to fit window height
Update gallery image styles to use max-height based on window minus nav,
max-width 100%, and auto width for proper scaling with contain fit.

Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-25 19:59:06 +08:00
dependabot[bot]
75d8310953 build(deps-dev): bump vite from 7.2.2 to 7.2.4
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.2.2 to 7.2.4.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v7.2.4/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 7.2.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-25 19:28:09 +08:00
dependabot[bot]
a9f164f2af build(deps-dev): bump @typescript-eslint/parser from 8.47.0 to 8.48.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.47.0 to 8.48.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.48.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-version: 8.48.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-25 19:26:57 +08:00
dependabot[bot]
7773f184aa build(deps-dev): bump typescript-eslint from 8.47.0 to 8.48.0
Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.47.0 to 8.48.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.48.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-version: 8.48.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-25 19:24:50 +08:00
dependabot[bot]
bc501934ae build(deps-dev): bump typescript-eslint from 8.46.4 to 8.47.0
Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.46.4 to 8.47.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.47.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-version: 8.47.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-20 17:56:48 +08:00
dependabot[bot]
44b619e49b build(deps-dev): bump @types/node from 24.10.0 to 24.10.1
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 24.10.0 to 24.10.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.10.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-20 17:55:45 +08:00
dependabot[bot]
024d013219 build(deps-dev): bump @typescript-eslint/parser from 8.46.4 to 8.47.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.46.4 to 8.47.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.47.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-version: 8.47.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-20 17:53:41 +08:00
Sped0n
268159e7d2 refactor: unify bundled assets with subdirs and Hugo mounts
Move bundled outputs to dedicated css/js subdirs. Update Vite
config to output directly to bundled/ with simplified naming.
Add Hugo module mounts to expose as assets/bundled and
static/bundled. Adjust gitignore and partial accordingly.

Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-14 18:15:24 +08:00
Sped0n
2e7131a5a5 ci: update bundled artifacts [skip ci] 2025-11-12 09:15:02 +00:00
Sped0n
1de3926c49 docs: correct Solid.js to SolidJS in theme description
Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-12 17:14:20 +08:00
Sped0n
4b1f529589 refactor: migrate to vite for critical scss bundling, remove dart sass dependency
Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-12 17:14:20 +08:00
Sped0n
8b3b5cd77a fix: use absolute URL for fw font in scss
Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-12 17:14:20 +08:00
Sped0n
3a0025ebd1 docs: update documentations
Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-12 05:41:50 +08:00
Sped0n
283f386371 refactor: remove redundant ESLint config import
Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-12 05:15:58 +08:00
Sped0n
4c91cd269e refactor: upgrade to pnpm 10 and update docs
Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-12 05:15:58 +08:00
Sped0n
304abf3b65 refactor: switch to sass-embedded and remove manual install
Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-12 05:15:58 +08:00
Sped0n
99a2866d4a docs: update README.md
Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-12 03:25:59 +08:00
28 changed files with 3052 additions and 2447 deletions

View File

@@ -24,23 +24,30 @@ jobs:
- name: Get changed files in scope - name: Get changed files in scope
id: changed-files-specific id: changed-files-specific
uses: tj-actions/changed-files@v46 uses: tj-actions/changed-files@v47
with: with:
files: | files: |
package.json package.json
pnpm-lock.yaml
tsconfig.json
vite.config.ts
assets/** assets/**
build: build:
timeout-minutes: 30 timeout-minutes: 30
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Build (Hugo ${{ matrix.hugo-version }}) name: Build (Hugo ${{ matrix.hugo-label }})
needs: [filter] needs: [filter]
if: | if: |
github.ref == 'refs/heads/main' &&
github.event.repository.fork == false github.event.repository.fork == false
strategy: strategy:
matrix: matrix:
hugo-version: ['latest', '0.114.0'] hugo-version: ['latest', '0.114.0']
include:
- hugo-version: latest
hugo-label: Latest
- hugo-version: '0.114.0'
hugo-label: 'v0.114.0'
steps: steps:
- name: Set current date as env variable - name: Set current date as env variable
run: | run: |
@@ -58,13 +65,10 @@ jobs:
hugo-version: ${{ matrix.hugo-version }} hugo-version: ${{ matrix.hugo-version }}
extended: true extended: true
- name: Setup Dart Sass
run: sudo snap install dart-sass
- name: Setup pnpm - name: Setup pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v3
with: with:
version: 8 version: 10
- name: Get pnpm store directory - name: Get pnpm store directory
id: pnpm-cache id: pnpm-cache
@@ -91,8 +95,7 @@ jobs:
- name: Build - name: Build
run: | run: |
pnpm run vite:build pnpm run build
hugo --logLevel info --source=exampleSite --gc --minify
- name: Push artifacts - name: Push artifacts
if: > if: >

View File

@@ -24,7 +24,7 @@ jobs:
- name: Setup pnpm - name: Setup pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v3
with: with:
version: 8 version: 10
- name: Get pnpm store directory - name: Get pnpm store directory
id: pnpm-cache id: pnpm-cache
@@ -34,7 +34,7 @@ jobs:
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('./pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store- restore-keys: ${{ runner.os }}-pnpm-store-
- name: Install dependencies - name: Install dependencies

5
.gitignore vendored
View File

@@ -1,6 +1,6 @@
# Hugo default output directory # Hugo default output directory
public/ public/
/exampleSite/resources/ exampleSite/resources/
node_modules/ node_modules/
build/ build/
@@ -25,3 +25,6 @@ jsconfig.json
# css map # css map
*.css.map *.css.map
# dummmy file
bundled/js/critical.js

View File

@@ -1,5 +1,6 @@
node_modules node_modules/
static static/
exmapleSite exmapleSite/
single.json single.json
pnpm-lock.yaml pnpm-lock.yaml
bundled/

View File

@@ -2,7 +2,7 @@
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/Sped0n/bridget/build.yml?logo=github) ![GitHub deployments](https://img.shields.io/github/deployments/Sped0n/bridget/Production?logo=vercel&label=deploy) ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/Sped0n/bridget/build.yml?logo=github) ![GitHub deployments](https://img.shields.io/github/deployments/Sped0n/bridget/Production?logo=vercel&label=deploy)
Bridget is a minimal [Hugo](https://gohugo.io) theme for photographers/visual artists, powered by [Solid.js](https://www.solidjs.com). Based on the https://github.com/tylermcrobert/bridget-pictures-www. Bridget is a minimal [Hugo](https://gohugo.io) theme for photographers/visual artists, based on https://github.com/tylermcrobert/bridget-pictures-www.
Here is a [live demo](https://bridget-demo.sped0n.com). Here is a [live demo](https://bridget-demo.sped0n.com).

View File

@@ -1,9 +1,10 @@
@font-face { @font-face {
font-family: 'Geist'; font-family: 'Geist';
src: src:
url('{{- "lib/fonts/GeistVF.woff2" | absURL -}}') url(/* @vite-ignore */'{{- "lib/fonts/GeistVF.woff2" | absURL -}}')
format('woff2 supports variations'), format('woff2 supports variations'),
url('{{- "lib/fonts/GeistVF.woff2" | absURL -}}') format('woff2-variations'); url(/* @vite-ignore */'{{- "lib/fonts/GeistVF.woff2" | absURL -}}')
format('woff2-variations');
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
font-display: swap; font-display: swap;
@@ -11,7 +12,7 @@
@font-face { @font-face {
font-family: 'FW'; font-family: 'FW';
src: url('/lib/fonts/fw.woff2') format('woff2'); src: url(/* @vite-ignore */'{{- "lib/fonts/fw.woff2" | absURL -}}') format('woff2');
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
font-display: swap; font-display: swap;

View File

@@ -4,6 +4,7 @@
position: fixed; position: fixed;
top: var(--nav-height); top: var(--nav-height);
z-index: var(--z-nav-gallery); z-index: var(--z-nav-gallery);
overflow: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -25,8 +26,9 @@
} }
img { img {
width: 100%; max-height: calc(var(--window-height) - 2 * var(--nav-height));
height: 100%; max-width: 100%;
width: auto;
object-fit: contain; object-fit: contain;
} }
@@ -49,6 +51,12 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.navClose {
min-width: 25%;
text-align: right;
cursor: pointer;
}
} }
} }

2
assets/ts/critical.ts Normal file
View File

@@ -0,0 +1,2 @@
// this is a dummy file to trick vite to generate a critical.css file
import '../scss/critical.scss'

View File

@@ -37,7 +37,7 @@ export default function GalleryNav(props: {
<span class="num">{indexLength()[2]}</span> <span class="num">{indexLength()[2]}</span>
<span class="num">{indexLength()[3]}</span> <span class="num">{indexLength()[3]}</span>
</div> </div>
<div onClick={onClick} onKeyDown={onClick}> <div class="navClose" onClick={onClick} onKeyDown={onClick}>
{capitalizeFirstLetter(props.closeText)} {capitalizeFirstLetter(props.closeText)}
</div> </div>
</div> </div>

1
bundled/css/critical.css Normal file
View File

@@ -0,0 +1 @@
*:where(:not(html,iframe,canvas,img,svg,video,audio):not(svg *,symbol *)){all:unset;display:revert}*,*:before,*:after{box-sizing:border-box}html{-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none}a,button{cursor:revert}ol,ul,menu,summary{list-style:none}img{max-inline-size:100%;max-block-size:100%}table{border-collapse:collapse}input,textarea{-webkit-user-select:auto}textarea{white-space:revert}meter{-webkit-appearance:revert;appearance:revert}:where(pre){all:revert;box-sizing:border-box}::placeholder{color:unset}:where([hidden]){display:none}:where([contenteditable]:not([contenteditable=false])){-moz-user-modify:read-write;-webkit-user-modify:read-write;overflow-wrap:break-word;-webkit-line-break:after-white-space;-webkit-user-select:auto}:where([draggable=true]){-webkit-user-drag:element}:where(dialog:modal){all:revert;box-sizing:border-box}@font-face{font-family:Geist;src:url('{{- "lib/fonts/GeistVF.woff2" | absURL -}}') format("woff2 supports variations"),url('{{- "lib/fonts/GeistVF.woff2" | absURL -}}') format("woff2-variations");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:FW;src:url('{{- "lib/fonts/fw.woff2" | absURL -}}') format("woff2");font-weight:400;font-style:normal;font-display:swap}body{line-height:1.2;font-size:16px;font-family:Geist,sans-serif}body button{font-family:FW,sans-serif}@media(min-width:768px){body{font-size:18px}}@media(min-width:1024px){body{font-size:19px}}:root{--window-height: 100vh;--nav-height: 2rem;--space-standard: .625rem;--z-curtain: 200;--z-nav-gallery: 500;--z-cursor: 600;--z-nav: 800}*{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{-webkit-user-select:none;user-select:none;background:#fff}html,body{overscroll-behavior-y:none}a,button{cursor:pointer}nav{display:flex;justify-content:space-between;align-items:center;width:100%;height:var(--nav-height);padding:0 var(--space-standard);position:fixed;bottom:0;background:#fff;z-index:var(--z-nav);pointer-events:all}.num{width:.625em;display:inline-block;text-align:center}.current{font-style:italic;text-decoration:underline}@media(max-width:767px),(hover:none){nav{top:0}.index,.threshold{display:none}}article{padding:var(--space-standard);max-width:25em}article p{margin-bottom:1em}article u{text-decoration:underline}article>h1{font-size:1.6em}article>h2{font-size:1.5em}article>h3{font-size:1.375em}article>h4{font-size:1.25em}article>h5{font-size:1.125em}article h1,article h2,article h3,article h4,article h5,article h6{font-weight:700;margin:1.2rem 0}@media(max-width:767px),(hover:none){article{margin-top:var(--nav-height)}}@media(max-width:767px),(hover:none){.container{position:fixed;top:0;z-index:0;width:100vw;height:var(--window-height);overflow-y:scroll;overflow-x:hidden;background:#fff;overscroll-behavior:none;-webkit-overflow-scrolling:none}.disableScroll{pointer-events:none}}

1
bundled/css/main.css Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

32
docs.md
View File

@@ -15,6 +15,7 @@
- [`outputs.toml`](#outputstoml) - [`outputs.toml`](#outputstoml)
- [`params.toml`](#paramstoml) - [`params.toml`](#paramstoml)
- [`sitemap.toml`](#sitemaptoml) - [`sitemap.toml`](#sitemaptoml)
- [Usage](#usage)
- [Customizations](#customizations) - [Customizations](#customizations)
- [Change Font](#change-font) - [Change Font](#change-font)
- [Add a Custom Analytic Script](#add-a-custom-analytic-script) - [Add a Custom Analytic Script](#add-a-custom-analytic-script)
@@ -25,24 +26,19 @@
_[Contents](#contents)_ _[Contents](#contents)_
- Hugo (extended), minimum required version can be seen in the [`theme.toml`](https://github.com/Sped0n/bridget/blob/main/theme.toml#L19) - [Hugo (extended)](https://gohugo.io/installation/), minimum required version can be seen in the [`theme.toml`](https://github.com/Sped0n/bridget/blob/main/theme.toml#L19)
```bash ```bash
hugo version hugo version
hugo v0.152.2+extended+withdeploy darwin/arm64 BuildDate=unknown VendorInfo=nixpkgs hugo v0.152.2+extended+withdeploy darwin/arm64 BuildDate=unknown VendorInfo=nixpkgs
``` ```
- [Dart Sass](https://gohugo.io/functions/css/sass/#dart-sass) (**DO NOT INSTALL IT FROM NPM**, since it is doesn't support `--embedded`) - [pnpm](https://pnpm.io/installation) and [Node.js](https://nodejs.org/en/download), please note that these two are only needed for customizations or development.
```bash ```bash
sass --embedded --version pnpm --version && node --version
{ 10.20.0
"protocolVersion": "2.4.0", v22.20.0
"compilerVersion": "1.70.0",
"implementationVersion": "1.70.0",
"implementationName": "dart-sass",
"id": 0
}
``` ```
## Installation ## Installation
@@ -260,6 +256,14 @@ _[Contents](#contents)_
https://gohugo.io/templates/sitemap-template/#configuration https://gohugo.io/templates/sitemap-template/#configuration
## Usage
_[Contents](#contents)_
Bridget will work as a normal Hugo theme (if you don't have needs to customize), https://gohugo.io/getting-started/usage/ is a great start.
For further reading, you can refer to the `scripts` field of `package.json`.
## Customizations ## Customizations
_[Contents](#contents)_ _[Contents](#contents)_
@@ -267,9 +271,11 @@ _[Contents](#contents)_
> [!IMPORTANT] > [!IMPORTANT]
> Please make sure you have [installation with Git](#git-repository-for-customizations). > Please make sure you have [installation with Git](#git-repository-for-customizations).
> >
> - Use `pnpm install` to install neceessary dependencies. > If you want to try some changes on the `exampleSite`, below are some commands you might need:
> - Use `pnpm run dev` to start a dev server (`http://localhost:1313`). >
> - When youre ready, run `pnpm run build` to update artifacts. > - `pnpm install` to install dependencies.
> - `pnpm run dev` to start a dev server (`http://localhost:1313`).
> - `pnpm run build` to update artifacts.
### Change Font ### Change Font

View File

@@ -1,4 +1,4 @@
import { default as eslint, default as js } from '@eslint/js' import js from '@eslint/js'
import tsParser from '@typescript-eslint/parser' import tsParser from '@typescript-eslint/parser'
import love from 'eslint-config-love' import love from 'eslint-config-love'
import importPlugin from 'eslint-plugin-import' import importPlugin from 'eslint-plugin-import'
@@ -9,11 +9,10 @@ import tseslint from 'typescript-eslint'
export default defineConfig([ export default defineConfig([
js.configs.recommended, js.configs.recommended,
eslint.configs.recommended,
tseslint.configs.recommended, tseslint.configs.recommended,
importPlugin.flatConfigs.recommended, importPlugin.flatConfigs.recommended,
solid, solid,
globalIgnores(['**/node_modules', '**/static', '**/exampleSite', '*.mjs']), globalIgnores(['node_modules/', 'static/', 'exampleSite/', '*.mjs', 'bundled/']),
{ {
...love, ...love,
...prettier, ...prettier,

View File

@@ -13,4 +13,4 @@ enableRobotsTXT = true
[module] [module]
replacements = "github.com/Sped0n/bridget/v2 -> ../.." # deploy with local dir (relative to hugo site theme dir) WARN: delete this line if you want to deploy with git replacements = "github.com/Sped0n/bridget/v2 -> ../.." # deploy with local dir (relative to hugo site theme dir) WARN: delete this line if you want to deploy with git
[[module.imports]] [[module.imports]]
path = "github.com/Sped0n/bridget/v2" # deploy with git (recommended) WARN: you should also set `bundled` to true in params.toml !!! path = "github.com/Sped0n/bridget/v2" # deploy with git (recommended)

View File

@@ -12,7 +12,7 @@ build:
publishResources: false publishResources: false
--- ---
Bridget is a _minimal_ Hugo theme designed for photographers/visual artists, powered by <u>[Solid.js](https://www.solidjs.com)</u>. Bridget is a _minimal_ Hugo theme designed for photographers/visual artists, powered by <u>[SolidJS](https://www.solidjs.com)</u>.
The inspiration for this theme came from a video by <u>[Hyperlexed](https://www.youtube.com/@Hyperplexed)</u>, which can be found <u>[here](https://www.youtube.com/watch?v=Jt3A2lNN2aE)</u>. Initially, it was developed using no third-party dependencies. However, after website designer <u>[Tyler McRobert](https://tylermcrobert.com)</u> made the source code publicly available, I realized that I have invented many unnecessary wheels, and this project was modified to porting the original design to Hugo while focusing on _performance_. The inspiration for this theme came from a video by <u>[Hyperlexed](https://www.youtube.com/@Hyperplexed)</u>, which can be found <u>[here](https://www.youtube.com/watch?v=Jt3A2lNN2aE)</u>. Initially, it was developed using no third-party dependencies. However, after website designer <u>[Tyler McRobert](https://tylermcrobert.com)</u> made the source code publicly available, I realized that I have invented many unnecessary wheels, and this project was modified to porting the original design to Hugo while focusing on _performance_.

View File

@@ -27,7 +27,6 @@
packages = with pkgs; [ packages = with pkgs; [
nodejs nodejs
nodePackages.pnpm nodePackages.pnpm
dart-sass
hugo hugo
go go
]; ];

18
hugo.toml Normal file
View File

@@ -0,0 +1,18 @@
[[module.mounts]]
source = 'archetypes'
target = 'archetypes'
[[module.mounts]]
source = 'assets'
target = 'assets'
[[module.mounts]]
source = 'layouts'
target = 'layouts'
[[module.mounts]]
source = 'static'
target = 'static'
[[module.mounts]]
source = "bundled"
target = "assets/bundled"
[[module.mounts]]
source = "bundled"
target = "static/bundled"

View File

@@ -2,8 +2,8 @@
{{- $fingerprint := .Scratch.Get "fingerprint" | default "" -}} {{- $fingerprint := .Scratch.Get "fingerprint" | default "" -}}
{{- /* critical style */ -}} {{- /* critical style */ -}}
{{- $style := dict "Source" "scss/critical.scss" "Fingerprint" $fingerprint -}} {{- $style := dict "Source" "bundled/css/critical.css" "Fingerprint" $fingerprint -}}
{{- $options := dict "enableSourceMap" true "includePaths" (slice "node_modules") "transpiler" "dartsass" -}} {{- $options := dict "enableSourceMap" false -}}
{{- $style = dict "Context" . "ToCSS" $options "Inline" true "Template" true | merge $style -}} {{- $style = dict "Context" . "ToCSS" $options "Inline" true "Template" true | merge $style -}}
{{- partial "plugin/style.html" $style -}} {{- partial "plugin/style.html" $style -}}

View File

@@ -3,7 +3,7 @@
"version": "v1.0.0", "version": "v1.0.0",
"type": "module", "type": "module",
"description": "bridget theme source file", "description": "bridget theme source file",
"packageManager": "pnpm@8.10.2", "packageManager": "pnpm@10.20.0",
"private": true, "private": true,
"sideEffects": false, "sideEffects": false,
"scripts": { "scripts": {
@@ -39,9 +39,9 @@
}, },
"homepage": "https://github.com/Sped0n/bridget#readme", "homepage": "https://github.com/Sped0n/bridget#readme",
"devDependencies": { "devDependencies": {
"@types/node": "^24.10.0", "@eslint/js": "^9.39.1",
"@typescript-eslint/eslint-plugin": "^8.46.4", "@types/node": "^24.10.1",
"@typescript-eslint/parser": "^8.46.4", "@typescript-eslint/parser": "^8.48.0",
"eslint": "^9.39.1", "eslint": "^9.39.1",
"eslint-config-love": "^133.0.0", "eslint-config-love": "^133.0.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
@@ -53,9 +53,10 @@
"prettier": "3.6.2", "prettier": "3.6.2",
"prettier-plugin-go-template": "^0.0.15", "prettier-plugin-go-template": "^0.0.15",
"prettier-plugin-organize-imports": "^4.3.0", "prettier-plugin-organize-imports": "^4.3.0",
"sass": "^1.94.0", "sass-embedded": "^1.93.3",
"typescript": "^5.9.3", "typescript": "^5.9.3",
"vite": "^7.2.2", "typescript-eslint": "^8.48.0",
"vite": "^7.2.4",
"vite-plugin-solid": "^2.11.10" "vite-plugin-solid": "^2.11.10"
}, },
"dependencies": { "dependencies": {

5215
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,22 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
node_modules_generated_dir="./node_modules/exampleSite/resources/_gen" node_modules_generated_dir="./node_modules/exampleSite/resources/_gen/images"
project_generated_dir="./exampleSite/resources/_gen" project_generated_dir="./exampleSite/resources/_gen/images"
dart_sass_version="1.93.3"
dart_sass_install_dir="${HOME}/.local/dart-sass"
dart_sass_tarball="dart-sass-${dart_sass_version}-linux-x64.tar.gz"
dart_sass_download_url="https://github.com/sass/dart-sass/releases/download/${dart_sass_version}/${dart_sass_tarball}"
install_dart_sass() {
echo "Installing Dart Sass ${dart_sass_version}..."
mkdir -p "${HOME}/.local"
curl -sSLO "${dart_sass_download_url}"
rm -rf "${dart_sass_install_dir}"
tar -C "${HOME}/.local" -xf "${dart_sass_tarball}"
rm -f "${dart_sass_tarball}"
export PATH="${dart_sass_install_dir}:${PATH}"
}
copy_generated_assets_to_project() { copy_generated_assets_to_project() {
if [ -d "${node_modules_generated_dir}" ]; then if [ -d "${node_modules_generated_dir}" ]; then
@@ -30,7 +16,8 @@ copy_generated_assets_to_project() {
} }
run_site_build() { run_site_build() {
pnpm run vite:build && hugo --logLevel info --source=exampleSite --gc --minify rm -rf bundled
pnpm run build
} }
copy_generated_assets_to_node_modules() { copy_generated_assets_to_node_modules() {
@@ -44,7 +31,6 @@ copy_generated_assets_to_node_modules() {
fi fi
} }
install_dart_sass
copy_generated_assets_to_project copy_generated_assets_to_project
run_site_build run_site_build
copy_generated_assets_to_node_modules copy_generated_assets_to_node_modules

View File

@@ -4,14 +4,17 @@ import solidPlugin from 'vite-plugin-solid'
export default defineConfig({ export default defineConfig({
plugins: [solidPlugin()], plugins: [solidPlugin()],
build: { build: {
outDir: './static/bundled', outDir: './bundled',
watch: process.env.DISABLE_WATCH watch: process.env.DISABLE_WATCH
? null ? null
: { : {
include: 'assets/**' include: 'assets/**'
}, },
rollupOptions: { rollupOptions: {
input: './assets/ts/main.tsx', input: {
main: './assets/ts/main.tsx',
critical: './assets/ts/critical.ts'
},
output: { output: {
format: 'es', format: 'es',
entryFileNames: 'js/[name].js', entryFileNames: 'js/[name].js',
@@ -20,5 +23,12 @@ export default defineConfig({
compact: true compact: true
} }
} }
},
css: {
preprocessorOptions: {
scss: {
loadPaths: ['./assets/scss']
}
}
} }
}) })