Replace text-align: right with display: flex, justify-content: flex-end for
consistent right alignment. Add height, z-index for layering, and adjust
margin/padding for better mobile gallery nav positioning.
Signed-off-by: Sped0n <hi@sped0n.com>
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>
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>
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>
Add matrix strategy for 'latest' and '0.114.0' in build job. Update
pnpm and Hugo cache keys for better reliability. Push artifacts only
for 'latest' version. Add [skip ci] to format commit message.
Signed-off-by: Sped0n <hi@sped0n.com>
Delete multilingual i18n files for UI labels. Add English labels to
params.toml under [labels]. Update 404.html, single.html, and nav.html
to use site.Params.labels instead of i18n.
Signed-off-by: Sped0n <hi@sped0n.com>
Simplify to Geist font family for all languages. Update README, SCSS,
partials, and config. Fix style template execution order.
Signed-off-by: Sped0n <hi@sped0n.com>
- Clarify the relative path requirement in the installation documentation
- Update the comment in the configuration file to specify the relative path context
Signed-off-by: Spedon Wen <realsped0n@outlook.com>
* fix: enhance accessibility with `tabIndex`
- Add `tabIndex="-1"` to the navigation item for accessibility
* refactor: refactor event handling with SolidJS effects
- Import `createEffect` from 'solid-js'
- Add an `AbortController` for managing event listeners
- Use `createEffect` to conditionally add and remove keydown event listener based on component state
- Remove `onKeyDown` and `tabIndex` attributes from the overlay div
* refactor: improve top position calculation in stylesheets
- Update the top position calculation in the `_collection.scss` file
* refactor: tweak it harder
* Revert "refactor: tweak it harder"
This reverts commit b7bf7e50f8.
2024-03-17 16:15:13 +08:00
93 changed files with 4619 additions and 3215 deletions
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)
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:
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:
-`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.
-`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**.
- [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:
# 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:
- `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
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)
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>.
@@ -4,12 +4,17 @@ import solidPlugin from 'vite-plugin-solid'
exportdefaultdefineConfig({
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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.