-
Notifications
You must be signed in to change notification settings - Fork 3
スポンサー(パートナー)ページの実装 #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
スポンサー(パートナー)ページの実装 #170
Conversation
@@ -0,0 +1,50 @@ | |||
{ | |||
"platinum": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Web ページなどの表記では Platinum "Go"ld
ですが、
2022 Spring の URL 見ると platinum
になっていたので、それにならってコード上では platinum
という表記にしてます
<Header /> | ||
</Box> | ||
<Box component="main" sx={{ minHeight: 'calc(100vh - 124px)' }}> | ||
<Box component="main" sx={{ minHeight: 'calc(100vh - 300px)' }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
パートナーページのようにコンテンツの高さが小さい場合に余白が大きく感じたので短くしてみました。
import { GetStaticPaths, GetStaticProps } from 'next' | ||
import { PagePartner, PartnerRank } from 'src/components/pages/PagePartner' | ||
|
||
import partners from 'data/partners.json' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
パートナーの一覧を json から読み込む
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
動作は良さそうでした
コードの部分については自分はちょっと自信がないので、どなたかみていただけると助かります
data/partners.json
Outdated
{ | ||
"id": "platinum-1", | ||
"name": "株式会社 プラチナワン", | ||
"desc": "Sea tempor feugait et elit et sanctus kasd eirmod. Praesent amet qui iriure ipsum exerci clita sit et volutpat eos rebum elitr. Autem laoreet labore lorem commodo. At aliquyam sit est kasd diam nostrud adipiscing nonumy sit duo dolores in dolor suscipit. Consetetur quis ea dolore sed in magna facilisi delenit. Erat kasd at sea ex takimata feugiat. Eos tempor diam delenit adipiscing takimata. Autem diam accusam. Et nisl sanctus kasd ipsum diam odio nonumy amet. Nisl sed amet sea et clita autem nostrud dolore autem euismod invidunt. Augue blandit tempor no dolore. Et sit no duo. Diam takimata lobortis erat eos consetetur dolor ut ea amet justo eum eos invidunt ipsum nonummy justo ut." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[q]
ここのdescやnameの箇所の英/日切り替えって、この段階では実装しないという感じでしょうか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
やっても良さげですが、前年度でも会社説明の翻訳までは行ってないので、ひとまずこのままでも良いかなと思います
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
取り急ぎいくつかコメントしました!
getStaticProps
周りはのちほどみます 🙇
53cf524
to
c66083c
Compare
c66083c
to
166917d
Compare
@taigakiyokawa ひととおり対応しましたので、ご確認ください 🙏 |
src/pages/partners/[rank]/[id].tsx
Outdated
/** | ||
* partners.json から path params に対応した情報の抜き出し page の props として返す | ||
*/ | ||
export const getStaticProps: GetStaticProps<PageProps> = async context => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
引数宣言の時点で context を展開して params
にしてしまった方が読みやすいと思います。
引数を宣言する時にまとめて context
にしてしまうと、関数内で context
オブジェクトのどのプロパティを使っているのか分からないのですが、 { params }
にすると params
以外のプロパティは使っていないことが分かるので良さそうです。
export const getStaticProps: GetStaticProps<PageProps> = async context => { | |
export const getStaticProps: GetStaticProps<PageProps> = async ({ params }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM です 🙆♂️
ご対応ありがとうございます!
ありがとうございました! 🙌 |
* [fix] Fix date for closing application from Sat to Tue (#65) * feat: add GitHub template (#68) * fix: template (#69) * fix: file structure (#70) * merge main into develop (#72) * [fix] Fix date for closing application from Sat to Tue (#65) (#66) * feat: community booth section (#67) * feat: specified commercial transaction (#71) * feat: specified commercial transaction * fix typo * fix: i18n locale * fix: english explanation --------- Co-authored-by: Taiga KIYOKAWA <[email protected]> * Merge main into develop (#169) * [fix] Fix date for closing application from Sat to Tue (#65) (#66) * feat: community booth section (#67) * feat: specified commercial transaction (#71) * feat: specified commercial transaction * fix typo * fix: i18n locale * fix: english explanation * feat: add information about CfP result (#165) --------- Co-authored-by: Taiga KIYOKAWA <[email protected]> * feat: useSessionize (#171) * feat: useSettionize * add EOL * スポンサー(パートナー)ページの実装 (#170) * feat: partner page * SAMPLE json / images * fix: `desc` to `description` * fix: simplify prop type name * fix: `desc` to `description` * fix: extract params from context * feat: header with link (#172) * chore: Remove CommunityBoothSection from PageTop (#174) * chore: Temporarily change links of Header to the links to HTML pages build by Sessionize (#173) * chore: Remove `next/link` temporary for forwarding to HTML pages build by Sessionize * chore: Temporarily change links of Header to the links to HTML pages build by Sessionize * fix(HeaderMenu): Use `next/link` when href is `/` * Proposal feat: hide home label from header (#175) * feat: hide home label from header * fix header menu * comment out unused import --------- Co-authored-by: Taiga KIYOKAWA <[email protected]> Co-authored-by: sivchari <[email protected]> Co-authored-by: Shinji Nakamatsu <[email protected]>
* [fix] Fix date for closing application from Sat to Tue (#65) * feat: add GitHub template (#68) * fix: template (#69) * fix: file structure (#70) * merge main into develop (#72) * [fix] Fix date for closing application from Sat to Tue (#65) (#66) * feat: community booth section (#67) * feat: specified commercial transaction (#71) * feat: specified commercial transaction * fix typo * fix: i18n locale * fix: english explanation --------- Co-authored-by: Taiga KIYOKAWA <[email protected]> * Merge main into develop (#169) * [fix] Fix date for closing application from Sat to Tue (#65) (#66) * feat: community booth section (#67) * feat: specified commercial transaction (#71) * feat: specified commercial transaction * fix typo * fix: i18n locale * fix: english explanation * feat: add information about CfP result (#165) --------- Co-authored-by: Taiga KIYOKAWA <[email protected]> * feat: useSessionize (#171) * feat: useSettionize * add EOL * スポンサー(パートナー)ページの実装 (#170) * feat: partner page * SAMPLE json / images * fix: `desc` to `description` * fix: simplify prop type name * fix: `desc` to `description` * fix: extract params from context * feat: header with link (#172) * chore: Remove CommunityBoothSection from PageTop (#174) * chore: Temporarily change links of Header to the links to HTML pages build by Sessionize (#173) * chore: Remove `next/link` temporary for forwarding to HTML pages build by Sessionize * chore: Temporarily change links of Header to the links to HTML pages build by Sessionize * fix(HeaderMenu): Use `next/link` when href is `/` * Proposal feat: hide home label from header (#175) * feat: hide home label from header * fix header menu * comment out unused import * fix: remove community booth section (#177) * feat: community booth section (#67) * fix: remove community booth section * chore: add eslint rule (#178) * feat: community booth section (#67) * fix: remove community booth section * chore: add eslint rules --------- Co-authored-by: Taiga KIYOKAWA <[email protected]> Co-authored-by: sivchari <[email protected]> Co-authored-by: Shinji Nakamatsu <[email protected]>
* [fix] Fix date for closing application from Sat to Tue (#65) * feat: add GitHub template (#68) * fix: template (#69) * fix: file structure (#70) * merge main into develop (#72) * [fix] Fix date for closing application from Sat to Tue (#65) (#66) * feat: community booth section (#67) * feat: specified commercial transaction (#71) * feat: specified commercial transaction * fix typo * fix: i18n locale * fix: english explanation --------- Co-authored-by: Taiga KIYOKAWA <[email protected]> * Merge main into develop (#169) * [fix] Fix date for closing application from Sat to Tue (#65) (#66) * feat: community booth section (#67) * feat: specified commercial transaction (#71) * feat: specified commercial transaction * fix typo * fix: i18n locale * fix: english explanation * feat: add information about CfP result (#165) --------- Co-authored-by: Taiga KIYOKAWA <[email protected]> * feat: useSessionize (#171) * feat: useSettionize * add EOL * スポンサー(パートナー)ページの実装 (#170) * feat: partner page * SAMPLE json / images * fix: `desc` to `description` * fix: simplify prop type name * fix: `desc` to `description` * fix: extract params from context * feat: header with link (#172) * chore: Remove CommunityBoothSection from PageTop (#174) * chore: Temporarily change links of Header to the links to HTML pages build by Sessionize (#173) * chore: Remove `next/link` temporary for forwarding to HTML pages build by Sessionize * chore: Temporarily change links of Header to the links to HTML pages build by Sessionize * fix(HeaderMenu): Use `next/link` when href is `/` * Proposal feat: hide home label from header (#175) * feat: hide home label from header * fix header menu * comment out unused import * fix: remove community booth section (#177) * feat: community booth section (#67) * fix: remove community booth section * chore: add eslint rule (#178) * feat: community booth section (#67) * fix: remove community booth section * chore: add eslint rules * chore: Close sponsors application (#180) * chore: Remove the button for application to sponsors due to be already closed * chore: Fix arrangement of Gophers due to remove the button * chore: Change description to "Sponsors application has been closed.~" --------- Co-authored-by: sivchari <[email protected]> Co-authored-by: maito1201 <[email protected]> Co-authored-by: Shinji Nakamatsu <[email protected]>
※ 2022 spring では「パートナー」という呼称を使用していたので、それにならって URL やコードでは
partner
という表現にしています。※ Next.js の SSG はじめて触ったので変なことしてる可能性があります。気になる箇所あればご指摘ください 🙏
参考にしたページ (2022 Spring)
https://gocon.jp/2022spring/partners/platinum/v-standard/
現在の実装 (2023)
イメージ
ページ生成に利用するデータについて
next build
時にdata/patners.json
読み取って、その内容に従ってplatinum
およびgold
パートナーのページが生成されるようになっています。data/patners.json
はスポンサー一覧にも利用することを想定して、silver
,blonze
も登録することを想定しています。データ構造
URL (path) の構造
platinum | gold
この PR に含まれるサンプルデータでは以下のページが生成されるようになっています。 ( main マージ前に取り除く予定 )
パートナーロゴ画像の配置場所
パートナーの id に拡張子
.png
を付与したものがそのまま画像ファイル名となります。サンプルデータに対応した画像は以下のようになってます。
ローカルで SSG の動作確認
ローカルでyarn serve
を実行すると、ビルドが実行されて./out/2023
にレンダリング結果が出力され http サーバでその内容が参照できるようになります。yarn build && yarn start
で http://localhost:3000/2023 にアクセスすることで確認できます。