mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-15 10:39:30 -07:00
Compare commits
115 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
268159e7d2 | ||
|
|
2e7131a5a5 | ||
|
|
1de3926c49 | ||
|
|
4b1f529589 | ||
|
|
8b3b5cd77a | ||
|
|
3a0025ebd1 | ||
|
|
283f386371 | ||
|
|
4c91cd269e | ||
|
|
304abf3b65 | ||
|
|
99a2866d4a | ||
|
|
ba46f52d55 | ||
|
|
48eaa9d95b | ||
|
|
6be1a924de | ||
|
|
ba0def753e | ||
|
|
c9410c9644 | ||
|
|
1d1f893c92 | ||
|
|
7d4bed3ba6 | ||
|
|
72b830def9 | ||
|
|
6b2c1de9d8 | ||
|
|
ae899035ae | ||
|
|
36721f8bf6 | ||
|
|
2dcbb5e5d5 | ||
|
|
07aa48f2db | ||
|
|
099513500c | ||
|
|
f0da771dca | ||
|
|
dfd4abdf2a | ||
|
|
6f8ce6bbd8 | ||
|
|
543a08d472 | ||
|
|
05599ef190 | ||
|
|
95bd4d1c28 | ||
|
|
835cd6f343 | ||
|
|
479164bc83 | ||
|
|
9ea37b8a3f | ||
|
|
5df519e55f | ||
|
|
860428d03b | ||
|
|
c1ad92fbeb | ||
|
|
78f657618e | ||
|
|
1fe7095898 | ||
|
|
0471af5085 | ||
|
|
543d630535 | ||
|
|
b7ed5a2834 | ||
|
|
5ba7d77c07 | ||
|
|
af82026d1a | ||
|
|
b5ef661e1c | ||
|
|
883eec1a3b | ||
|
|
b027cd03cf | ||
|
|
aa34979bb4 | ||
|
|
08bbfaa3ba | ||
|
|
b8c6ce2b04 | ||
|
|
27083c0336 | ||
|
|
082458b2aa | ||
|
|
1c05eb2633 | ||
|
|
9016cfb035 | ||
|
|
d9b4100d17 | ||
|
|
082f5f4961 | ||
|
|
9d91becbd5 | ||
|
|
2e51b7eb89 | ||
|
|
7dd8c2242c | ||
|
|
2a10e4944e | ||
|
|
7893586d24 | ||
|
|
5a51f83654 | ||
|
|
e4d5ac4389 | ||
|
|
ea3d58760b | ||
|
|
4812cdb191 | ||
|
|
b93b8d3ac6 | ||
|
|
a7bc6b2df5 | ||
|
|
1cfbc8ac28 | ||
|
|
c4cea2648e | ||
|
|
26bdddc5ff | ||
|
|
437bbf17e0 | ||
|
|
2a715327f6 | ||
|
|
c111de15b1 | ||
|
|
1b9826f582 | ||
|
|
6a3ce498a9 | ||
|
|
8d48e6347e | ||
|
|
4599a5dfc2 | ||
|
|
7536288baa | ||
|
|
e12c32388b | ||
|
|
4198a5fa90 | ||
|
|
089e9b285a | ||
|
|
60e19fed00 | ||
|
|
626433e67d | ||
|
|
cb5080ce41 | ||
|
|
e2f8317669 | ||
|
|
5d9e32f62b | ||
|
|
b96ecd6042 | ||
|
|
5b7ec62106 | ||
|
|
3ca4a0d803 | ||
|
|
a8d8802d9f | ||
|
|
28782217f1 | ||
|
|
cfcda29524 | ||
|
|
fb498971c7 | ||
|
|
9dbb3cb624 | ||
|
|
129f26dd54 | ||
|
|
d1f9b843c3 | ||
|
|
a7b5ec45ed | ||
|
|
5d82276734 | ||
|
|
b0c4fa8ea7 | ||
|
|
a6f983de5d | ||
|
|
3bc232638a | ||
|
|
67944df12f | ||
|
|
e82fe6cab2 | ||
|
|
819df6b2ed | ||
|
|
dfef87ca55 | ||
|
|
477b6d748a | ||
|
|
31a59c5e9e | ||
|
|
e8cdd12151 | ||
|
|
a8bc17ca12 | ||
|
|
4d04fe1945 | ||
|
|
bafd2aa3b3 | ||
|
|
acf50d10d7 | ||
|
|
30a6a3bd23 | ||
|
|
d808782afd | ||
|
|
5327d7c585 | ||
|
|
d7e7fc68ba |
@@ -1,3 +0,0 @@
|
||||
node_modules
|
||||
static
|
||||
exampleSite
|
||||
@@ -1,64 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true
|
||||
},
|
||||
"extends": [
|
||||
"standard-with-typescript",
|
||||
"prettier",
|
||||
"eslint:recommended",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:solid/typescript"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": ["prettier", "@typescript-eslint", "solid"],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"project": "./tsconfig.json",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"prettier/prettier": "error",
|
||||
"arrow-body-style": "off",
|
||||
"prefer-arrow-callback": "off",
|
||||
"import/no-cycle": "error",
|
||||
"sort-imports": [
|
||||
"error",
|
||||
{
|
||||
"ignoreCase": false,
|
||||
"ignoreDeclarationSort": true,
|
||||
"ignoreMemberSort": true,
|
||||
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
|
||||
"allowSeparatedGroups": true
|
||||
}
|
||||
],
|
||||
"import/no-unresolved": "error",
|
||||
"import/order": [
|
||||
"error",
|
||||
{
|
||||
"groups": [
|
||||
"builtin",
|
||||
"external",
|
||||
"internal",
|
||||
"parent",
|
||||
"sibling",
|
||||
"index",
|
||||
"unknown"
|
||||
],
|
||||
"newlines-between": "always",
|
||||
"alphabetize": {
|
||||
"order": "asc",
|
||||
"caseInsensitive": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"import/resolver": {
|
||||
"typescript": {
|
||||
"project": "./tsconfig.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
33
.github/workflows/build.yml
vendored
33
.github/workflows/build.yml
vendored
@@ -24,20 +24,25 @@ jobs:
|
||||
|
||||
- name: Get changed files in scope
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v41
|
||||
uses: tj-actions/changed-files@v47
|
||||
with:
|
||||
files: |
|
||||
package.json
|
||||
pnpm-lock.yaml
|
||||
tsconfig.json
|
||||
vite.config.ts
|
||||
assets/**
|
||||
|
||||
build:
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-latest
|
||||
name: Build
|
||||
name: Build (Hugo ${{ matrix.hugo-version }})
|
||||
needs: [filter]
|
||||
if: |
|
||||
github.ref == 'refs/heads/main' &&
|
||||
github.event.repository.fork == false
|
||||
strategy:
|
||||
matrix:
|
||||
hugo-version: ['latest', '0.114.0']
|
||||
steps:
|
||||
- name: Set current date as env variable
|
||||
run: |
|
||||
@@ -52,13 +57,13 @@ jobs:
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2.6.0
|
||||
with:
|
||||
hugo-version: '0.114.0'
|
||||
hugo-version: ${{ matrix.hugo-version }}
|
||||
extended: true
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v3
|
||||
with:
|
||||
version: 8
|
||||
version: 10
|
||||
|
||||
- name: Get pnpm store directory
|
||||
id: pnpm-cache
|
||||
@@ -68,24 +73,30 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: ${{ runner.os }}-pnpm-store-
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('./pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Setup hugo cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./exampleSite/resources
|
||||
key: ${{ runner.os }}-hugo-${{ hashFiles('./exampleSite/resources') }}
|
||||
restore-keys: ${{ runner.os }}-hugo-
|
||||
key: ${{ runner.os }}-hugo-${{ matrix.hugo-version }}-${{ hashFiles('./exampleSite') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-hugo-${{ matrix.hugo-version }}-
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Build
|
||||
run: pnpm run build
|
||||
run: |
|
||||
pnpm run build
|
||||
|
||||
- name: Push artifacts
|
||||
if: ${{ (github.event_name == 'push' || github.event.pull_request.merged == true) && needs.filter.outputs.any_changed == 'true' }}
|
||||
if: >
|
||||
matrix.hugo-version == 'latest' &&
|
||||
(github.event_name == 'push' || github.event.pull_request.merged == true) &&
|
||||
needs.filter.outputs.any_changed == 'true'
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: 'ci: update bundled artifacts [skip ci]'
|
||||
|
||||
8
.github/workflows/eslint.yml
vendored
8
.github/workflows/eslint.yml
vendored
@@ -19,12 +19,12 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.PAT }}
|
||||
token: ${{ secrets.PAT || github.token }}
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v3
|
||||
with:
|
||||
version: 8
|
||||
version: 10
|
||||
|
||||
- name: Get pnpm store directory
|
||||
id: pnpm-cache
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
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-
|
||||
|
||||
- name: Install dependencies
|
||||
@@ -54,4 +54,4 @@ jobs:
|
||||
if: ${{ steps.format.outcome == 'success' }}
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: 'ci: format code'
|
||||
commit_message: 'ci: format code [skip ci]'
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,6 +1,6 @@
|
||||
# Hugo default output directory
|
||||
public/
|
||||
/exampleSite/resources/
|
||||
exampleSite/resources/
|
||||
|
||||
node_modules/
|
||||
build/
|
||||
@@ -25,3 +25,6 @@ jsconfig.json
|
||||
|
||||
# css map
|
||||
*.css.map
|
||||
|
||||
# dummmy file
|
||||
bundled/css/critical.js
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
node_modules
|
||||
static
|
||||
exmapleSite
|
||||
node_modules/
|
||||
static/
|
||||
exmapleSite/
|
||||
single.json
|
||||
pnpm-lock.yaml
|
||||
bundled/
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"useTabs": false,
|
||||
"tabWidth": 2,
|
||||
"printWidth": 88,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"bracketSpacing": true,
|
||||
"semi": false,
|
||||
"plugins": ["prettier-plugin-go-template", "prettier-plugin-organize-imports"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"options": {
|
||||
"parser": "go-template"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -60,7 +60,7 @@ representative at an online or offline event.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
hi@sped0nwen.com.
|
||||
hi@sped0n.com.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
|
||||
42
README.md
42
README.md
@@ -2,44 +2,38 @@
|
||||
|
||||
 
|
||||
|
||||
Bridget is a minimal [Hugo](https://gohugo.io) theme for photographers/visual artists, powered by Solid.js.
|
||||
Bridget is a minimal [Hugo](https://gohugo.io) theme for photographers/visual artists, based on https://github.com/tylermcrobert/bridget-pictures-www.
|
||||
|
||||
Based on the https://github.com/tylermcrobert/bridget-pictures-www.
|
||||
Here is a [live demo](https://bridget-demo.sped0n.com).
|
||||
|
||||

|
||||

|
||||
|
||||
## [Demo Site](https://bridget-demo.sped0nwen.com)
|
||||
|
||||
To see this theme in action, here is a live [demo site](https://bridget-demo.sped0nwen.com) which is rendered with **Bridget** theme.
|
||||
> [!NOTE]
|
||||
> This repository is currently in **maintaince mode** for two reasons:
|
||||
>
|
||||
> 1. I want to keep this theme minimal.
|
||||
> 2. My bandwith after work is limited.
|
||||
>
|
||||
> BUT, bug fixes will be addressed (including related issues and PRs), and they are the **number one priority** for this project.
|
||||
>
|
||||
> Please understand that feature request might **NOT** be addressed or may take a long time to be implemented.
|
||||
>
|
||||
> Anyway, forks are welcomed, and I'm looking forward to seeing what you can do with the theme.
|
||||
|
||||
## Getting Started
|
||||
|
||||
Head to this [documentation](https://github.com/Sped0n/bridget/blob/main/doc/getStarted.md) for a complete guidance to get started with the Bridget theme.
|
||||
Head to this [documentation](https://github.com/Sped0n/bridget/blob/main/docs.md) for a complete guidance to get started with the theme.
|
||||
|
||||
## Features
|
||||
|
||||
- **Blazingly fast**: 100/100 on both desktop and mobile in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights)
|
||||
- Powered by **[Solid.js](https://www.solidjs.com)**, a declarative, efficient, and flexible JavaScript library for building user interfaces
|
||||
- JS **dynamic loading** (powered by ESM)
|
||||
- Image **Preloading**/**Lazy loading**
|
||||
- Powered by **[SolidJS](https://www.solidjs.com)**, a declarative, efficient, and flexible JavaScript library for building user interfaces
|
||||
- JS **dynamic loading**
|
||||
- Image **preloading** + **lazy loading**
|
||||
- **Dynamic resolution** based on view mode
|
||||
- Multiple **analytics** services supported
|
||||
- Search engine **verification** supported (Google, Bind, Yandex and Baidu)
|
||||
|
||||
## Multilingual and i18n
|
||||
|
||||
Bridget supports the following languages:
|
||||
|
||||
- English
|
||||
- Simplified Chinese
|
||||
- Traditional Chinese
|
||||
- Japanese
|
||||
- Korean
|
||||
- Deutsch
|
||||
- Spanish
|
||||
- Italian
|
||||
- [Contribute with a new language](https://github.com/Sped0n/bridget/pulls)
|
||||
|
||||
## Credits
|
||||
|
||||
- https://github.com/tylermcrobert/bridget-pictures-www
|
||||
|
||||
@@ -1,48 +1,10 @@
|
||||
@font-face {
|
||||
font-family: 'Geist';
|
||||
src:
|
||||
url('/lib/fonts/GeistVF.woff2') format('woff2 supports variations'),
|
||||
url('/lib/fonts/GeistVF.woff2') format('woff2-variations');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans CJK SC';
|
||||
src: url('/lib/fonts/NotoSansCJKsc-Regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans CJK TC';
|
||||
src: url('/lib/fonts/NotoSansCJKtc-Regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans CJK JP';
|
||||
src: url('/lib/fonts/NotoSansCJKjp-Regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans CJK KR';
|
||||
src: url('/lib/fonts/NotoSansCJKkr-Regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans';
|
||||
src: url('/lib/fonts/NotoSans-Regular.woff2') format('woff2');
|
||||
url(/* @vite-ignore */'{{- "lib/fonts/GeistVF.woff2" | absURL -}}')
|
||||
format('woff2 supports variations'),
|
||||
url(/* @vite-ignore */'{{- "lib/fonts/GeistVF.woff2" | absURL -}}')
|
||||
format('woff2-variations');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
@@ -50,7 +12,7 @@
|
||||
|
||||
@font-face {
|
||||
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-style: normal;
|
||||
font-display: swap;
|
||||
|
||||
4
assets/scss/_core/_foundation.scss
Normal file
4
assets/scss/_core/_foundation.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
@forward 'reset';
|
||||
@forward 'font';
|
||||
@forward 'typography';
|
||||
@forward 'mixins';
|
||||
@@ -1,3 +1,5 @@
|
||||
@use 'sass:map';
|
||||
|
||||
$breakpoints: (
|
||||
'mobile': 375px,
|
||||
'tablet': 768px,
|
||||
@@ -8,8 +10,8 @@ $breakpoints: (
|
||||
// Breakpoints
|
||||
|
||||
@mixin min-width($breakpoint) {
|
||||
@if map-has-key($breakpoints, $breakpoint) {
|
||||
@media (min-width: map-get($breakpoints, $breakpoint)) {
|
||||
@if map.has-key($breakpoints, $breakpoint) {
|
||||
@media (min-width: map.get($breakpoints, $breakpoint)) {
|
||||
@content;
|
||||
}
|
||||
} @else {
|
||||
@@ -18,8 +20,8 @@ $breakpoints: (
|
||||
}
|
||||
|
||||
@mixin max-width($breakpoint) {
|
||||
@if map-has-key($breakpoints, $breakpoint) {
|
||||
@media (max-width: (map-get($breakpoints, $breakpoint) - 1px)) {
|
||||
@if map.has-key($breakpoints, $breakpoint) {
|
||||
@media (max-width: (map.get($breakpoints, $breakpoint) - 1px)) {
|
||||
@content;
|
||||
}
|
||||
} @else {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
@import 'mixins';
|
||||
@use 'mixins' as *;
|
||||
|
||||
body {
|
||||
line-height: 1.2;
|
||||
font-size: 16px;
|
||||
font-family: sans-serif;
|
||||
font-family: 'Geist', sans-serif;
|
||||
|
||||
button {
|
||||
font-family: 'FW';
|
||||
font-family: 'FW', sans-serif;
|
||||
}
|
||||
|
||||
@include min-width('tablet') {
|
||||
@@ -16,51 +16,3 @@ body {
|
||||
font-size: 19px;
|
||||
}
|
||||
}
|
||||
|
||||
body:lang(en) {
|
||||
font-family: 'Geist', sans-serif;
|
||||
}
|
||||
|
||||
body:lang(de) {
|
||||
font-family: 'Geist', sans-serif;
|
||||
}
|
||||
|
||||
body:lang(es) {
|
||||
font-family: 'Geist', sans-serif;
|
||||
}
|
||||
|
||||
body:lang(fr) {
|
||||
font-family: 'Geist', sans-serif;
|
||||
}
|
||||
|
||||
body:lang(it) {
|
||||
font-family: 'Geist', sans-serif;
|
||||
}
|
||||
|
||||
body:lang(zh-cn) {
|
||||
font-family: 'Noto Sans', 'Noto Sans CJK SC', sans-serif;
|
||||
}
|
||||
|
||||
body:lang(zh-sg) {
|
||||
font-family: 'Noto Sans', 'Noto Sans CJK SC', sans-serif;
|
||||
}
|
||||
|
||||
body:lang(zh-hk) {
|
||||
font-family: 'Noto Sans', 'Noto Sans CJK TC', sans-serif;
|
||||
}
|
||||
|
||||
body:lang(zh-mo) {
|
||||
font-family: 'Noto Sans', 'Noto Sans CJK TC', sans-serif;
|
||||
}
|
||||
|
||||
body:lang(zh-tw) {
|
||||
font-family: 'Noto Sans', 'Noto Sans CJK TC', sans-serif;
|
||||
}
|
||||
|
||||
body:lang(ja) {
|
||||
font-family: 'Noto Sans', 'Noto Sans CJK JP', sans-serif;
|
||||
}
|
||||
|
||||
body:lang(ko) {
|
||||
font-family: 'Noto Sans', 'Noto Sans CJK KR', sans-serif;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
@use 'sass:map';
|
||||
|
||||
@use '_core/mixins' as *;
|
||||
|
||||
$tablet: map.get($breakpoints, 'tablet') - 1;
|
||||
|
||||
article {
|
||||
padding: var(--space-standard);
|
||||
max-width: 25em;
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
flex-direction: column;
|
||||
gap: 20vh;
|
||||
|
||||
padding-top: 50vh;
|
||||
padding-top: calc(var(--window-height) * 0.4);
|
||||
margin-top: calc(var(--nav-height) * -1);
|
||||
|
||||
img {
|
||||
position: sticky;
|
||||
top: 50vh;
|
||||
top: calc(var(--window-height) * 0.4);
|
||||
|
||||
width: 60vw;
|
||||
height: 20vh;
|
||||
@@ -19,7 +19,7 @@
|
||||
align-self: center;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 20vh;
|
||||
margin-bottom: calc(var(--window-height) * 0.35);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
$tablet: map-get($breakpoints, 'tablet') - 1;
|
||||
@use 'sass:map';
|
||||
|
||||
@use '_core/mixins' as *;
|
||||
|
||||
$tablet: map.get($breakpoints, 'tablet') - 1;
|
||||
|
||||
@media (max-width: $tablet), (hover: none) {
|
||||
.container {
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
$tablet: map-get($breakpoints, 'tablet') - 1;
|
||||
@use 'sass:map';
|
||||
|
||||
@use '_core/mixins' as *;
|
||||
|
||||
$tablet: map.get($breakpoints, 'tablet') - 1;
|
||||
|
||||
nav {
|
||||
display: flex;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@import '_core/mixins';
|
||||
|
||||
:root {
|
||||
--window-height: 100vh;
|
||||
--nav-height: 2rem;
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
@charset "utf-8";
|
||||
|
||||
@import '_core/reset';
|
||||
@import '_core/font';
|
||||
@import '_core/typography';
|
||||
@import '_core/mixins';
|
||||
@import '_variables';
|
||||
@import '_core/base';
|
||||
@use '_core/foundation';
|
||||
@use '_variables';
|
||||
@use '_core/base';
|
||||
|
||||
@import '_partial/nav';
|
||||
@import '_partial/article';
|
||||
@import '_partial/container';
|
||||
@use '_partial/nav';
|
||||
@use '_partial/article';
|
||||
@use '_partial/container';
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
@charset "utf-8";
|
||||
|
||||
@import '_partial/customCursor';
|
||||
@import '_partial/stage';
|
||||
@import '_partial/stageNav';
|
||||
@use '_partial/customCursor';
|
||||
@use '_partial/stage';
|
||||
@use '_partial/stageNav';
|
||||
@use '_partial/collection';
|
||||
@use '_partial/gallery';
|
||||
|
||||
@import '_partial/collection';
|
||||
@import '_partial/gallery';
|
||||
|
||||
@import 'node_modules/swiper/swiper.scss';
|
||||
@use '../../node_modules/swiper/swiper.css';
|
||||
|
||||
2
assets/ts/critical.ts
Normal file
2
assets/ts/critical.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// this is a dummy file to trick vite to generate a critical.css file
|
||||
import '../scss/critical.scss'
|
||||
@@ -1,4 +1,3 @@
|
||||
// eslint-disable-next-line sort-imports
|
||||
import { Show, createMemo, createSignal, type JSX } from 'solid-js'
|
||||
|
||||
import type { ImageJSON } from '../resources'
|
||||
|
||||
@@ -135,7 +135,7 @@ export default function Stage(props: {
|
||||
}
|
||||
|
||||
const onClick: () => void = () => {
|
||||
!props.isAnimating() && props.setIsOpen(true)
|
||||
if (!props.isAnimating()) props.setIsOpen(true)
|
||||
}
|
||||
|
||||
const setPosition: () => void = () => {
|
||||
@@ -422,7 +422,6 @@ export default function Stage(props: {
|
||||
.catch(() => {
|
||||
void 0
|
||||
})
|
||||
// eslint-disable-next-line solid/reactivity
|
||||
.then(() => {
|
||||
// abort controller for cleanup
|
||||
abortController?.abort()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { For, type Accessor, type JSX, type Setter } from 'solid-js'
|
||||
import { For, createEffect, type Accessor, type JSX, type Setter } from 'solid-js'
|
||||
|
||||
import { useState } from '../state'
|
||||
import { decrement, increment, type Vector } from '../utils'
|
||||
@@ -24,6 +24,7 @@ export default function StageNav(props: {
|
||||
type NavItem = (typeof navItems)[number]
|
||||
|
||||
// variables
|
||||
let controller: AbortController | undefined
|
||||
// eslint-disable-next-line solid/reactivity
|
||||
const navItems = [props.prevText, props.closeText, props.nextText] as const
|
||||
|
||||
@@ -70,6 +71,19 @@ export default function StageNav(props: {
|
||||
else if (e.key === 'ArrowRight') nextImage()
|
||||
}
|
||||
|
||||
createEffect(() => {
|
||||
if (props.isOpen()) {
|
||||
controller = new AbortController()
|
||||
const abortSignal = controller.signal
|
||||
window.addEventListener('keydown', handleKey, {
|
||||
passive: true,
|
||||
signal: abortSignal
|
||||
})
|
||||
} else {
|
||||
controller?.abort()
|
||||
}
|
||||
})
|
||||
|
||||
return (
|
||||
<>
|
||||
<div class="navOverlay" classList={{ active: props.active() }}>
|
||||
@@ -80,9 +94,9 @@ export default function StageNav(props: {
|
||||
onClick={() => {
|
||||
handleClick(item)
|
||||
}}
|
||||
onKeyDown={handleKey}
|
||||
onFocus={() => props.setHoverText(item)}
|
||||
onMouseOver={() => props.setHoverText(item)}
|
||||
tabIndex="-1"
|
||||
/>
|
||||
)}
|
||||
</For>
|
||||
|
||||
@@ -38,7 +38,9 @@ const Mobile = lazy(async () => await import('./mobile/layout'))
|
||||
function Main(): JSX.Element {
|
||||
// variables
|
||||
const [ijs] = createResource(getImageJSON)
|
||||
const isMobile = window.matchMedia('(hover: none)').matches
|
||||
const isMobile =
|
||||
window.matchMedia('(hover: none)').matches &&
|
||||
!window.navigator.userAgent.includes('Win')
|
||||
|
||||
// states
|
||||
const [scrollable, setScollable] = createSignal(true)
|
||||
|
||||
@@ -116,7 +116,7 @@ export default function Collection(props: {
|
||||
data-src={ij.loUrl}
|
||||
alt={ij.alt}
|
||||
style={{
|
||||
transform: `translate3d(${i() !== 0 ? getRandom(-25, 25) : 0}%, ${i() !== 0 ? getRandom(-30, 30) : 0}%, 0)`
|
||||
transform: `translate3d(${i() !== 0 ? getRandom(-25, 25) : 0}%, ${i() !== 0 ? getRandom(-35, 35) : 0}%, 0)`
|
||||
}}
|
||||
onClick={() => {
|
||||
handleClick(i())
|
||||
|
||||
@@ -14,8 +14,16 @@ export async function getImageJSON(): Promise<ImageJSON[]> {
|
||||
if (document.title.split(' | ')[0] === '404') {
|
||||
return [] // no images on 404 page
|
||||
}
|
||||
|
||||
const ogUrlMetaTag = document.querySelector(
|
||||
'meta[property="og:url"]'
|
||||
) as HTMLMetaElement | null
|
||||
const indexJsonUrl = ogUrlMetaTag?.content
|
||||
? new URL('index.json', ogUrlMetaTag.content).href
|
||||
: new URL('index.json', window.location.href).href
|
||||
|
||||
try {
|
||||
const response = await fetch(`${window.location.href}index.json`, {
|
||||
const response = await fetch(indexJsonUrl, {
|
||||
headers: {
|
||||
Accept: 'application/json'
|
||||
}
|
||||
@@ -27,7 +35,8 @@ export async function getImageJSON(): Promise<ImageJSON[]> {
|
||||
}
|
||||
return 1
|
||||
})
|
||||
} catch (_) {
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
1
bundled/css/critical.css
Normal file
1
bundled/css/critical.css
Normal 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
1
bundled/css/main.css
Normal file
File diff suppressed because one or more lines are too long
1
bundled/js/0I9ziN.js
Normal file
1
bundled/js/0I9ziN.js
Normal file
File diff suppressed because one or more lines are too long
1
bundled/js/BMxMXX.js
Normal file
1
bundled/js/BMxMXX.js
Normal file
File diff suppressed because one or more lines are too long
1
bundled/js/BP5ETi.js
Normal file
1
bundled/js/BP5ETi.js
Normal file
File diff suppressed because one or more lines are too long
1
bundled/js/DgNkpX.js
Normal file
1
bundled/js/DgNkpX.js
Normal file
File diff suppressed because one or more lines are too long
0
bundled/js/critical.js
Normal file
0
bundled/js/critical.js
Normal file
1
bundled/js/main.js
Normal file
1
bundled/js/main.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1,197 +0,0 @@
|
||||
# Getting Started
|
||||
|
||||
The files in `exampleSite` is just a simple example. Now, we will introduce it based on the same structure.
|
||||
|
||||
## Requirements
|
||||
|
||||
Before you start, make sure you have installed Hugo **extended version**. For more information, see [Hugo's documentation](https://gohugo.io/getting-started/installing/).
|
||||
|
||||
Once you have installed Hugo, you can check the version by running the following command:
|
||||
|
||||
```shell
|
||||
hugo version
|
||||
```
|
||||
|
||||
Which should output something like this (the version number may be different), notice the `extended` keyword:
|
||||
|
||||
```shell
|
||||
hugo v0.120.3-a4892a07b41b7b3f1f143140ee4ec0a9a5cf3970+extended darwin/arm64 BuildDate=2023-11-01T17:57:00Z VendorInfo=brew
|
||||
```
|
||||
|
||||
The minimum required Hugo version can be seen in the [`theme.toml`](https://github.com/Sped0n/bridget/blob/main/theme.toml#L19).
|
||||
|
||||
## Installation
|
||||
|
||||
### Git (for adavanced user)
|
||||
|
||||
On the main branch, you can find the theme's latest source code. To use the latest version, you can clone the repository to `themes/bridget` by running the following command in the root directory of your Hugo site:
|
||||
|
||||
```shell
|
||||
git clone https://github.com/Sped0n/bridget themes/bridget
|
||||
```
|
||||
|
||||
If you are already using Git for your site, you can add the theme as a submodule by running the following command in the root directory of your Hugo site:
|
||||
|
||||
```shell
|
||||
git submodule add https://github.com/Sped0n/bridget themes/bridget
|
||||
```
|
||||
|
||||
> ⚠️⚠️⚠️
|
||||
>
|
||||
> Please refer to the config section for the following content.
|
||||
|
||||
### Module (recommended)
|
||||
|
||||
> If you want to have some customizations, use Git installation instead.
|
||||
|
||||
This theme is also available as a [Hugo module](https://gohugo.io/hugo-modules/). Run the following command in the root directory of your Hugo site:
|
||||
|
||||
First turn your site into a Hugo module (in case you haven't done it yet):
|
||||
|
||||
```shell
|
||||
hugo mod init github.com/me/my-new-site
|
||||
# or whatever you like, it doesn’t necessarily have to be a GitHub repo link.
|
||||
hugo mod init blablabla
|
||||
```
|
||||
|
||||
Then import the theme as a dependency adding the following line to the `module` section of your site's configuration file.
|
||||
|
||||
```toml
|
||||
# config/_default/hugo.toml
|
||||
[module]
|
||||
[[module.imports]]
|
||||
path = "github.com/Sped0n/bridget/v2"
|
||||
```
|
||||
|
||||
If you want to upgrade the theme, just run:
|
||||
|
||||
```shell
|
||||
hugo mod get -u
|
||||
```
|
||||
|
||||
> ⚠️⚠️⚠️
|
||||
>
|
||||
> Please refer to the config section for the following content.
|
||||
|
||||
## Content Management
|
||||
|
||||
The content is where the pictures/text is stored, while the static refers to the website icons.
|
||||
|
||||
```
|
||||
.
|
||||
├── content
|
||||
│ ├── Erwitt
|
||||
│ │ ├── 1.jpg
|
||||
│ │ ├── ***
|
||||
│ │ └── index.md
|
||||
│ ├── Gruyaert
|
||||
│ │ ├── 1.jpg
|
||||
│ │ ├── ***
|
||||
│ │ └── index.md
|
||||
│ ├── Info
|
||||
│ │ └── index.md
|
||||
│ └── Webb
|
||||
│ ├── 1.jpg
|
||||
│ ├── ***
|
||||
│ └── index.md
|
||||
└── static
|
||||
├── dot.png
|
||||
└── dot.svg
|
||||
```
|
||||
|
||||
In each index.md file, there is a configuration file like this:
|
||||
|
||||
```markdown
|
||||
---
|
||||
type: _default
|
||||
layout: single
|
||||
url: /erwitt/
|
||||
menu:
|
||||
main:
|
||||
weight: 3
|
||||
identifier: Erwitt
|
||||
title: Erwitt
|
||||
unifiedAlt: '© Elliott Erwitt'
|
||||
_build:
|
||||
publishResources: false
|
||||
---
|
||||
```
|
||||
|
||||
- keep the `type` and `layout` **untouched**;
|
||||
|
||||
- `url` is the href link to this page, in this case, you can visit this page with `blabla.com/erwitt`;
|
||||
|
||||
- `main` is the entry to `menu`;
|
||||
|
||||
- `weight` determines the position of this link in the navigation bar, with the first one being 1, the second one being 2, and so on;
|
||||
|
||||
- `identifier` should be the **same** as the name of the **upper-level directory**;
|
||||
|
||||
- `title` refers to the text that appears on the navigation bar;
|
||||
|
||||
- `unifiedAlt` is **optional**, If you left it empty, the alt attribute of the image will default to its file name; if it is set, the alt attributes of all images will be unified to the value you have set;
|
||||
|
||||
- `publishResources` is **optional but recommended**, setting it to false will hide unprocessed images in the `public` directory. By default, Hugo’s value for this option is true, which can potentially result in source image leakage.
|
||||
|
||||
- If this is a **showcase** page, simply place the images in the same directory as index.md.
|
||||
|
||||
- If this is an **information** page, you can continue writing the information you want to display in index.md.
|
||||
|
||||
> However, please note that the CSS for the information page **only provides simple styling for text**. If you have any requirements beyond text and the browser rendering does not meet your expectations, please modify [`_article.scss`](https://github.com/Sped0n/bridget/blob/main/assets/scss/_partial/_article.scss).
|
||||
|
||||
As for the **website icon**, place the files in static and then go to config part for further reading.
|
||||
|
||||
## Config
|
||||
|
||||
You can simply copy this to the root directory of your site with minor modifications, and you’ll be ready to proceed.
|
||||
|
||||
```
|
||||
.
|
||||
└── config
|
||||
└── _default
|
||||
├── hugo.toml
|
||||
├── markup.toml
|
||||
├── params.toml
|
||||
└── sitemap.toml
|
||||
```
|
||||
|
||||
### `hugo.toml`
|
||||
|
||||
We will focus on introducing the part about `theme as module`, detailed comments are provided for other options, so we won’t repeat them here.
|
||||
|
||||
```toml
|
||||
# theme as module
|
||||
[module]
|
||||
replacements = "github.com/Sped0n/bridget/v2 -> ../.."
|
||||
[[module.imports]]
|
||||
path = "github.com/Sped0n/bridget/v2"
|
||||
```
|
||||
|
||||
- If you have _installation with Git_
|
||||
|
||||
- `replacement`: replace the _path after the arrow_(`../..`) with the location of your local theme file (⚠️⚠️⚠️**relative path only**, example: `themes/bridget`)
|
||||
- `path`: no change
|
||||
|
||||
- If you have _installation with Module_, **remove the `replacements` configuration**.
|
||||
|
||||
### `markup.toml`
|
||||
|
||||
**DO NOT TOUCH THIS**
|
||||
|
||||
### `params.toml`
|
||||
|
||||
Detailed description in the comments.
|
||||
|
||||
### `sitemap.toml`
|
||||
|
||||
https://gohugo.io/templates/sitemap-template/#configuration
|
||||
|
||||
## Customization (AKA for developer)
|
||||
|
||||
> Before heading to this section, please make sure you have **installation with Git**.
|
||||
>
|
||||
> You can use any package manager you want (npm/pnpm/yarn/bun).
|
||||
|
||||
- run `pnpm install` to install neceessary dependencies.
|
||||
- run `pnpm run dev` to host a dev server.
|
||||
- when you’re ready, run `pnpm run build` to update artifacts.
|
||||
307
docs.md
Normal file
307
docs.md
Normal file
@@ -0,0 +1,307 @@
|
||||
### Contents
|
||||
|
||||
- [Prequisites](#prequisites)
|
||||
- [Installation](#installation)
|
||||
- [Hugo Modules (Recommended)](#hugo-modules-recommended)
|
||||
- [Git Repository (For Customizations)](#git-repository-for-customizations)
|
||||
- [Content Management](#content-management)
|
||||
- [`index.md`](#indexmd)
|
||||
- [Front Matter](#front-matter)
|
||||
- [Markdown Content](#markdown-content)
|
||||
- [Favicon](#favicon)
|
||||
- [Configuration](#configuration)
|
||||
- [`hugo.toml`](#hugotoml)
|
||||
- [`markup.toml`](#markuptoml)
|
||||
- [`outputs.toml`](#outputstoml)
|
||||
- [`params.toml`](#paramstoml)
|
||||
- [`sitemap.toml`](#sitemaptoml)
|
||||
- [Usage](#usage)
|
||||
- [Customizations](#customizations)
|
||||
- [Change Font](#change-font)
|
||||
- [Add a Custom Analytic Script](#add-a-custom-analytic-script)
|
||||
|
||||
---
|
||||
|
||||
## Prequisites
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
- [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
|
||||
❯ hugo version
|
||||
hugo v0.152.2+extended+withdeploy darwin/arm64 BuildDate=unknown VendorInfo=nixpkgs
|
||||
```
|
||||
|
||||
- [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
|
||||
❯ pnpm --version && node --version
|
||||
10.20.0
|
||||
v22.20.0
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
### Hugo Modules (Recommended)
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Checkout https://gohugo.io/hugo-modules/use-modules/#prerequisite before using Hugo Modules.
|
||||
|
||||
First turn your site into a Hugo module (in case you haven't done it yet):
|
||||
|
||||
```bash
|
||||
hugo mod init github.com/me/my-new-site
|
||||
# or whatever you like, it doesn’t need to be a valid GitHub repo link.
|
||||
hugo mod init blablabla
|
||||
```
|
||||
|
||||
Then import the theme as a dependency adding the following line to the `module` section of your site's configuration file.
|
||||
|
||||
```toml
|
||||
# config/_default/hugo.toml
|
||||
[module]
|
||||
[[module.imports]]
|
||||
path = "github.com/Sped0n/bridget/v2"
|
||||
```
|
||||
|
||||
If you want to upgrade the theme, just run:
|
||||
|
||||
```shell
|
||||
hugo mod get -u
|
||||
```
|
||||
|
||||
### Git Repository (For Customizations)
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
First clone the repository into your `themes` directory:
|
||||
|
||||
```bash
|
||||
# latest version (main branch, might be unstable)
|
||||
git clone https://github.com/Sped0n/bridget themes/bridget
|
||||
|
||||
# and you can checkout to a specific stable version, see https://github.com/Sped0n/bridget/releases
|
||||
cd themes/bridget
|
||||
git checkout v1.0.0
|
||||
```
|
||||
|
||||
If you are already using Git for your site, you can add the theme as a submodule by running the following command in the root directory of your Hugo site:
|
||||
|
||||
```bash
|
||||
git submodule add https://github.com/Sped0n/bridget themes/bridget
|
||||
```
|
||||
|
||||
## Content Management
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
The content is where the pictures/text is stored, while the static refers to the website icons.
|
||||
|
||||
```
|
||||
.
|
||||
├── content
|
||||
│ ├── Erwitt
|
||||
│ │ ├── 1.jpg
|
||||
│ │ ├── ***
|
||||
│ │ └── index.md
|
||||
│ ├── Gruyaert
|
||||
│ │ ├── 1.jpg
|
||||
│ │ ├── ***
|
||||
│ │ └── index.md
|
||||
│ ├── Info
|
||||
│ │ └── index.md
|
||||
│ └── Webb
|
||||
│ ├── 1.jpg
|
||||
│ ├── ***
|
||||
│ └── index.md
|
||||
└── static
|
||||
├── dot.png
|
||||
└── dot.svg
|
||||
```
|
||||
|
||||
### `index.md`
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
#### Front Matter
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
Inside each index.md file, there is a front matter like this:
|
||||
|
||||
```markdown
|
||||
---
|
||||
type: _default # just copy
|
||||
layout: single # just copy
|
||||
url: /erwitt/
|
||||
menu:
|
||||
main:
|
||||
weight: 3
|
||||
identifier: Erwitt
|
||||
title: Erwitt
|
||||
unifiedAlt: '© Elliott Erwitt'
|
||||
build:
|
||||
publishResources: false # just copy
|
||||
---
|
||||
```
|
||||
|
||||
- `url` is the href link to this page, in this case, you can visit this page with `blabla.com/erwitt`;
|
||||
- `main` is the entry to `menu`;
|
||||
- `weight` determines the position of this link in the navigation bar, with the first one being 1, the second one being 2, and so on;
|
||||
- `identifier` should be the **same** as the name of the **upper-level directory**;
|
||||
- `title` refers to the text that appears on the navigation bar;
|
||||
- `unifiedAlt` is **optional**, If you left it empty, the alt attribute of the image will default to its file name; if it is set, the alt attributes of all images will be unified to the value you have set;
|
||||
|
||||
#### Markdown Content
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
- If this is a **showcase** page:
|
||||
- No need to write anything in index.md.
|
||||
- Place the images in the same directory as `index.md`.
|
||||
- If this is an **information** page:
|
||||
- You can write anything in index.md, and it will be rendered as HTML.
|
||||
- However, please note that the CSS for the information page **only provides simple styling for text**. If you have any requirements beyond text and the browser rendering does not meet your expectations, please modify [`_article.scss`](https://github.com/Sped0n/bridget/blob/main/assets/scss/_partial/_article.scss).
|
||||
|
||||
### Favicon
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
As for the **website icon**, place the files under `static` directory and then go to [config](#configuration) part for further reading.
|
||||
|
||||
## Configuration
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
You can simply copy `exampleSite/config` to the root directory, with some minor modifications and you should be good to go.
|
||||
|
||||
```
|
||||
.
|
||||
└── config
|
||||
└── _default
|
||||
├── hugo.toml
|
||||
├── markup.toml
|
||||
├── outputs.toml
|
||||
├── params.toml
|
||||
└── sitemap.toml
|
||||
```
|
||||
|
||||
### `hugo.toml`
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
First, what you need to modify is the `baseURL` and `title`:
|
||||
|
||||
```toml
|
||||
# timeout
|
||||
timeout = "1200s"
|
||||
# your website url
|
||||
baseURL = 'https://bridget-demo.sped0n.com' # <-- MODIFY ME
|
||||
# website title
|
||||
title = 'Bridget' # <-- MODIFY ME
|
||||
# don't touch this
|
||||
disableKinds = ["section", "taxonomy", "term", "home"]
|
||||
# robots.txt
|
||||
enableRobotsTXT = true
|
||||
```
|
||||
|
||||
Depend on which [installation](#installation) method you choose, you need to modify the `module` section:
|
||||
|
||||
- If you use [Hugo Modules](#hugo-modules-recommended):
|
||||
|
||||
```toml
|
||||
[module]
|
||||
[[module.imports]]
|
||||
path = "github.com/Sped0n/bridget/v2"
|
||||
```
|
||||
|
||||
- If you use [Git Repository](#git-repository-for-customizations):
|
||||
|
||||
```toml
|
||||
[module]
|
||||
# This is the relative path to hugo theme directory([official doc](https://gohugo.io/hugo-modules/configuration/#module-configuration-top-level))**.
|
||||
replacements = "github.com/Sped0n/bridget/v2 -> ../.."
|
||||
[[module.imports]]
|
||||
path = "github.com/Sped0n/bridget/v2"
|
||||
```
|
||||
|
||||
### `markup.toml`
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
**Just copy it.**
|
||||
|
||||
### `outputs.toml`
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
**Just copy it.**
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
### `params.toml`
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
Detailed description in the comments.
|
||||
|
||||
### `sitemap.toml`
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
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
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Please make sure you have [installation with Git](#git-repository-for-customizations).
|
||||
>
|
||||
> If you want to try some changes on the `exampleSite`, below are some commands you might need:
|
||||
>
|
||||
> - `pnpm install` to install dependencies.
|
||||
> - `pnpm run dev` to start a dev server (`http://localhost:1313`).
|
||||
> - `pnpm run build` to update artifacts.
|
||||
|
||||
### Change Font
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
These are the places you need to focus on:
|
||||
|
||||
- `assets/scss/_core/_font.scss` (`@font-face`)
|
||||
- `assets/scss/_core/_typography.scss` (`body.font-family`)
|
||||
- `layouts/partials/head/link.html` (`preload`)
|
||||
- `static/lib/fonts/GeistVF.woff2` (font file itself)
|
||||
|
||||
### Add a Custom Analytic Script
|
||||
|
||||
_[Contents](#contents)_
|
||||
|
||||
Go to `layouts/_default/baseof.html`:
|
||||
|
||||
```html
|
||||
<!doctype html>
|
||||
<html lang="{{- site.LanguageCode -}}">
|
||||
<head>
|
||||
/* ---------- INSERT HERE ---------- */
|
||||
</head>
|
||||
<body lang="{{- site.LanguageCode -}}">
|
||||
<div class="analytics">/* ---------- OR HERE ---------- */</div>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
79
eslint.config.mjs
Normal file
79
eslint.config.mjs
Normal file
@@ -0,0 +1,79 @@
|
||||
import js from '@eslint/js'
|
||||
import tsParser from '@typescript-eslint/parser'
|
||||
import love from 'eslint-config-love'
|
||||
import importPlugin from 'eslint-plugin-import'
|
||||
import prettier from 'eslint-plugin-prettier/recommended'
|
||||
import solid from 'eslint-plugin-solid/configs/recommended'
|
||||
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||
import tseslint from 'typescript-eslint'
|
||||
|
||||
export default defineConfig([
|
||||
js.configs.recommended,
|
||||
tseslint.configs.recommended,
|
||||
importPlugin.flatConfigs.recommended,
|
||||
solid,
|
||||
globalIgnores(['node_modules/', 'static/', 'exampleSite/', '*.mjs', 'bundled/']),
|
||||
{
|
||||
...love,
|
||||
...prettier,
|
||||
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
|
||||
parserOptions: {
|
||||
project: './tsconfig.json'
|
||||
}
|
||||
},
|
||||
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
typescript: {
|
||||
project: './tsconfig.json'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
rules: {
|
||||
'prettier/prettier': 'error',
|
||||
'arrow-body-style': 'off',
|
||||
'prefer-arrow-callback': 'off',
|
||||
'import/no-cycle': 'error',
|
||||
|
||||
'sort-imports': [
|
||||
'error',
|
||||
{
|
||||
ignoreCase: false,
|
||||
ignoreDeclarationSort: true,
|
||||
ignoreMemberSort: true,
|
||||
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
|
||||
allowSeparatedGroups: true
|
||||
}
|
||||
],
|
||||
|
||||
'import/no-unresolved': 'error',
|
||||
|
||||
'import/order': [
|
||||
'error',
|
||||
{
|
||||
groups: [
|
||||
'builtin',
|
||||
'external',
|
||||
'internal',
|
||||
'parent',
|
||||
'sibling',
|
||||
'index',
|
||||
'unknown'
|
||||
],
|
||||
'newlines-between': 'always',
|
||||
|
||||
alphabetize: {
|
||||
order: 'asc',
|
||||
caseInsensitive: true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
])
|
||||
@@ -1,27 +1,16 @@
|
||||
# timeout
|
||||
timeout = "1200s"
|
||||
# your website url
|
||||
baseURL = 'https://www.example.com/'
|
||||
baseURL = 'https://bridget-demo.sped0n.com'
|
||||
# website title
|
||||
title = 'Bridget'
|
||||
# don't touch this
|
||||
disableKinds = ["section", "taxonomy", "term", "home"]
|
||||
# robots.txt
|
||||
enableRobotsTXT = true
|
||||
# available options
|
||||
# * en (powered by Geist)
|
||||
# * de (powered by Geist)
|
||||
# * es (powered by Geist)
|
||||
# * fr (powered by Geist)
|
||||
# * it (powered by Geist)
|
||||
# * zh-sg zh-cn (powered by Noto Sans SC)
|
||||
# * zh-hk zh-tw zh-mo (powered by Noto Sans TC)
|
||||
# * ja (powered by Noto Sans JP)
|
||||
# * ko (powered by Noto Sans KR)
|
||||
defaultContentLanguage = 'en'
|
||||
|
||||
# theme as module
|
||||
[module]
|
||||
replacements = "github.com/Sped0n/bridget/v2 -> ../.." # deploy with local 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]]
|
||||
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)
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
# --- REQUIRED -----------------------------------------------------------------
|
||||
|
||||
# description of the site (will be placed in meta)
|
||||
description = "Bridget is a minimal Hugo theme designed for photographers/visual artists."
|
||||
|
||||
# resize options for dynamic resolution, please refer to https://gohugo.io/content-management/image-processing/#image-processing-options
|
||||
loResOpt = "800x webp Lanczos q60"
|
||||
hiResOpt = "2500x webp Lanczos q75"
|
||||
|
||||
# labels (text shown on the UI)
|
||||
[labels]
|
||||
next = "next"
|
||||
prev = "prev"
|
||||
close = "close"
|
||||
threshold = "Threshold"
|
||||
error = "page not found"
|
||||
loading = "loading..."
|
||||
|
||||
# --- OPTIONAL -----------------------------------------------------------------
|
||||
|
||||
# whether to use favicon resource links
|
||||
# generate these with https://realfavicongenerator.net
|
||||
favicon = true
|
||||
@@ -9,16 +26,7 @@ svgFavicon = "/dot.svg"
|
||||
# fallback png favicon for unsupported browsers
|
||||
svgFaviconFallback = "/dot.png"
|
||||
|
||||
# resize options for dynamic resolution, please refer to https://gohugo.io/content-management/image-processing/#image-processing-options
|
||||
loResOpt = "800x webp Lanczos q60"
|
||||
hiResOpt = "2500x webp Lanczos q75"
|
||||
|
||||
# page config
|
||||
[page]
|
||||
# unified alt text for all images in the page
|
||||
unifiedAlt = ''
|
||||
|
||||
# Site verification code for Google/Bing/Yandex/Pinterest/Baidu
|
||||
# site verification code for Google/Bing/Yandex/Pinterest/Baidu
|
||||
[verification]
|
||||
google = ""
|
||||
bing = ""
|
||||
@@ -28,7 +36,7 @@ baidu = ""
|
||||
so = ""
|
||||
sogou = ""
|
||||
|
||||
# Analytics config
|
||||
# analytics config
|
||||
[analytics]
|
||||
enable = true
|
||||
# Google Analytics
|
||||
@@ -46,10 +54,10 @@ server = ""
|
||||
id = ""
|
||||
# Umami Analytics
|
||||
[analytics.umami]
|
||||
data_website_id = "44a4a42d-ec8e-44c9-a38c-7533929e9845"
|
||||
src = "https://umami.sped0nwen.com/script.js"
|
||||
data_website_id = "942d4c0d-ebd0-4da7-936a-bd278af32e5e"
|
||||
src = "https://umami.sped0n.com/script.js"
|
||||
data_host_url = ""
|
||||
data_domains = "bridget-demo.sped0nwen.com"
|
||||
data_domains = "bridget-demo.sped0n.com"
|
||||
# Plausible Analytics
|
||||
[analytics.plausible]
|
||||
data_domain = ""
|
||||
@@ -61,8 +69,8 @@ token = ""
|
||||
[analytics.splitbee]
|
||||
enable = false
|
||||
# no cookie mode
|
||||
No_cookie = true
|
||||
no_cookie = true
|
||||
# respect the do not track setting of the browser
|
||||
Do_not_track = true
|
||||
do_not_track = true
|
||||
# token(optional), more info on https://splitbee.io/docs/embed-the-script
|
||||
data_token = ""
|
||||
|
||||
@@ -8,6 +8,6 @@ menu:
|
||||
identifier: Erwitt
|
||||
title: Erwitt
|
||||
unifiedAlt: '© Elliott Erwitt'
|
||||
_build:
|
||||
build:
|
||||
publishResources: false
|
||||
---
|
||||
|
||||
@@ -8,6 +8,6 @@ menu:
|
||||
identifier: Gruyaert
|
||||
title: Gruyaert
|
||||
unifiedAlt: '© Harry Gruyaert'
|
||||
_build:
|
||||
build:
|
||||
publishResources: false
|
||||
---
|
||||
|
||||
@@ -8,13 +8,13 @@ menu:
|
||||
identifier: Info
|
||||
title: Info
|
||||
unifiedAlt: ''
|
||||
_build:
|
||||
build:
|
||||
publishResources: false
|
||||
---
|
||||
|
||||
Bridget is a _minimal_ Hugo theme designed for photographers/visual artists.
|
||||
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_.
|
||||
|
||||
Once again, great shout out to <u>[Tyler McRobert](https://tylermcrobert.com)</u> for his inspiration to this project.
|
||||
|
||||
@@ -22,4 +22,4 @@ Once again, great shout out to <u>[Tyler McRobert](https://tylermcrobert.com)</u
|
||||
|
||||
Original site design by <u>[Tyler McRobert](https://tylermcrobert.com)</u>.
|
||||
|
||||
© {{< year >}} <u>[Spedon](https://github.com/Sped0n)</u> | Powered by [Hugo](https://gohugo.io)
|
||||
© {{< year >}} <u>[Spedon](https://github.com/Sped0n)</u> | Built with Hugo
|
||||
|
||||
@@ -8,6 +8,6 @@ menu:
|
||||
identifier: Webb
|
||||
title: Webb
|
||||
unifiedAlt: '© Alex Webb'
|
||||
_build:
|
||||
build:
|
||||
publishResources: false
|
||||
---
|
||||
|
||||
25
flake.lock
generated
Normal file
25
flake.lock
generated
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1762596750,
|
||||
"narHash": "sha256-rXXuz51Bq7DHBlfIjN7jO8Bu3du5TV+3DSADBX7/9YQ=",
|
||||
"rev": "b6a8526db03f735b89dd5ff348f53f752e7ddc8e",
|
||||
"revCount": 891611,
|
||||
"type": "tarball",
|
||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.891611%2Brev-b6a8526db03f735b89dd5ff348f53f752e7ddc8e/019a684c-ea63-75fd-99cc-3b869954e5f9/source.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
37
flake.nix
Normal file
37
flake.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
description = "bridget";
|
||||
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
|
||||
outputs =
|
||||
{ self, ... }@inputs:
|
||||
let
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
forEachSupportedSystem =
|
||||
f:
|
||||
inputs.nixpkgs.lib.genAttrs supportedSystems (
|
||||
system:
|
||||
f {
|
||||
pkgs = import inputs.nixpkgs { inherit system; };
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
devShells = forEachSupportedSystem (
|
||||
{ pkgs }:
|
||||
{
|
||||
default = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [
|
||||
nodejs
|
||||
nodePackages.pnpm
|
||||
hugo
|
||||
go
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
18
hugo.toml
Normal file
18
hugo.toml
Normal 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"
|
||||
12
i18n/de.toml
12
i18n/de.toml
@@ -1,12 +0,0 @@
|
||||
[next]
|
||||
other = "nächste"
|
||||
[prev]
|
||||
other = "vorher"
|
||||
[close]
|
||||
other = "schließen"
|
||||
[threshold]
|
||||
other = "schwelle"
|
||||
[404]
|
||||
other = "seite nicht gefunden"
|
||||
[loading]
|
||||
other = "lade..."
|
||||
12
i18n/en.toml
12
i18n/en.toml
@@ -1,12 +0,0 @@
|
||||
[next]
|
||||
other = "next"
|
||||
[prev]
|
||||
other = "prev"
|
||||
[close]
|
||||
other = "close"
|
||||
[threshold]
|
||||
other = "threshold"
|
||||
[404]
|
||||
other = "page not found"
|
||||
[loading]
|
||||
other = "loading..."
|
||||
12
i18n/es.toml
12
i18n/es.toml
@@ -1,12 +0,0 @@
|
||||
[next]
|
||||
other = "siguiente"
|
||||
[prev]
|
||||
other = "previo"
|
||||
[close]
|
||||
other = "cerrar"
|
||||
[threshold]
|
||||
other = "umbral"
|
||||
[404]
|
||||
other = "página no encontrada"
|
||||
[loading]
|
||||
other = "cargando..."
|
||||
12
i18n/fr.toml
12
i18n/fr.toml
@@ -1,12 +0,0 @@
|
||||
[next]
|
||||
other = "suivant"
|
||||
[prev]
|
||||
other = "précédent"
|
||||
[close]
|
||||
other = "fermer"
|
||||
[threshold]
|
||||
other = "seuil"
|
||||
[404]
|
||||
other = "page non trouvée"
|
||||
[loading]
|
||||
other = "chargement..."
|
||||
12
i18n/it.toml
12
i18n/it.toml
@@ -1,12 +0,0 @@
|
||||
[next]
|
||||
other = "prossimo"
|
||||
[prev]
|
||||
other = "precedente"
|
||||
[close]
|
||||
other = "chiudi"
|
||||
[threshold]
|
||||
other = "soglia"
|
||||
[404]
|
||||
other = "pagina non trovata"
|
||||
[loading]
|
||||
other = "caricamento..."
|
||||
12
i18n/ja.toml
12
i18n/ja.toml
@@ -1,12 +0,0 @@
|
||||
[next]
|
||||
other = "進む"
|
||||
[prev]
|
||||
other = "後退"
|
||||
[close]
|
||||
other = "閉じる"
|
||||
[threshold]
|
||||
other = "しきい値"
|
||||
[404]
|
||||
other = "ページが見つかりません"
|
||||
[loading]
|
||||
other = "読み込み中..."
|
||||
12
i18n/ko.toml
12
i18n/ko.toml
@@ -1,12 +0,0 @@
|
||||
[next]
|
||||
other = "전진"
|
||||
[prev]
|
||||
other = "물러나세요"
|
||||
[close]
|
||||
other = "닫기"
|
||||
[threshold]
|
||||
other = "임계값"
|
||||
[404]
|
||||
other = "페이지를 찾을 수 없습니다"
|
||||
[loading]
|
||||
other = "로딩중..."
|
||||
@@ -1,12 +0,0 @@
|
||||
[next]
|
||||
other = "前进"
|
||||
[prev]
|
||||
other = "后退"
|
||||
[close]
|
||||
other = "关闭"
|
||||
[threshold]
|
||||
other = "阈值"
|
||||
[404]
|
||||
other = "页面不存在"
|
||||
[loading]
|
||||
other = "加载中..."
|
||||
@@ -1,12 +0,0 @@
|
||||
[next]
|
||||
other = "前進"
|
||||
[prev]
|
||||
other = "後退"
|
||||
[close]
|
||||
other = "關閉"
|
||||
[threshold]
|
||||
other = "閾值"
|
||||
[404]
|
||||
other = "找不到頁面"
|
||||
[loading]
|
||||
other = "載入中..."
|
||||
@@ -1,12 +0,0 @@
|
||||
[next]
|
||||
other = "前進"
|
||||
[prev]
|
||||
other = "後退"
|
||||
[close]
|
||||
other = "關閉"
|
||||
[threshold]
|
||||
other = "閾值"
|
||||
[404]
|
||||
other = "找不到頁面"
|
||||
[loading]
|
||||
other = "載入中..."
|
||||
@@ -1,12 +0,0 @@
|
||||
[next]
|
||||
other = "前进"
|
||||
[prev]
|
||||
other = "后退"
|
||||
[close]
|
||||
other = "关闭"
|
||||
[threshold]
|
||||
other = "阈值"
|
||||
[404]
|
||||
other = "页面不存在"
|
||||
[loading]
|
||||
other = "加载中..."
|
||||
@@ -1,12 +0,0 @@
|
||||
[next]
|
||||
other = "前進"
|
||||
[prev]
|
||||
other = "後退"
|
||||
[close]
|
||||
other = "關閉"
|
||||
[threshold]
|
||||
other = "閾值"
|
||||
[404]
|
||||
other = "找不到頁面"
|
||||
[loading]
|
||||
other = "載入中..."
|
||||
@@ -2,9 +2,15 @@
|
||||
<div class="container">
|
||||
{{- partial "nav.html" . -}}
|
||||
<article>
|
||||
<p class="error">⛝ <u>404</u> {{- i18n 404 -}} ⛝</p>
|
||||
<p class="error">⛝ <u>404</u> {{- i18n 404 -}} ⛝</p>
|
||||
<p class="error">⛝ <u>404</u> {{- i18n 404 -}} ⛝</p>
|
||||
<p class="error">
|
||||
⛝ <u>404</u> {{- site.Params.labels.error -}} ⛝
|
||||
</p>
|
||||
<p class="error">
|
||||
⛝ <u>404</u> {{- site.Params.labels.error -}} ⛝
|
||||
</p>
|
||||
<p class="error">
|
||||
⛝ <u>404</u> {{- site.Params.labels.error -}} ⛝
|
||||
</p>
|
||||
</article>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{{- define "main" -}}
|
||||
<div
|
||||
class="container"
|
||||
data-next="{{- i18n "next" -}}"
|
||||
data-prev="{{- i18n "prev" -}}"
|
||||
data-close="{{- i18n "close" -}}"
|
||||
data-loading="{{- i18n "loading" -}}"
|
||||
data-next="{{- site.Params.labels.next -}}"
|
||||
data-prev="{{- site.Params.labels.prev -}}"
|
||||
data-close="{{- site.Params.labels.close -}}"
|
||||
data-loading="{{- site.Params.labels.loading -}}"
|
||||
>
|
||||
{{- with .Content -}}
|
||||
<article>
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
{{- $weight := -1 -}}
|
||||
|
||||
{{- range site.Menus.main -}}
|
||||
{{ $menu_item_url := .URL | relLangURL }}
|
||||
{{ $page_url:= $currentPage.RelPermalink | relLangURL }}
|
||||
{{ if eq $menu_item_url $page_url }}
|
||||
{{- $menu_item_url := .URL | relLangURL -}}
|
||||
{{- $page_url:= $currentPage.RelPermalink | relLangURL -}}
|
||||
{{- if eq $menu_item_url $page_url -}}
|
||||
{{- $identifier = .Identifier -}}
|
||||
{{- $title = .Title -}}
|
||||
{{- $weight = .Weight -}}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{{- $res := false -}}
|
||||
|
||||
{{- range . -}}
|
||||
{{- if eq site.LanguageCode . -}}
|
||||
{{- $res = true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return $res -}}
|
||||
@@ -1,8 +1,8 @@
|
||||
{{- if site.Params.favicon -}}
|
||||
{{- with site.Params.svgFavicon -}}
|
||||
<link rel="icon" type="image/svg+xml" href="{{ . }}" />
|
||||
<link rel="icon" type="image/svg+xml" href="{{- . -}}" />
|
||||
{{- with site.Params.svgFaviconFallback -}}
|
||||
<link rel="icon" type="image/png" href="{{ . }}" />
|
||||
<link rel="icon" type="image/png" href="{{- . -}}" />
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
{{/* fingerprint */}}
|
||||
{{- /* fingerprint */ -}}
|
||||
{{- $fingerprint := .Scratch.Get "fingerprint" | default "" -}}
|
||||
|
||||
{{/* critical style */}}
|
||||
{{- $style := dict "Source" "scss/critical.scss" "Fingerprint" $fingerprint -}}
|
||||
{{- $options := dict "enableSourceMap" true "includePaths" (slice "node_modules") -}}
|
||||
{{- $style = dict "Context" . "ToCSS" $options "Inline" true | merge $style -}}
|
||||
{{- /* critical style */ -}}
|
||||
{{- $style := dict "Source" "bundled/css/critical.css" "Fingerprint" $fingerprint -}}
|
||||
{{- $options := dict "enableSourceMap" false -}}
|
||||
{{- $style = dict "Context" . "ToCSS" $options "Inline" true "Template" true | merge $style -}}
|
||||
{{- partial "plugin/style.html" $style -}}
|
||||
|
||||
{{- $style := dict "Link" "/bundled/css/main.css" "Defer" true -}}
|
||||
{{- $style := dict "Link" ("bundled/css/main.css" | absURL) "Defer" true -}}
|
||||
{{- partial "plugin/style.html" $style -}}
|
||||
|
||||
{{/* fuck safari */}}
|
||||
{{- /* fuck safari */ -}}
|
||||
<script>
|
||||
function z() {
|
||||
const r = document.querySelector(':root')
|
||||
@@ -20,44 +20,20 @@
|
||||
window.addEventListener('resize', z, { passive: true })
|
||||
</script>
|
||||
|
||||
{{/* main js */}}
|
||||
{{- $script := dict "Link" "/bundled/js/main.js" "Defer" true "Esm" true -}}
|
||||
{{- /* main js */ -}}
|
||||
{{- $script := dict "Link" ("bundled/js/main.js" | absURL) "Defer" true "Esm" true -}}
|
||||
{{- partial "plugin/script.html" $script -}}
|
||||
|
||||
{{/* fonts */}}
|
||||
<link rel="preload" href="/lib/fonts/fw.woff2" as="font" crossorigin />
|
||||
{{- if (partial "function/langCode.html" (slice "en" "de" "fr" "es" "it")) -}}
|
||||
<link rel="preload" href="/lib/fonts/GeistVF.woff2" as="font" crossorigin />
|
||||
{{- else if (partial "function/langCode.html" (slice "zh-cn" "zh-sg")) -}}
|
||||
<link rel="preload" href="/lib/fonts/NotoSans-Regular.woff2" as="font" crossorigin />
|
||||
<link
|
||||
rel="preload"
|
||||
href="/lib/fonts/NotoSansCJKsc-Regular.woff2"
|
||||
as="font"
|
||||
crossorigin
|
||||
/>
|
||||
{{- else if (partial "function/langCode.html" (slice "zh-tw" "zh-hk" "zh-mo")) -}}
|
||||
<link rel="preload" href="/lib/fonts/NotoSans-Regular.woff2" as="font" crossorigin />
|
||||
<link
|
||||
rel="preload"
|
||||
href="/lib/fonts/NotoSansCJKtc-Regular.woff2"
|
||||
as="font"
|
||||
crossorigin
|
||||
/>
|
||||
{{- else if (partial "function/langCode.html" (slice "ja")) -}}
|
||||
<link rel="preload" href="/lib/fonts/NotoSans-Regular.woff2" as="font" crossorigin />
|
||||
<link
|
||||
rel="preload"
|
||||
href="/lib/fonts/NotoSansCJKjp-Regular.woff2"
|
||||
as="font"
|
||||
crossorigin
|
||||
/>
|
||||
{{- else if (partial "function/langCode.html" (slice "ko")) -}}
|
||||
<link rel="preload" href="/lib/fonts/NotoSans-Regular.woff2" as="font" crossorigin />
|
||||
<link
|
||||
rel="preload"
|
||||
href="/lib/fonts/NotoSansCJKkr-Regular.woff2"
|
||||
as="font"
|
||||
crossorigin
|
||||
/>
|
||||
{{- end -}}
|
||||
{{- /* fonts */ -}}
|
||||
<link
|
||||
rel="preload"
|
||||
href="{{- "lib/fonts/fw.woff2" | absURL -}}"
|
||||
as="font"
|
||||
crossorigin
|
||||
/>
|
||||
<link
|
||||
rel="preload"
|
||||
href="{{- "lib/fonts/GeistVF.woff2" | absURL -}}"
|
||||
as="font"
|
||||
crossorigin
|
||||
/>
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
{{/* Title */}}
|
||||
{{- /* Title */ -}}
|
||||
{{- $page_title := "" -}}
|
||||
{{- with partial "function/currentMenuItem.html" . -}}
|
||||
{{ $page_title = printf "%s" site.Title | printf "%s%s" " | " | printf "%s%s" .Title | printf "%s" }}
|
||||
{{- $page_title = printf "%s" site.Title | printf "%s%s" " | " | printf "%s%s" .Title | printf "%s" -}}
|
||||
{{- end -}}
|
||||
<title>{{ $page_title }}</title>
|
||||
<title>{{- $page_title -}}</title>
|
||||
|
||||
{{/* Basic */}}
|
||||
<meta name="Description" content="{{ site.Params.description }}" />
|
||||
<meta name="application-name" content="{{ $page_title }}" />
|
||||
<meta name="apple-mobile-web-app-title" content="{{ $page_title }}" />
|
||||
{{- /* Basic */ -}}
|
||||
<meta name="Description" content="{{- site.Params.description -}}" />
|
||||
<meta name="application-name" content="{{- $page_title -}}" />
|
||||
<meta name="apple-mobile-web-app-title" content="{{- $page_title -}}" />
|
||||
|
||||
{{/* Opengraph */}}
|
||||
<meta property="og:title" content="{{ $page_title }}" />
|
||||
<meta name="twitter:title" content="{{ $page_title }}" />
|
||||
{{- /* Opengraph */ -}}
|
||||
<meta property="og:title" content="{{- $page_title -}}" />
|
||||
<meta name="twitter:title" content="{{- $page_title -}}" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
<meta property="og:description" content="{{ site.Params.description }}" />
|
||||
<meta name="twitter:description" content="{{ site.Params.description }}" />
|
||||
<meta property="og:url" content="{{- .Permalink -}}" />
|
||||
<meta property="og:description" content="{{- site.Params.description -}}" />
|
||||
<meta name="twitter:description" content="{{- site.Params.description -}}" />
|
||||
|
||||
{{/* Generator */}}
|
||||
{{ hugo.Generator }}
|
||||
{{- /* Generator */ -}}
|
||||
{{- hugo.Generator -}}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
{{- with site.Params.verification.google -}}
|
||||
<meta name="google-site-verification" content="{{ . }}" />
|
||||
<meta name="google-site-verification" content="{{- . -}}" />
|
||||
{{- end -}}
|
||||
{{- with site.Params.verification.bing -}}
|
||||
<meta name="msvalidate.01" content="{{ . }}" />
|
||||
<meta name="msvalidate.01" content="{{- . -}}" />
|
||||
{{- end -}}
|
||||
{{- with site.Params.verification.yandex -}}
|
||||
<meta name="yandex-verification" content="{{ . }}" />
|
||||
<meta name="yandex-verification" content="{{- . -}}" />
|
||||
{{- end -}}
|
||||
{{- with site.Params.verification.pinterest -}}
|
||||
<meta name="p:domain_verify" content="{{ . }}" />
|
||||
<meta name="p:domain_verify" content="{{- . -}}" />
|
||||
{{- end -}}
|
||||
{{- with site.Params.verification.baidu -}}
|
||||
<meta name="baidu-site-verification" content="{{ . }}" />
|
||||
<meta name="baidu-site-verification" content="{{- . -}}" />
|
||||
{{- end -}}
|
||||
{{- with site.Params.verification.sogou -}}
|
||||
<meta name="sogou_site_verification" content="{{ . }}" />
|
||||
<meta name="sogou_site_verification" content="{{- . -}}" />
|
||||
{{- end -}}
|
||||
{{- with site.Params.verification.so -}}
|
||||
<meta name="360-site-verification" content="{{ . }}" />
|
||||
<meta name="360-site-verification" content="{{- . -}}" />
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<nav>
|
||||
<div class="navArtist">
|
||||
<a href="/">{{ site.Title }}</a>
|
||||
<a href="/">{{- site.Title -}}</a>
|
||||
</div>
|
||||
<div class="links">
|
||||
{{- $index := 0 -}}
|
||||
@@ -9,7 +9,7 @@
|
||||
{{- $currentIndex = sub .Weight 1 -}}
|
||||
{{- end -}}
|
||||
{{- $menus := .Site.Menus.main -}}
|
||||
{{- $len := len $menus }}
|
||||
{{- $len := len $menus -}}
|
||||
{{- range $menus -}}
|
||||
{{- $url := .URL | relURL -}}
|
||||
{{- if eq (add $index 1) $len -}}
|
||||
@@ -37,7 +37,7 @@
|
||||
{{- with partial "function/getImageSlice.html" . -}}
|
||||
{{- $length = len . -}}
|
||||
{{- end -}}
|
||||
<span>{{- i18n "threshold" | strings.FirstUpper -}}:</span>
|
||||
<span>{{- site.Params.labels.threshold -}}:</span>
|
||||
<span>
|
||||
<button class="dec">-</button>
|
||||
<span class="num"></span><span class="num"></span><span class="num"></span
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{{- with $analytics.google.id -}}
|
||||
<script type="text/javascript">
|
||||
window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());
|
||||
gtag('config', '{{ . }}'{{ if $analytics.google.anonymizeIP }}, { 'anonymize_ip': true }{{ end }});
|
||||
gtag('config', '{{- . -}}'{{- if $analytics.google.anonymizeIP -}}, { 'anonymize_ip': true }{{- end -}});
|
||||
</script> {{- printf "https://www.googletagmanager.com/gtag/js?id=%v" . | dict "Async" true "Source" | partial "plugin/script.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{{- with $analytics.fathom.id -}}
|
||||
<script type="text/javascript">
|
||||
window.fathom=window.fathom||function(){(fathom.q=fathom.q||[]).push(arguments);};
|
||||
fathom('set', 'siteId', '{{ . }}');
|
||||
fathom('set', 'siteId', '{{- . -}}');
|
||||
fathom('trackPageview');
|
||||
</script> {{- dict "Source" ($analytics.fathom.server | default "cdn.usefathom.com" | printf "https://%v/tracker.js") "Async" true "Attr" "id=fathom-script" | partial "plugin/script.html" -}}
|
||||
{{- end -}}
|
||||
@@ -24,7 +24,7 @@
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?{{ . }}";
|
||||
hm.src = "https://hm.baidu.com/hm.js?{{- . -}}";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
@@ -36,10 +36,10 @@
|
||||
<script
|
||||
async
|
||||
defer
|
||||
data-website-id="{{ . }}"
|
||||
src="{{ $analytics.umami.src }}"
|
||||
{{ with $analytics.umami.data_host_url }}data-host-url="{{ . }}"{{ end }}
|
||||
{{ with $analytics.umami.data_domains }}data-domains="{{ . }}"{{ end }}
|
||||
data-website-id="{{- . -}}"
|
||||
src="{{- $analytics.umami.src -}}"
|
||||
{{- with $analytics.umami.data_host_url -}}data-host-url="{{- . -}}"{{- end -}}
|
||||
{{- with $analytics.umami.data_domains -}}data-domains="{{- . -}}"{{- end -}}
|
||||
></script>
|
||||
{{- end -}}
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
<script
|
||||
async
|
||||
defer
|
||||
data-domain="{{ . }}"
|
||||
src="{{ $analytics.plausible.src }}"
|
||||
data-domain="{{- . -}}"
|
||||
src="{{- $analytics.plausible.src -}}"
|
||||
></script>
|
||||
{{- end -}}
|
||||
|
||||
@@ -58,17 +58,17 @@
|
||||
<script
|
||||
defer
|
||||
src="https://static.cloudflareinsights.com/beacon.min.js"
|
||||
data-cf-beacon='{"token": "{{ $analytics.cloudflare.token }}"}'
|
||||
data-cf-beacon='{"token": "{{- $analytics.cloudflare.token -}}"}'
|
||||
></script>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Splitbee Analytics */ -}}
|
||||
{{- if $analytics.splitbee.enable -}}
|
||||
{{- $attr := "" -}}
|
||||
{{- if $analytics.splitbee.Do_not_track -}}
|
||||
{{- if $analytics.splitbee.do_not_track -}}
|
||||
{{- $attr = printf `%v data-respect-dnt` $attr -}}
|
||||
{{- end -}}
|
||||
{{- if $analytics.splitbee.No_cookie -}}
|
||||
{{- if $analytics.splitbee.no_cookie -}}
|
||||
{{- $attr = printf `%v data-no-cookie` $attr -}}
|
||||
{{- end -}}
|
||||
{{- with $analytics.splitbee.data_token -}}
|
||||
@@ -76,7 +76,7 @@
|
||||
{{- end -}}
|
||||
<script
|
||||
defer
|
||||
{{ with $attr }}{{ . | safeHTMLAttr }}{{ end }}
|
||||
{{- with $attr -}}{{- . | safeHTMLAttr -}}{{- end -}}
|
||||
src="https://cdn.splitbee.io/sb.js"
|
||||
></script>
|
||||
{{- end -}}
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
{{- $resource = resources.FromString $.Path . -}}
|
||||
{{- end -}}
|
||||
{{- if $resource -}}
|
||||
{{- with .Template -}}
|
||||
{{- $resource = $resource | resources.ExecuteAsTemplate . $.Context -}}
|
||||
{{- end -}}
|
||||
{{- with .ToCSS -}}
|
||||
{{- $options := . | merge (dict "outputStyle" "compressed") -}}
|
||||
{{- $resource = $resource | toCSS $options -}}
|
||||
{{- end -}}
|
||||
{{- with .Template -}}
|
||||
{{- $resource = $resource | resources.ExecuteAsTemplate . $.Context -}}
|
||||
{{- end -}}
|
||||
{{- if or .Minify .Inline -}}
|
||||
{{- $resource = $resource | minify -}}
|
||||
{{- end -}}
|
||||
@@ -37,26 +37,26 @@
|
||||
rel="preload"
|
||||
as="style"
|
||||
onload="this.onload=null;this.rel='stylesheet'"
|
||||
href="{{ $href }}"
|
||||
{{ if .Crossorigin }}crossorigin="anonymous"{{ end }}{{ with $integrity }}
|
||||
integrity="{{ . }}"
|
||||
{{ end }}{{ with .Attr }}{{ . | safeHTMLAttr }}{{ end }}
|
||||
href="{{- $href -}}"
|
||||
{{- if .Crossorigin -}}crossorigin="anonymous"{{- end -}}{{- with $integrity -}}
|
||||
integrity="{{- . -}}"
|
||||
{{- end -}}{{- with .Attr -}}{{- . | safeHTMLAttr -}}{{- end -}}
|
||||
/>
|
||||
<noscript
|
||||
><link
|
||||
rel="stylesheet"
|
||||
href="{{ $href }}"
|
||||
{{ if .Crossorigin }}crossorigin="anonymous"{{ end }}{{ with $integrity }}
|
||||
integrity="{{ . }}"
|
||||
{{ end }}{{ with .Attr }}{{ . | safeHTMLAttr }}{{ end }}
|
||||
href="{{- $href -}}"
|
||||
{{- if .Crossorigin -}}crossorigin="anonymous"{{- end -}}{{- with $integrity -}}
|
||||
integrity="{{- . -}}"
|
||||
{{- end -}}{{- with .Attr -}}{{- . | safeHTMLAttr -}}{{- end -}}
|
||||
/></noscript>
|
||||
{{- else -}}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ $href }}"
|
||||
{{ if .Crossorigin }}crossorigin="anonymous"{{ end }}{{ with $integrity }}
|
||||
integrity="{{ . }}"
|
||||
{{ end }}{{ with .Attr }}{{ . | safeHTMLAttr }}{{ end }}
|
||||
href="{{- $href -}}"
|
||||
{{- if .Crossorigin -}}crossorigin="anonymous"{{- end -}}{{- with $integrity -}}
|
||||
integrity="{{- . -}}"
|
||||
{{- end -}}{{- with .Attr -}}{{- . | safeHTMLAttr -}}{{- end -}}
|
||||
/>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -58,4 +58,4 @@ Disallow: /
|
||||
User-agent: *
|
||||
Allow: /
|
||||
|
||||
Sitemap: {{ "/sitemap.xml" | absURL }}
|
||||
Sitemap: {{- "/sitemap.xml" | absURL -}}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{{ now.Year }}
|
||||
{{- now.Year -}}
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
{{- $weeks := div (sub now.Unix .Lastmod.Unix) 604800 -}}
|
||||
{{- $priority := sub 1 (div $weeks 10.0 ) -}}
|
||||
{{- if ge .Sitemap.Priority $priority -}}
|
||||
<priority>{{ .Sitemap.Priority }}</priority>
|
||||
<priority>{{- .Sitemap.Priority -}}</priority>
|
||||
{{- else -}}
|
||||
<priority>{{ $priority }}</priority>
|
||||
<priority>{{- $priority -}}</priority>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -32,14 +32,14 @@
|
||||
{{- range .Translations -}}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Lang }}"
|
||||
href="{{ .Permalink }}"
|
||||
hreflang="{{- .Lang -}}"
|
||||
href="{{- .Permalink -}}"
|
||||
/>
|
||||
{{- end -}}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Lang }}"
|
||||
href="{{ .Permalink }}"
|
||||
hreflang="{{- .Lang -}}"
|
||||
href="{{- .Permalink -}}"
|
||||
/>
|
||||
{{- end -}}
|
||||
</url>
|
||||
|
||||
58
package.json
58
package.json
@@ -3,23 +3,23 @@
|
||||
"version": "v1.0.0",
|
||||
"type": "module",
|
||||
"description": "bridget theme source file",
|
||||
"packageManager": "pnpm@8.10.2",
|
||||
"packageManager": "pnpm@10.20.0",
|
||||
"private": true,
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"vite": "vite build --no-watch",
|
||||
"vite": "DISABLE_WATCH=1 vite build",
|
||||
"lint": "eslint . --fix && prettier --write .",
|
||||
"lint:check": "eslint . && prettier . --check",
|
||||
"dev": "run-p vite:dev hugo:dev",
|
||||
"build": "run-s vite:build hugo:build",
|
||||
"server": "run-p vite:server hugo:server",
|
||||
"vite:build": "vite build --no-watch --minify terser",
|
||||
"vite:server": "vite build --minify terser",
|
||||
"vite:build": "DISABLE_WATCH=1 vite build",
|
||||
"vite:server": "vite build",
|
||||
"vite:dev": "vite build --mode development --minify false",
|
||||
"hugo:build": "hugo --logLevel info --source=exampleSite --gc",
|
||||
"hugo:preview": "hugo --logLevel info --source=exampleSite -D --gc",
|
||||
"hugo:dev": "hugo server --source=exampleSite --gc -D --disableFastRender --watch --logLevel info",
|
||||
"hugo:server": "hugo server --source=exampleSite --gc --disableFastRender -e production --watch --logLevel info"
|
||||
"hugo:build": "hugo --logLevel info --source=exampleSite --minify",
|
||||
"hugo:preview": "hugo --logLevel info --source=exampleSite -D",
|
||||
"hugo:dev": "hugo server --source=exampleSite -D --disableFastRender --watch --logLevel info",
|
||||
"hugo:server": "hugo server --source=exampleSite --disableFastRender -e production --watch --logLevel info"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -39,32 +39,30 @@
|
||||
},
|
||||
"homepage": "https://github.com/Sped0n/bridget#readme",
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||
"@typescript-eslint/parser": "^6.21.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-config-standard": "^17.1.0",
|
||||
"eslint-config-standard-with-typescript": "^43.0.1",
|
||||
"eslint-import-resolver-typescript": "^3.6.1",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-n": "^16.6.2",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"eslint-plugin-solid": "^0.13.1",
|
||||
"@eslint/js": "^9.39.1",
|
||||
"@types/node": "^24.10.0",
|
||||
"@typescript-eslint/parser": "^8.46.4",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-config-love": "^133.0.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-import-resolver-typescript": "^4.4.4",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-prettier": "^5.5.4",
|
||||
"eslint-plugin-solid": "^0.14.5",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "3.2.5",
|
||||
"prettier": "3.6.2",
|
||||
"prettier-plugin-go-template": "^0.0.15",
|
||||
"prettier-plugin-organize-imports": "^3.2.4",
|
||||
"sass": "^1.71.1",
|
||||
"terser": "^5.29.2",
|
||||
"typescript": "^5.4.2",
|
||||
"vite": "^5.1.6",
|
||||
"vite-plugin-solid": "^2.10.2"
|
||||
"prettier-plugin-organize-imports": "^4.3.0",
|
||||
"sass-embedded": "^1.93.3",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.46.4",
|
||||
"vite": "^7.2.2",
|
||||
"vite-plugin-solid": "^2.11.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"gsap": "^3.12.5",
|
||||
"solid-js": "^1.8.15",
|
||||
"swiper": "^11.0.7",
|
||||
"gsap": "^3.13.0",
|
||||
"solid-js": "^1.9.10",
|
||||
"swiper": "^12.0.3",
|
||||
"tiny-invariant": "^1.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
6150
pnpm-lock.yaml
generated
6150
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
23
prettier.config.mjs
Normal file
23
prettier.config.mjs
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @see https://prettier.io/docs/configuration
|
||||
* @type {import("prettier").Config}
|
||||
*/
|
||||
const config = {
|
||||
useTabs: false,
|
||||
tabWidth: 2,
|
||||
printWidth: 88,
|
||||
singleQuote: true,
|
||||
trailingComma: 'none',
|
||||
bracketSpacing: true,
|
||||
semi: false,
|
||||
plugins: ['prettier-plugin-go-template', 'prettier-plugin-organize-imports'],
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.html'],
|
||||
options: {
|
||||
parser: 'go-template'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
export default config
|
||||
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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -6,9 +6,9 @@ license = "MIT"
|
||||
licenselink = "https://github.com/Sped0n/bridget/blob/main/LICENSE"
|
||||
description = "Bridget is a minimal Hugo theme designed for photographers/visual artists."
|
||||
homepage = "https://github.com/Sped0n/bridget"
|
||||
demosite = "https://bridget-demo.sped0nwen.com"
|
||||
demosite = "https://bridget-demo.sped0n.com"
|
||||
tags = ["gallery", "minimal", "portfolio", "responsive"]
|
||||
features = ["SEO optimized", "TypeScript", "multi-language support"]
|
||||
features = ["SEO optimized", "TypeScript"]
|
||||
|
||||
[author]
|
||||
name = "sped0n"
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"moduleResolution": "node",
|
||||
"jsx": "preserve",
|
||||
"jsxImportSource": "solid-js"
|
||||
"jsxImportSource": "solid-js",
|
||||
"types": ["node"]
|
||||
},
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"display": "Recommended"
|
||||
|
||||
35
vercel.sh
Executable file
35
vercel.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
node_modules_generated_dir="./node_modules/exampleSite/resources/_gen"
|
||||
project_generated_dir="./exampleSite/resources/_gen"
|
||||
|
||||
copy_generated_assets_to_project() {
|
||||
if [ -d "${node_modules_generated_dir}" ]; then
|
||||
rm -rf "${project_generated_dir}"
|
||||
mkdir -p "${project_generated_dir}"
|
||||
cp -a "${node_modules_generated_dir}/." "${project_generated_dir}"
|
||||
echo "Copied '${node_modules_generated_dir}' to '${project_generated_dir}'."
|
||||
else
|
||||
echo "Source '${node_modules_generated_dir}' not found, skipping copy to project."
|
||||
fi
|
||||
}
|
||||
|
||||
run_site_build() {
|
||||
pnpm run vite:build && hugo --logLevel info --source=exampleSite --gc --minify
|
||||
}
|
||||
|
||||
copy_generated_assets_to_node_modules() {
|
||||
rm -rf "${node_modules_generated_dir}"
|
||||
if [ -d "${project_generated_dir}" ]; then
|
||||
mkdir -p "${node_modules_generated_dir}"
|
||||
cp -a "${project_generated_dir}/." "${node_modules_generated_dir}"
|
||||
echo "Copied '${project_generated_dir}' back to '${node_modules_generated_dir}'."
|
||||
else
|
||||
echo "Source '${project_generated_dir}' not found, skipping copy to node_modules."
|
||||
fi
|
||||
}
|
||||
|
||||
copy_generated_assets_to_project
|
||||
run_site_build
|
||||
copy_generated_assets_to_node_modules
|
||||
@@ -4,12 +4,17 @@ import solidPlugin from 'vite-plugin-solid'
|
||||
export default defineConfig({
|
||||
plugins: [solidPlugin()],
|
||||
build: {
|
||||
outDir: './static/bundled',
|
||||
watch: {
|
||||
include: 'assets/**'
|
||||
},
|
||||
outDir: './bundled',
|
||||
watch: process.env.DISABLE_WATCH
|
||||
? null
|
||||
: {
|
||||
include: 'assets/**'
|
||||
},
|
||||
rollupOptions: {
|
||||
input: './assets/ts/main.tsx',
|
||||
input: {
|
||||
main: './assets/ts/main.tsx',
|
||||
critical: './assets/ts/critical.ts'
|
||||
},
|
||||
output: {
|
||||
format: 'es',
|
||||
entryFileNames: 'js/[name].js',
|
||||
@@ -17,13 +22,12 @@ export default defineConfig({
|
||||
assetFileNames: '[ext]/[name].[ext]',
|
||||
compact: true
|
||||
}
|
||||
},
|
||||
terserOptions: {
|
||||
compress: {
|
||||
passes: 3
|
||||
},
|
||||
output: {
|
||||
comments: false
|
||||
}
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
loadPaths: ['./assets/scss']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user