Skip to content
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

仮サイトをelm-pagesに移行する #21

Merged
merged 40 commits into from
Feb 2, 2025
Merged

仮サイトをelm-pagesに移行する #21

merged 40 commits into from
Feb 2, 2025

Conversation

y047aka
Copy link
Contributor

@y047aka y047aka commented Jan 28, 2025

PRチームにて、Webサイトでの elm-pages の採用が決まったので、実際に elm-pages を使った実装に置き換えます。

@y047aka y047aka marked this pull request as draft January 28, 2025 13:13
@y047aka y047aka marked this pull request as ready for review January 29, 2025 13:40
@yonta
Copy link
Contributor

yonta commented Jan 29, 2025

横長のブラウザ環境にて地図が横方向にいくらでも広がるようです。
以前のページでは地図の横幅に制限がありました。

ページ全体が画像に引いた赤線で強く揃えているので、地図も横を揃えたほうがまとまる気がします。

PR後

image

変更前

image

備考

となると、この機会にスタッフ一覧も揃えたほうがいいのか?
ページ下部だしいっぱい参加してる感があってこのままでもいいか?
というのも思いつき悩みました。

@y047aka
Copy link
Contributor Author

y047aka commented Jan 29, 2025

@yonta

横長のブラウザ環境にて地図が横方向にいくらでも広がるようです。
以前のページでは地図の横幅に制限がありました。

ページ全体が画像に引いた赤線で強く揃えているので、地図も横を揃えたほうがまとまる気がします。

確認ありがとうございます。 f282d1e にて修正しました。

となると、この機会にスタッフ一覧も揃えたほうがいいのか?
ページ下部だしいっぱい参加してる感があってこのままでもいいか?
というのも思いつき悩みました。

全てが揃っている必要はないのですが、アンバランスに見えるところは調整したくなりますね。
とはいえ1つのPRで全部をやろうとするとキリがなくなってしまうので、このPRでは elm-pages への移行に焦点を絞りたいと思います。

既存デザインの刷新は後続のPRで取り組みましょう!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

サイトのトップページの内容はこのファイルに記述します。
今は静的なページが出力できれば良いので view のみ。
動的に動かす際には ModelMsg を定義してページ単位のアプリケーションとして機能します(The Elm Architecture)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

行動規範ページの内容はこのファイルに記述します。

elm-pagesでのFile-Based Routingについては、 https://elm-pages.com/docs/file-based-routing を参照してください。

]
]
, block "本文"
[ p []
Copy link
Contributor Author

Choose a reason for hiding this comment

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

コンテンツ部分はHugoでの記述を引き継ぐ形でHTMLを記述しています。
後続のPRでMarkdownでの記述をサポート予定です。

-> (Msg -> msg)
-> View msg
-> { body : List (Html msg), title : String }
view sharedData page model toMsg pageView =
Copy link
Contributor Author

@y047aka y047aka Jan 29, 2025

Choose a reason for hiding this comment

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

各ページに共通するものは、この Shared モジュールに記述します。
現時点では、この部分でviewの共通レイアウトを定義するのみ。
ダークモードや他言語対応などをサポートする場合には、この Shared モジュールで実装することになります。

elm.json Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Elmのパッケージ(=ライブラリ)は Elm Packages に公開されています。
このファイルで使用するパッケージを管理します。

npx elm install elm/html

のようにしてインストール可能。
インストールが完了すると、ここに記述が増えます。

style.css Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

現時点ではCSSファイルにスタイルを記述しています。
PRチームのMTGにて CSS in JS に準じた手法の採用が決まったので、後続PRで作業予定。
https://package.elm-lang.org/packages/rtfeldman/elm-css/latest/ を使います。

@y047aka
Copy link
Contributor Author

y047aka commented Jan 30, 2025

メモ:

  • elm-pagesがGithub Pagesのサブディレクトリに対するデプロイで上手く動作しない可能性がある
  • このリポジトリでも同様の懸念はあるのですが、ここではカスタムドメインを使っているため実際の問題にはならないはず
    • 昨年まで個人のブログをelm-pagesで同様に運用していたので、おそらく大丈夫
  • どうやら issue があるっぽいので、見つけたらリンク追加しておきます。
  • これかな Broken elm-pages build --base - only changes outputs partially dillonkearns/elm-pages#404

@y047aka
Copy link
Contributor Author

y047aka commented Feb 2, 2025

マージしてみます。

@y047aka y047aka merged commit b312dbd into main Feb 2, 2025
@y047aka y047aka deleted the elm-pages branch February 2, 2025 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants