Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions 2025/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ export default defineConfig({
},

redirects: {
'/': '/2025/ja',
'/2025': '/2025/ja',
'/': '/2025',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

【質問&提案】
metaタグでredirectするのであればastro.configのredirect指定は不要かと思ったんですが、ブラウザによってはうまく動作しないといったことがあるんでしょうか?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

念のため残しておきました。もし消しても問題ないなら消してしまってもいいかもしれないですね

},

vite: {
Expand Down
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

【質問】
public/*からsrc/*に移動した理由は最適化のためでしょうか?
参考:https://docs.astro.build/en/guides/images/#where-to-store-images

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最適化のためです!あと開発環境でパスエラーが出ていました
もしよくないならやめたほうがいいかも

File renamed without changes.
10 changes: 8 additions & 2 deletions 2025/src/components/LanguagePicker.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
// @ts-expect-error not found
import { base } from 'astro:config/client';

const languages = Object.keys(import.meta.glob('../pages/*.astro')).map(p => p.split('/').at(-1)!.replace('.astro', '')).sort();
const languages
= Object.keys(import.meta.glob('../pages/*.astro'))
.map(p => p.split('/')
.at(-1)!
.replace('.astro', ''))
.filter(lang => lang !== 'index')
.sort();
const pathname = Astro.url.pathname.replace(import.meta.env.BASE_URL, '');
const currentLang = pathname.split('/')[1];
---
Expand All @@ -13,7 +19,7 @@ const currentLang = pathname.split('/')[1];
{lang.toUpperCase()}
</a>
{i < languages.length - 1 && <span class="separator">/</span>}
</>
</>
))}
</div>

Expand Down
3 changes: 2 additions & 1 deletion 2025/src/layouts/Layout.astro
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2025/src/pages/index.astroのslot案を採用する場合は、headerタグ内に<slot name="header" />を追加する必要があります。

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import favicon from '@/assets/favicon.ico?url';
import Footer from '@/components/Footer.astro';
import Header from '@/components/Header.astro';
import { BASE_URL } from '@/consts';
Expand Down Expand Up @@ -37,7 +38,7 @@ const ogImageUrl = ufo.joinURL(BASE_URL, 'og.png');
image: ogImageUrl,
}}
extend={{
link: [{ rel: 'icon', href: '/favicon.ico' }],
link: [{ rel: 'icon', href: favicon }],
}}
/>
</head>
Expand Down
6 changes: 6 additions & 0 deletions 2025/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
import Layout from '@/layouts/Layout.astro';
---
<Layout />

<meta http-equiv="refresh" content="0;url=/2025/ja" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

【提案】

Suggested change
<Layout />
<meta http-equiv="refresh" content="0;url=/2025/ja" />
<Layout>
<Fragment slot="header">
<meta http-equiv="refresh" content="0;url=/2025/ja" />
</Fragment>
</Layout>

astro wayに乗るならこういった書き方もできます

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あーなるほど確かに
良さそうですね