Skip to content

Commit

Permalink
Merge pull request #80 from nnn-training/fix-issue-71
Browse files Browse the repository at this point in the history
`GITHUB_PAGES` に `NEXT_PUBLIC_` プレフィックスを付ける
  • Loading branch information
moesuke authored Mar 13, 2024
2 parents 67e8cfb + a747b60 commit 0c5ff7d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run: |
yarn build
env:
GITHUB_PAGES: true
NEXT_PUBLIC_GITHUB_PAGES: true
- name: generate sitemap
run: |
npx next-sitemap
Expand Down
4 changes: 2 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ module.exports = {
)
return config;
},
assetPrefix: process.env.GITHUB_PAGES ?
assetPrefix: process.env.NEXT_PUBLIC_GITHUB_PAGES ?
'/faq'
:
''
,
basePath: process.env.GITHUB_PAGES ?
basePath: process.env.NEXT_PUBLIC_GITHUB_PAGES ?
'/faq'
:
''
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Layout: React.FunctionComponent<Props> = ({
<Link href="/">
<div className="flex items-center">
<div className="icon ml-1 mb-0.5 cursor-pointer">
<img src={process.env.GITHUB_PAGES ? "/faq/images/nyobiko.png" : "/images/nyobiko.png"} width={100} height={100} />
<img src={process.env.NEXT_PUBLIC_GITHUB_PAGES ? "/faq/images/nyobiko.png" : "/images/nyobiko.png"} width={100} height={100} />
</div>
<h1 className="leading-4 pl-4 cursor-pointer">
<div className="ml-1">N予備校プログラミングコース</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type Params = {
}

const markdownToHtml = async (markdown: string, topSlug: string) => {
const suffix = process.env.GITHUB_PAGES ? `/faq/images/${topSlug}/` : `/images/${topSlug}/`
const suffix = process.env.NEXT_PUBLIC_GITHUB_PAGES ? `/faq/images/${topSlug}/` : `/images/${topSlug}/`
markdown = markdown.replace(/\.\/images\//g, suffix)
const htmlResult = await remark()
.use(remarkHtml, { sanitize: false })
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const TopPage = () => {
<div className="p-4 sm:flex items-center px-2">
<div className="pl-3 pb-2 sm:pl-2 sm:pb-0">
<div className="pt-0.5">
<img src={process.env.GITHUB_PAGES ? "/faq/images/cc.png" : "/images/cc.png"} width={88} height={31} />
<img src={process.env.NEXT_PUBLIC_GITHUB_PAGES ? "/faq/images/cc.png" : "/images/cc.png"} width={88} height={31} />
</div>
</div>
<div className="ml-3 sm:w-72 leading-5 ">
Expand All @@ -120,7 +120,7 @@ const TopPage = () => {
<div className="p-4 sm:flex items-center px-2">
<div className="pl-3 pb-2 sm:pl-2 sm:pb-0">
<div className="icon">
<img src={process.env.GITHUB_PAGES ? "/faq/images/github.png" : "/images/github.png"} width={100} height={100} />
<img src={process.env.NEXT_PUBLIC_GITHUB_PAGES ? "/faq/images/github.png" : "/images/github.png"} width={100} height={100} />
</div>
</div>
<div className=" ml-3 sm:w-96 leading-5 ">
Expand Down

0 comments on commit 0c5ff7d

Please sign in to comment.