Skip to content

Commit

Permalink
fix: undefined in client component
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Jul 16, 2024
1 parent e10c755 commit b82ce11
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ APP_SECRET=
SPACE_ID=
COOKIE_PASSWORD=
COOKIE_NAME=
SITE_URL=
NEXT_PUBLIC_SITE_URL=
2 changes: 1 addition & 1 deletion .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
echo APP_ID=${{ secrets.APP_ID }} >> .env
echo APP_SECRET=${{ secrets.APP_SECRET }} >> .env
echo SPACE_ID=${{ secrets.SPACE_ID }} >> .env
echo SITE_URL=${{ vars.SITE_URL }} >> .env
echo NEXT_PUBLIC_SITE_URL=${{ vars.SITE_URL }} >> .env
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
- name: Upload artifact
Expand Down
4 changes: 3 additions & 1 deletion app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
if (nodes) {
for (const node of nodes) {
map.push({
url: `${process.env.SITE_URL}${await getPath(node.node_token)}`,
url: `${process.env.NEXT_PUBLIC_SITE_URL}${await getPath(
node.node_token
)}`,
lastModified: new Date(Number(node.obj_edit_time) * 1000),
changeFrequency: "weekly",
priority: 0.5,
Expand Down
2 changes: 1 addition & 1 deletion components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function Header({ menu }: Props) {
<div className="fixed w-full bg-white z-50 flex px-5 h-[60px]">
<Link href="/" className="mr-8 flex">
<Image
src={`${process.env.SITE_URL}/aelf-logo.svg`}
src={`${process.env.NEXT_PUBLIC_SITE_URL}/aelf-logo.svg`}
width={115}
height={32}
alt="logo"
Expand Down
2 changes: 1 addition & 1 deletion components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function Footer() {
<div className="container p-8 lg:grid grid-cols-5 gap-4">
<div className="hidden lg:block">
<Image
src={`${process.env.SITE_URL}/aelf-logo.svg`}
src={`${process.env.NEXT_PUBLIC_SITE_URL}/aelf-logo.svg`}
width={115}
height={32}
alt="logo"
Expand Down
2 changes: 1 addition & 1 deletion components/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function Search() {

useEffect(() => {
(async () => {
const res = await fetch(`${process.env.SITE_URL}/api/search`);
const res = await fetch(`${process.env.NEXT_PUBLIC_SITE_URL}/api/search`);
const data = await res.json();

const config = searchConfigSchema.parse(data);
Expand Down

0 comments on commit b82ce11

Please sign in to comment.