File tree Expand file tree Collapse file tree 5 files changed +16
-7
lines changed
Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ kind: festival
1111status : finished
1212date : 2025-11-21
1313
14+ # renderの起動待ちでfavicon自動取得は時間がかかる & favicon存在しない
15+ favicon : null
1416thumbnail :
1517 src : ./thumbnail.png
1618---
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ kind: festival
1313status : finished
1414date : 2024-05-18
1515
16+ # renderの起動待ちでfavicon自動取得は時間がかかる & favicon存在しない
17+ favicon : null
1618thumbnail :
1719 src : ./thumbnail.png
1820---
Original file line number Diff line number Diff line change 3030| ` thumbnail.src ` | ✅ | string->path | イメージファイルへの markdown からの相対パス。 |
3131| ` thumbnail.fit ` | | string? | イメージのクロップ方法。 default = "cover"。 |
3232| ` thumbnail.bg ` | | string? | イメージの背景色。ロード中と ` crop ` = "contain" のときの背景に使われています。 |
33- | ` favicon ` | | string->path? | 強制的に使わせる Favicon。指定しない場合は、アプリの URL から自動で引っ張ってきます。 |
33+ | ` favicon ` | | string->path? \| null | 強制的に使わせる Favicon。指定しない場合は、アプリの URL から自動で引っ張ってきます。 ` null ` を指定した場合は、Faviconは存在しないものとみなしアプリのURLを自動でfetchしません。 |
3434| ` social.github ` | | string->url? | プロジェクトの GitHub 上での URL。 |
3535| ` social.website ` | | string->url? | プロジェクトのウェブサイトの URL。(` app.url ` と別で広報用などの Website がある場合) |
3636| ` social.youtube ` | | string->url? | プロジェクトの YouTube 上での URL。 |
Original file line number Diff line number Diff line change @@ -22,12 +22,17 @@ const { Content } = await render(project);
2222
2323let iconSrc: string | undefined ;
2424if (project .data .status !== " dead" ) {
25- if (project .data .favicon ) iconSrc = project .data .favicon .src ;
26- if (! iconSrc && project .data .app .url ) {
27- iconSrc = await fetchFavicon (project .data .app .url );
28- }
29- if (! iconSrc && project .data .social ?.website ) {
25+ if (project .data .favicon === null ) {
26+ iconSrc = undefined ;
27+ }else if (project .data .favicon ){
28+ iconSrc = project .data .favicon .src ;
29+ } else {
30+ if (! iconSrc && project .data .app .url ) {
31+ iconSrc = await fetchFavicon (project .data .app .url );
32+ }
33+ if (! iconSrc && project .data .social ?.website ) {
3034 iconSrc = await fetchFavicon (project .data .social .website );
35+ }
3136 }
3237}
3338---
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ export const CreateProjectSchema = ({ image }: { image: ImageFunction }) =>
7474 order : z . number ( ) . optional ( ) ,
7575 date : z . date ( ) ,
7676 thumbnail : Thumbnail ( { image } ) . optional ( ) ,
77- favicon : image ( ) . optional ( ) ,
77+ favicon : image ( ) . nullable ( ) . optional ( ) ,
7878 tags : z . array ( z . string ( ) ) . optional ( ) . default ( [ ] ) ,
7979 social : z
8080 . object ( {
You can’t perform that action at this time.
0 commit comments