From e74bad073204b2c8867630bd23e001cc9506a696 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 01:31:20 +0000 Subject: [PATCH] [ci] update-templates --- templates/basics/package.json | 2 +- templates/blog/package.json | 2 +- .../blog/src/components/HeaderLink.astro | 5 +-- templates/component/package.json | 2 +- templates/container-with-vitest/package.json | 4 +- templates/framework-alpine/package.json | 4 +- templates/framework-lit/package.json | 2 +- templates/framework-multiple/package.json | 8 ++-- templates/framework-preact/package.json | 4 +- templates/framework-react/package.json | 2 +- templates/framework-solid/package.json | 2 +- templates/framework-svelte/package.json | 4 +- templates/framework-vue/package.json | 4 +- templates/hackernews/package.json | 2 +- templates/integration/package.json | 2 +- templates/minimal/package.json | 2 +- templates/portfolio/package.json | 2 +- templates/portfolio/src/components/Nav.astro | 40 ++++++------------- templates/ssr/package.json | 4 +- templates/starlog/package.json | 4 +- templates/toolbar-app/package.json | 2 +- templates/with-markdoc/package.json | 2 +- templates/with-mdx/package.json | 4 +- templates/with-nanostores/package.json | 4 +- .../with-nanostores/src/layouts/Layout.astro | 9 +++-- .../with-nanostores/src/pages/index.astro | 3 +- templates/with-nanostores/src/utils.ts | 4 ++ templates/with-tailwindcss/package.json | 6 +-- templates/with-vitest/package.json | 4 +- 29 files changed, 65 insertions(+), 74 deletions(-) create mode 100644 templates/with-nanostores/src/utils.ts diff --git a/templates/basics/package.json b/templates/basics/package.json index 6d8ae45..bd14bb5 100644 --- a/templates/basics/package.json +++ b/templates/basics/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.16.15" + "astro": "^4.16.16" } } diff --git a/templates/blog/package.json b/templates/blog/package.json index 2525c7c..6d2c2d0 100644 --- a/templates/blog/package.json +++ b/templates/blog/package.json @@ -14,6 +14,6 @@ "@astrojs/mdx": "^3.1.9", "@astrojs/rss": "^4.0.9", "@astrojs/sitemap": "^3.2.1", - "astro": "^4.16.15" + "astro": "^4.16.16" } } diff --git a/templates/blog/src/components/HeaderLink.astro b/templates/blog/src/components/HeaderLink.astro index bb600fb..41da846 100644 --- a/templates/blog/src/components/HeaderLink.astro +++ b/templates/blog/src/components/HeaderLink.astro @@ -4,10 +4,9 @@ import type { HTMLAttributes } from 'astro/types'; type Props = HTMLAttributes<'a'>; const { href, class: className, ...props } = Astro.props; - -const { pathname } = Astro.url; +const pathname = Astro.url.pathname.replace(import.meta.env.BASE_URL, ''); const subpath = pathname.match(/[^\/]+/g); -const isActive = href === pathname || href === '/' + subpath?.[0]; +const isActive = href === pathname || href === '/' + (subpath?.[0] || ''); --- diff --git a/templates/component/package.json b/templates/component/package.json index 53c1507..47bc719 100644 --- a/templates/component/package.json +++ b/templates/component/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^4.16.15" + "astro": "^4.16.16" }, "peerDependencies": { "astro": "^4.0.0" diff --git a/templates/container-with-vitest/package.json b/templates/container-with-vitest/package.json index fa74adc..0194d7c 100644 --- a/templates/container-with-vitest/package.json +++ b/templates/container-with-vitest/package.json @@ -12,11 +12,11 @@ "test": "vitest run" }, "dependencies": { - "astro": "^4.16.15", + "astro": "^4.16.16", "@astrojs/react": "^3.6.3", "react": "^18.3.1", "react-dom": "^18.3.1", - "vitest": "^2.1.4" + "vitest": "^2.1.6" }, "devDependencies": { "@types/react": "^18.3.12", diff --git a/templates/framework-alpine/package.json b/templates/framework-alpine/package.json index 976fe2e..386eee7 100644 --- a/templates/framework-alpine/package.json +++ b/templates/framework-alpine/package.json @@ -12,8 +12,8 @@ }, "dependencies": { "@astrojs/alpinejs": "^0.4.0", - "@types/alpinejs": "^3.13.10", + "@types/alpinejs": "^3.13.11", "alpinejs": "^3.14.3", - "astro": "^4.16.15" + "astro": "^4.16.16" } } diff --git a/templates/framework-lit/package.json b/templates/framework-lit/package.json index 8a9e8f7..6e64bca 100644 --- a/templates/framework-lit/package.json +++ b/templates/framework-lit/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/lit": "^4.3.0", "@webcomponents/template-shadowroot": "^0.2.1", - "astro": "^4.16.15", + "astro": "^4.16.16", "lit": "^3.2.1" } } diff --git a/templates/framework-multiple/package.json b/templates/framework-multiple/package.json index 8374048..f5f4da9 100644 --- a/templates/framework-multiple/package.json +++ b/templates/framework-multiple/package.json @@ -18,12 +18,12 @@ "@astrojs/vue": "^4.5.3", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", - "astro": "^4.16.15", - "preact": "^10.24.3", + "astro": "^4.16.16", + "preact": "^10.25.0", "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^5.1.16", - "vue": "^3.5.12" + "svelte": "^5.2.9", + "vue": "^3.5.13" } } diff --git a/templates/framework-preact/package.json b/templates/framework-preact/package.json index 751ac89..e7ee1c3 100644 --- a/templates/framework-preact/package.json +++ b/templates/framework-preact/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.5.4", "@preact/signals": "^1.3.0", - "astro": "^4.16.15", - "preact": "^10.24.3" + "astro": "^4.16.16", + "preact": "^10.25.0" } } diff --git a/templates/framework-react/package.json b/templates/framework-react/package.json index 63c564f..3abf9f8 100644 --- a/templates/framework-react/package.json +++ b/templates/framework-react/package.json @@ -14,7 +14,7 @@ "@astrojs/react": "^3.6.3", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", - "astro": "^4.16.15", + "astro": "^4.16.16", "react": "^18.3.1", "react-dom": "^18.3.1" } diff --git a/templates/framework-solid/package.json b/templates/framework-solid/package.json index 1e3b7ec..b81fe9c 100644 --- a/templates/framework-solid/package.json +++ b/templates/framework-solid/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/solid-js": "^4.4.4", - "astro": "^4.16.15", + "astro": "^4.16.16", "solid-js": "^1.9.3" } } diff --git a/templates/framework-svelte/package.json b/templates/framework-svelte/package.json index c402052..0fdc088 100644 --- a/templates/framework-svelte/package.json +++ b/templates/framework-svelte/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/svelte": "^6.0.2", - "astro": "^4.16.15", - "svelte": "^5.1.16" + "astro": "^4.16.16", + "svelte": "^5.2.9" } } diff --git a/templates/framework-vue/package.json b/templates/framework-vue/package.json index 4413146..ea4b96d 100644 --- a/templates/framework-vue/package.json +++ b/templates/framework-vue/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/vue": "^4.5.3", - "astro": "^4.16.15", - "vue": "^3.5.12" + "astro": "^4.16.16", + "vue": "^3.5.13" } } diff --git a/templates/hackernews/package.json b/templates/hackernews/package.json index f3479c3..9922b58 100644 --- a/templates/hackernews/package.json +++ b/templates/hackernews/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/node": "^8.3.4", - "astro": "^4.16.15" + "astro": "^4.16.16" } } diff --git a/templates/integration/package.json b/templates/integration/package.json index 87744b0..88be398 100644 --- a/templates/integration/package.json +++ b/templates/integration/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^4.16.15" + "astro": "^4.16.16" }, "peerDependencies": { "astro": "^4.0.0" diff --git a/templates/minimal/package.json b/templates/minimal/package.json index 231fca1..3d09b9c 100644 --- a/templates/minimal/package.json +++ b/templates/minimal/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.16.15" + "astro": "^4.16.16" } } diff --git a/templates/portfolio/package.json b/templates/portfolio/package.json index d7c0cd8..00f7ab5 100644 --- a/templates/portfolio/package.json +++ b/templates/portfolio/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.16.15" + "astro": "^4.16.16" } } diff --git a/templates/portfolio/src/components/Nav.astro b/templates/portfolio/src/components/Nav.astro index f75c230..9d69707 100644 --- a/templates/portfolio/src/components/Nav.astro +++ b/templates/portfolio/src/components/Nav.astro @@ -19,6 +19,14 @@ const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[] { label: 'dribbble', href: 'https://dribbble.com/me', icon: 'dribbble-logo' }, { label: 'YouTube', href: 'https://www.youtube.com/@me/', icon: 'youtube-logo' }, ]; + +/** Test if a link is pointing to the current page. */ +const isCurrentPage = (href: string) => { + let pathname = Astro.url.pathname.replace(import.meta.env.BASE_URL, ''); + if (pathname.at(0) !== '/') pathname = '/' + pathname; + if (pathname.at(-1) !== '/') pathname += '/'; + return pathname === href || (href !== '/' && pathname.startsWith(href)); +}; ---