Skip to content

Commit

Permalink
[ci] update-templates
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 28, 2024
1 parent b7d7ba1 commit e74bad0
Show file tree
Hide file tree
Showing 29 changed files with 65 additions and 74 deletions.
2 changes: 1 addition & 1 deletion templates/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.16.15"
"astro": "^4.16.16"
}
}
2 changes: 1 addition & 1 deletion templates/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
5 changes: 2 additions & 3 deletions templates/blog/src/components/HeaderLink.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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] || '');
---

<a href={href} class:list={[className, { active: isActive }]} {...props}>
Expand Down
2 changes: 1 addition & 1 deletion templates/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^4.16.15"
"astro": "^4.16.16"
},
"peerDependencies": {
"astro": "^4.0.0"
Expand Down
4 changes: 2 additions & 2 deletions templates/container-with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions templates/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion templates/framework-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
8 changes: 4 additions & 4 deletions templates/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 2 additions & 2 deletions templates/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion templates/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion templates/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^4.4.4",
"astro": "^4.16.15",
"astro": "^4.16.16",
"solid-js": "^1.9.3"
}
}
4 changes: 2 additions & 2 deletions templates/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 2 additions & 2 deletions templates/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion templates/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/node": "^8.3.4",
"astro": "^4.16.15"
"astro": "^4.16.16"
}
}
2 changes: 1 addition & 1 deletion templates/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^4.16.15"
"astro": "^4.16.16"
},
"peerDependencies": {
"astro": "^4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion templates/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.16.15"
"astro": "^4.16.16"
}
}
2 changes: 1 addition & 1 deletion templates/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.16.15"
"astro": "^4.16.16"
}
}
40 changes: 13 additions & 27 deletions templates/portfolio/src/components/Nav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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));
};
---

<nav>
Expand All @@ -41,18 +49,7 @@ const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[]
{
textLinks.map(({ label, href }) => (
<li>
<a
aria-current={Astro.url.pathname === href}
class:list={[
'link',
{
active:
Astro.url.pathname === href ||
(href !== '/' && Astro.url.pathname.startsWith(href)),
},
]}
href={href}
>
<a aria-current={isCurrentPage(href) ? 'page' : null} class="link" href={href}>
{label}
</a>
</li>
Expand All @@ -79,18 +76,7 @@ const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[]
{
textLinks.map(({ label, href }) => (
<li>
<a
aria-current={Astro.url.pathname === href}
class:list={[
'link',
{
active:
Astro.url.pathname === href ||
(href !== '/' && Astro.url.pathname.startsWith(href)),
},
]}
href={href}
>
<a aria-current={isCurrentPage(href) ? 'page' : null} class="link" href={href}>
{label}
</a>
</li>
Expand Down Expand Up @@ -234,7 +220,7 @@ const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[]
text-decoration: none;
}

.link.active {
.link[aria-current] {
color: var(--gray-0);
}

Expand Down Expand Up @@ -332,7 +318,7 @@ const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[]
background-color: var(--accent-subtle-overlay);
}

.link.active {
.link[aria-current='page'] {
color: var(--accent-text-over);
background-color: var(--accent-regular);
}
Expand Down Expand Up @@ -360,7 +346,7 @@ const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[]
}
}
@media (forced-colors: active) {
.link.active {
.link[aria-current='page'] {
color: SelectedItem;
}
}
Expand Down
4 changes: 2 additions & 2 deletions templates/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@astrojs/node": "^8.3.4",
"@astrojs/svelte": "^6.0.2",
"astro": "^4.16.15",
"svelte": "^5.1.16"
"astro": "^4.16.16",
"svelte": "^5.2.9"
}
}
4 changes: 2 additions & 2 deletions templates/starlog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.16.15",
"sass": "^1.80.6",
"astro": "^4.16.16",
"sass": "^1.81.0",
"sharp": "^0.33.3"
}
}
2 changes: 1 addition & 1 deletion templates/toolbar-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"./app": "./dist/app.js"
},
"devDependencies": {
"astro": "^4.16.15",
"astro": "^4.16.16",
"@types/node": "^18.17.8"
}
}
2 changes: 1 addition & 1 deletion templates/with-markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^0.11.5",
"astro": "^4.16.15"
"astro": "^4.16.16"
}
}
4 changes: 2 additions & 2 deletions templates/with-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/mdx": "^3.1.9",
"@astrojs/preact": "^3.5.4",
"astro": "^4.16.15",
"preact": "^10.24.3"
"astro": "^4.16.16",
"preact": "^10.25.0"
}
}
4 changes: 2 additions & 2 deletions templates/with-nanostores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"dependencies": {
"@astrojs/preact": "^3.5.4",
"@nanostores/preact": "^0.5.2",
"astro": "^4.16.15",
"astro": "^4.16.16",
"nanostores": "^0.11.3",
"preact": "^10.24.3"
"preact": "^10.25.0"
}
}
9 changes: 5 additions & 4 deletions templates/with-nanostores/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import CartFlyout from '../components/CartFlyout';
import CartFlyoutToggle from '../components/CartFlyoutToggle';
import { withBase } from '../utils';
interface Props {
title: string;
Expand All @@ -15,15 +16,15 @@ const { title } = Astro.props;
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" type="image/svg+xml" href={withBase('/favicon.svg')} />
<title>{title}</title>
</head>
<body>
<header>
<nav>
<a href="/" class="nav-header"
><span style="color: var(--astro-blue)">Astro</span> storefront</a
>
<a href={withBase('/')} class="nav-header">
<span style="color: var(--astro-blue)">Astro</span> storefront
</a>
<CartFlyoutToggle client:load />
</nav>
</header>
Expand Down
3 changes: 2 additions & 1 deletion templates/with-nanostores/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import type { CartItemDisplayInfo } from '../cartStore';
import Layout from '../layouts/Layout.astro';
import AddToCartForm from '../components/AddToCartForm';
import FigurineDescription from '../components/FigurineDescription.astro';
import { withBase } from '../utils';
const item: CartItemDisplayInfo = {
id: 'astronaut-figurine',
name: 'Astronaut Figurine',
imageSrc: '/images/astronaut-figurine.png',
imageSrc: withBase('/images/astronaut-figurine.png'),
};
---

Expand Down
4 changes: 4 additions & 0 deletions templates/with-nanostores/src/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const base = import.meta.env.BASE_URL.replace(/\/$/, '');

/** Prefix a URL path with the site’s base path if set. */
export const withBase = (path: string) => base + path;
6 changes: 3 additions & 3 deletions templates/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"@astrojs/mdx": "^3.1.9",
"@astrojs/tailwind": "^5.1.2",
"@types/canvas-confetti": "^1.6.4",
"astro": "^4.16.15",
"astro": "^4.16.16",
"autoprefixer": "^10.4.20",
"canvas-confetti": "^1.9.3",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.14"
"postcss": "^8.4.49",
"tailwindcss": "^3.4.15"
}
}
4 changes: 2 additions & 2 deletions templates/with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test": "vitest"
},
"dependencies": {
"astro": "^4.16.15",
"vitest": "^2.1.4"
"astro": "^4.16.16",
"vitest": "^2.1.6"
}
}

0 comments on commit e74bad0

Please sign in to comment.