diff --git a/assets/ts/nav.ts b/assets/ts/nav.ts
index 13caa42..911551c 100644
--- a/assets/ts/nav.ts
+++ b/assets/ts/nav.ts
@@ -31,27 +31,6 @@ const indexDispNums = Array.from(
indexDiv.getElementsByClassName('num')
) as HTMLSpanElement[]
-// links div
-const linksDiv = document.getElementsByClassName('links').item(0) as HTMLDivElement
-
-// links
-const links = Array.from(linksDiv.getElementsByClassName('link')) as HTMLAnchorElement[]
-
-// current link index
-const currentLinkIndex = document
- .getElementById('main')
- ?.getAttribute('currentMenuItemIndex') as string
-
-// set current link
-for (const [index, link] of links.entries()) {
- if (index === parseInt(currentLinkIndex)) {
- // set current link style
- link.classList.add('current')
- // set current link title (only if not home)
- if (index !== 0) document.title = link.innerText + ' | ' + document.title
- }
-}
-
/**
* init
*/
diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml
index b8f3dce..fc82038 100644
--- a/exampleSite/config/_default/params.toml
+++ b/exampleSite/config/_default/params.toml
@@ -1,5 +1,5 @@
# description of the site (will be placed in meta)
-description = "Bridget is a minimal Hugo theme designed for photographers / visual artists."
+description = "Bridget is a minimal Hugo theme designed for photographers/visual artists."
# use bundled js and css
# * if you want to build the js and css from scratch, set this to false and run `npm install` and `npm run build`
# * tldr: set this to false if you want to develop and edit the js and css
diff --git a/exampleSite/content/Info/index.md b/exampleSite/content/Info/index.md
index c129d8f..c95d0ca 100644
--- a/exampleSite/content/Info/index.md
+++ b/exampleSite/content/Info/index.md
@@ -10,9 +10,9 @@ menu:
unifiedAlt: ''
---
-Bridget is a _minimal_ Hugo theme designed for photographers / visual artists.
+Bridget is a _minimal_ Hugo theme designed for photographers/visual artists.
-The inspiration for this theme came from a video by [Hyperlexed](https://www.youtube.com/@Hyperplexed), which can be found [here](https://www.youtube.com/watch?v=Jt3A2lNN2aE). Initially, it was designed using pure TypeScript and CSS. However, after website designer [Tyler McRobert](https://tylermcrobert.com) made the source code publicly available, the whole project was modified to mimic the original design. The animations in Bridget are achieved using gsap and swiper. In essence, it is more like a porting of the original design into Hugo.
+The inspiration for this theme came from a video by [Hyperlexed](https://www.youtube.com/@Hyperplexed), which can be found [here](https://www.youtube.com/watch?v=Jt3A2lNN2aE). Initially, it was developed using raw TypeScript and CSS. However, after website designer [Tyler McRobert](https://tylermcrobert.com) made the source code publicly available, I realized that I have invented many unnecessary components, and this project was modified to porting the original design to hugo while focussing on _performance_.
Once again, great shout out to [Tyler McRobert](https://tylermcrobert.com) for his inspiration to this project.
diff --git a/layouts/404.html b/layouts/404.html
index 9ac594c..50aff5a 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -1,9 +1,4 @@
{{- define "main" -}}
- {{- $params := .Scratch.Get "params" -}}
- {{- $currentPage := . -}}
- {{- with partial "function/currentMenuItem.html" . -}}
-
- {{- end -}}
{{- partial "nav.html" . -}}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index a4d19d8..342f367 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -3,11 +3,10 @@
- {{ site.Title }}
- {{- partial "head/link.html" -}}
- {{- partial "head/meta.html" -}}
- {{- partial "head/seo.html" -}}
- {{- partial "head/favicon.html" -}}
+ {{- partial "head/link.html" . -}}
+ {{- partial "head/meta.html" . -}}
+ {{- partial "head/seo.html" . -}}
+ {{- partial "head/favicon.html" . -}}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 214cfef..dc38d44 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,14 +1,9 @@
{{- define "main" -}}
- {{- $params := .Scratch.Get "params" -}}
- {{- $currentPage := . -}}
- {{- with partial "function/currentMenuItem.html" . -}}
-
- {{- end -}}
+
{{- partial "nav.html" . -}}
diff --git a/layouts/_default/single.json b/layouts/_default/single.json
index 111efd3..f1d391e 100644
--- a/layouts/_default/single.json
+++ b/layouts/_default/single.json
@@ -3,7 +3,7 @@
{{- $params := .Page.Params | merge .Site.Params.Page -}}
{{- with partial "function/currentMenuItem.html" . -}}
- {{- $Path = .DirName -}}
+ {{- $Path = .Identifier -}}
{{- end -}}
{{- $gallery := site.GetPage $Path -}}
diff --git a/layouts/partials/function/currentMenuItem.html b/layouts/partials/function/currentMenuItem.html
index a84d487..1502602 100644
--- a/layouts/partials/function/currentMenuItem.html
+++ b/layouts/partials/function/currentMenuItem.html
@@ -1,15 +1,17 @@
{{- $currentPage := . -}}
-{{- $dirName := "" -}}
-{{- $id := -1 -}}
+{{- $identifier := "" -}}
+{{- $title := "" -}}
+{{- $weight := -1 -}}
{{- range site.Menus.main -}}
{{ $menu_item_url := .URL | relLangURL }}
{{ $page_url:= $currentPage.RelPermalink | relLangURL }}
{{ if eq $menu_item_url $page_url }}
- {{- $dirName = .Identifier -}}
- {{- $id = .Weight -}}
+ {{- $identifier = .Identifier -}}
+ {{- $title = .Title -}}
+ {{- $weight = .Weight -}}
{{- end -}}
{{- end -}}
-{{- return (dict "DirName" $dirName "ID" $id) -}}
+{{- return (dict "Identifier" $identifier "Title" $title "Weight" $weight) -}}
diff --git a/layouts/partials/head/link.html b/layouts/partials/head/link.html
index 143c2e4..ad68af9 100644
--- a/layouts/partials/head/link.html
+++ b/layouts/partials/head/link.html
@@ -8,7 +8,7 @@
{{- partial "plugin/style.html" $style -}}
{{/* main style */}}
-{{- if site.Params.bundled -}}
+{{- if (site.Params.bundled | default true) -}}
{{- $style := dict "Link" "/bundled/css/style.min.css" "Defer" true -}}
{{- partial "plugin/style.html" $style -}}
{{- else -}}
diff --git a/layouts/partials/head/meta.html b/layouts/partials/head/meta.html
index 2afdbc2..652218d 100644
--- a/layouts/partials/head/meta.html
+++ b/layouts/partials/head/meta.html
@@ -1,9 +1,22 @@
-
-
-
+{{/* Title */}}
+{{- $page_title := "" -}}
+{{- with partial "function/currentMenuItem.html" . -}}
+ {{ $page_title = printf "%s" site.Title | printf "%s%s" " | " | printf "%s%s" .Title | printf "%s" }}
+{{- end -}}
+
{{ $page_title }}
+
+{{/* Basic */}}
+
+
+
+
+{{/* Opengraph */}}
+
+
+
+
+
+
+
+{{/* Generator */}}
+{{ hugo.Generator }}
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index bfeeb2d..f2592aa 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -4,14 +4,30 @@
{{- $index := 0 -}}
+ {{- $currentIndex := -1 -}}
+ {{- with partial "function/currentMenuItem.html" . -}}
+ {{- $currentIndex = sub .Weight 1 -}}
+ {{- end -}}
{{- $menus := .Site.Menus.main -}}
{{- $len := len $menus }}
{{- range $menus -}}
{{- $url := .URL | relURL -}}
{{- if eq (add $index 1) $len -}}
-
{{- .Title -}}
+
{{- .Title -}}
{{- else -}}
-
{{- .Title -}}, 
+
{{- .Title -}}, 
{{- end -}}
{{- $index = add $index 1 -}}
{{- end -}}
diff --git a/static/bundled/js/main.js b/static/bundled/js/main.js
index 7aaf961..ab995b2 100644
--- a/static/bundled/js/main.js
+++ b/static/bundled/js/main.js
@@ -1 +1 @@
-function t(t,e){return(t+1)%e}function e(t,e){return(t+e-1)%e}function n(t){return("0000"+t.toString()).slice(-4)}function s(t,e){return Math.floor(Math.random()*(e-t+1))+t}function o(t,e){new IntersectionObserver(((n,s)=>{n.forEach((n=>{n.intersectionRatio>0&&(e(t),s.disconnect())}))})).observe(t)}function r(t){return t.charAt(0).toUpperCase()+t.slice(1)}async function i(){const t=await import("./8mM4Ei.js");return[t.gsap,t.Power3]}async function a(){return(await import("./f6JTi3.js")).Swiper}class c{constructor(t){this.obj=t,this.watchers=[]}get(){return this.obj}set(t){this.obj=t,this.watchers.forEach((t=>{t(this.obj)}))}addWatcher(t){this.watchers.push(t)}}const l=new c(!0);let h;const d=[{threshold:20,trailLength:20},{threshold:40,trailLength:10},{threshold:80,trailLength:5},{threshold:140,trailLength:5},{threshold:200,trailLength:5}],m=new c({index:-1,length:0,threshold:d[p()].threshold,trailLength:d[p()].trailLength});function u(t){const e=m.get();e.index=t,m.set(e)}function g(){const e=m.get();e.index=t(e.index,e.length),m.set(e)}function f(){const t=m.get();t.index=e(t.index,t.length),m.set(t)}function x(t,e){const n=d.findIndex((e=>t.threshold===e.threshold))+e;if(n<0||n>=d.length)return t;sessionStorage.setItem("thresholdsIndex",n.toString());const s=d[n];return{...t,...s}}function p(){const t=sessionStorage.getItem("thresholdsIndex");return null===t?2:parseInt(t)}const w=document.getElementsByClassName("threshold").item(0),y=Array.from(w.getElementsByClassName("num")),E=w.getElementsByClassName("dec").item(0),j=w.getElementsByClassName("inc").item(0),L=document.getElementsByClassName("index").item(0),b=Array.from(L.getElementsByClassName("num")),I=document.getElementsByClassName("links").item(0),B=Array.from(I.getElementsByClassName("link")),C=document.getElementById("main")?.getAttribute("currentMenuItemIndex");for(const[t,e]of B.entries())t===parseInt(C)&&(e.classList.add("current"),0!==t&&(document.title=e.innerText+" | "+document.title));function N(t){y.forEach(((e,n)=>{e.innerText=t[n]}))}function v(t,e){b.forEach(((n,s)=>{n.innerText=s<4?t[s]:e[s-4]}))}h=document.getElementsByClassName("container").item(0),l.addWatcher((t=>{t?h.classList.remove("disableScroll"):h.classList.add("disableScroll")}));const S=await async function(){try{const t=await fetch(`${window.location.href}index.json`,{headers:{Accept:"application/json"}});return(await t.json()).sort(((t,e)=>t.index
{v(n(t.index+1),n(t.length)),N(n(t.threshold))})),E.addEventListener("click",(()=>{!function(){let t=m.get();t=x(t,-1),m.set(t)}()}),{passive:!0}),j.addEventListener("click",(()=>{!function(){let t=m.get();t=x(t,1),m.set(t)}()}),{passive:!0})}(),S.length>0&&(window.matchMedia("(hover: none)").matches?import("./fRwBqI.js").then((t=>{t.initMobile(S)})).catch((t=>{console.log(t)})):import("./PR3rto.js").then((t=>{t.initDesktop(S)})).catch((t=>{console.log(t)})));export{c as W,g as a,f as b,h as c,e as d,l as e,a as f,u as g,n as h,t as i,r as j,s as k,i as l,o,m as s};
\ No newline at end of file
+function t(t,e){return(t+1)%e}function e(t,e){return(t+e-1)%e}function n(t){return("0000"+t.toString()).slice(-4)}function s(t,e){return Math.floor(Math.random()*(e-t+1))+t}function o(t,e){new IntersectionObserver(((n,s)=>{n.forEach((n=>{n.intersectionRatio>0&&(e(t),s.disconnect())}))})).observe(t)}function i(t){return t.charAt(0).toUpperCase()+t.slice(1)}async function r(){const t=await import("./8mM4Ei.js");return[t.gsap,t.Power3]}async function a(){return(await import("./f6JTi3.js")).Swiper}class c{constructor(t){this.obj=t,this.watchers=[]}get(){return this.obj}set(t){this.obj=t,this.watchers.forEach((t=>{t(this.obj)}))}addWatcher(t){this.watchers.push(t)}}const h=new c(!0);let l;const d=[{threshold:20,trailLength:20},{threshold:40,trailLength:10},{threshold:80,trailLength:5},{threshold:140,trailLength:5},{threshold:200,trailLength:5}],u=new c({index:-1,length:0,threshold:d[p()].threshold,trailLength:d[p()].trailLength});function g(t){const e=u.get();e.index=t,u.set(e)}function m(){const e=u.get();e.index=t(e.index,e.length),u.set(e)}function f(){const t=u.get();t.index=e(t.index,t.length),u.set(t)}function x(t,e){const n=d.findIndex((e=>t.threshold===e.threshold))+e;if(n<0||n>=d.length)return t;sessionStorage.setItem("thresholdsIndex",n.toString());const s=d[n];return{...t,...s}}function p(){const t=sessionStorage.getItem("thresholdsIndex");return null===t?2:parseInt(t)}const w=document.getElementsByClassName("threshold").item(0),y=Array.from(w.getElementsByClassName("num")),E=w.getElementsByClassName("dec").item(0),j=w.getElementsByClassName("inc").item(0),L=document.getElementsByClassName("index").item(0),b=Array.from(L.getElementsByClassName("num"));function v(t){y.forEach(((e,n)=>{e.innerText=t[n]}))}function C(t,e){b.forEach(((n,s)=>{n.innerText=s<4?t[s]:e[s-4]}))}l=document.getElementsByClassName("container").item(0),h.addWatcher((t=>{t?l.classList.remove("disableScroll"):l.classList.add("disableScroll")}));const B=await async function(){try{const t=await fetch(`${window.location.href}index.json`,{headers:{Accept:"application/json"}});return(await t.json()).sort(((t,e)=>t.index{C(n(t.index+1),n(t.length)),v(n(t.threshold))})),E.addEventListener("click",(()=>{!function(){let t=u.get();t=x(t,-1),u.set(t)}()}),{passive:!0}),j.addEventListener("click",(()=>{!function(){let t=u.get();t=x(t,1),u.set(t)}()}),{passive:!0})}(),B.length>0&&(window.matchMedia("(hover: none)").matches?import("./fRwBqI.js").then((t=>{t.initMobile(B)})).catch((t=>{console.log(t)})):import("./PR3rto.js").then((t=>{t.initDesktop(B)})).catch((t=>{console.log(t)})));export{c as W,m as a,f as b,l as c,e as d,h as e,a as f,g,n as h,t as i,i as j,s as k,r as l,o,u as s};
\ No newline at end of file