Non-official site for The Life Series Minecraft hardcore survival multiplayer series housing every video www.life-series.online
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Seasons link (#63)

* seasons link

* Change favicon based on season page

authored by

Ghustvn and committed by
GitHub
b9b3765f 90d4e58a

+45 -23
src/assets/rewrite/images/seasons/favicons/3rd-life.png

This is a binary file and will not be displayed.

src/assets/rewrite/images/seasons/favicons/double-life.png

This is a binary file and will not be displayed.

src/assets/rewrite/images/seasons/favicons/last-life.png

This is a binary file and will not be displayed.

src/assets/rewrite/images/seasons/favicons/limited-life.png

This is a binary file and will not be displayed.

src/assets/rewrite/images/seasons/favicons/past-life.png

This is a binary file and will not be displayed.

src/assets/rewrite/images/seasons/favicons/secret-life.png

This is a binary file and will not be displayed.

src/assets/rewrite/images/seasons/favicons/wild-life.png

This is a binary file and will not be displayed.

+14 -15
src/components/rewrite/SiteHeader.astro
··· 14 14 <header> 15 15 <div class="cluster header-inner"> 16 16 <div class="cluster"> 17 - <div class="cluster gap-text-icon header-season"> 18 - <Image 19 - src={getSeasonIconImage(season.id)} 20 - alt="" 21 - loading="eager" 22 - width="64" 23 - /> 24 - <div>{season.data.title}</div> 25 - </div> 17 + <a href="/rewrite"> 18 + <span class="cluster gap-text-icon"> 19 + <Image 20 + src={getSeasonIconImage(season.id)} 21 + alt="" 22 + loading="eager" 23 + width="64" 24 + class="season-image" 25 + /> 26 + <span>Seasons</span> 27 + </span> 28 + </a> 26 29 <slot name="inline-start-links" /> 27 30 </div> 28 31 <div class="cluster"> ··· 66 69 } 67 70 } 68 71 69 - .header-season { 70 - font-weight: var(--font-weight-heading); 71 - 72 - img { 73 - max-width: 32px; 74 - } 72 + .season-image { 73 + max-width: 32px; 75 74 } 76 75 </style>
+10 -2
src/layouts/rewrite/BaseLayout.astro
··· 4 4 import CustomCursor from '@/components/rewrite/CustomCursor.astro'; 5 5 import '@/styles/rewrite/global.css'; 6 6 7 - const { title } = Astro.props; 7 + interface Props { 8 + title: string; 9 + favicon?: string; 10 + } 11 + 12 + const { title, favicon } = Astro.props; 8 13 --- 9 14 10 15 <html lang="en"> ··· 12 17 <script is:inline>document.documentElement.classList.add('js')</script> 13 18 <meta charset="utf-8" /> 14 19 <meta name="theme-color" content="#d9ebd2" /> 15 - <link rel="icon" href="/rewrite/favicon.png" /> 20 + {favicon 21 + ? <link rel="icon" href={favicon} /> 22 + : <link rel="icon" href="/rewrite/favicon.png" /> 23 + } 16 24 <!-- TODO --> 17 25 <!-- <link rel="sitemap" href="/sitemap-index.xml" /> --> 18 26 <meta name="viewport" content="width=device-width" />
+3 -2
src/pages/rewrite/seasons/[season_id].astro
··· 5 5 import SeasonLayout from '@/components/rewrite/SeasonLayout.astro'; 6 6 import SkipLink from '@/components/rewrite/SkipLink.astro'; 7 7 import BaseLayout from '@/layouts/rewrite/BaseLayout.astro'; 8 - import { getSeasonOGImage } from '@/utils/rewrite/images'; 8 + import { getSeasonFaviconImage, getSeasonOGImage } from '@/utils/rewrite/images'; 9 9 10 10 const { isRewrite } = Astro.locals; 11 11 if (!isRewrite) { ··· 34 34 35 35 const ogTitle = season.data.title; 36 36 const ogDescription = `Watch all point of views of ${season.data.title}`; 37 + const faviconImage = (await getSeasonFaviconImage(season.id)).default.src; 37 38 const ogImage = (await getSeasonOGImage(season.id)).default.src; 38 39 const ogImageAlt = `The Life Series logo - ${season.data.title}`; 39 40 --- 40 41 41 - <BaseLayout title={pageTitle}> 42 + <BaseLayout title={pageTitle} favicon={faviconImage}> 42 43 <SEO 43 44 slot="seo" 44 45 title={ogTitle}
+3 -2
src/pages/rewrite/seasons/[season_id]/[member_name].astro
··· 7 7 import SkipLink from '@/components/rewrite/SkipLink.astro'; 8 8 import VideoItem from '@/components/rewrite/VideoItem.astro'; 9 9 import BaseLayout from '@/layouts/rewrite/BaseLayout.astro'; 10 - import { getSeasonOGImage } from '@/utils/rewrite/images'; 10 + import { getSeasonFaviconImage, getSeasonOGImage } from '@/utils/rewrite/images'; 11 11 12 12 const { isRewrite } = Astro.locals; 13 13 if (!isRewrite) { ··· 60 60 61 61 const ogTitle = `${member.data.name} in ${season.data.title}`; 62 62 const ogDescription = `Watch all sessions from ${member.data.name} point of view of ${season.data.title}`; 63 + const faviconImage = (await getSeasonFaviconImage(season.id)).default.src; 63 64 const ogImage = (await getSeasonOGImage(season.id)).default.src; 64 65 const ogImageAlt = `The Life Series logo - ${season.data.title}`; 65 66 --- 66 67 67 - <BaseLayout title={pageTitle}> 68 + <BaseLayout title={pageTitle} favicon={faviconImage}> 68 69 <SEO 69 70 slot="seo" 70 71 title={ogTitle}
+3 -2
src/pages/rewrite/seasons/[season_id]/sessions/[session_id].astro
··· 6 6 import SkipLink from '@/components/rewrite/SkipLink.astro'; 7 7 import VideoItem from '@/components/rewrite/VideoItem.astro'; 8 8 import BaseLayout from '@/layouts/rewrite/BaseLayout.astro'; 9 - import { getSeasonOGImage } from '@/utils/rewrite/images'; 9 + import { getSeasonFaviconImage, getSeasonOGImage } from '@/utils/rewrite/images'; 10 10 import { isCurrentPage } from '@/utils/url'; 11 11 12 12 const { isRewrite } = Astro.locals; ··· 57 57 58 58 const ogTitle = `Session ${sessionNumber} of ${season.data.title}`; 59 59 const ogDescription = `Watch all point of views from session ${sessionNumber} of ${season.data.title}`; 60 + const faviconImage = (await getSeasonFaviconImage(season.id)).default.src; 60 61 const ogImage = (await getSeasonOGImage(season.id)).default.src; 61 62 const ogImageAlt = `The Life Series logo - ${season.data.title}`; 62 63 --- 63 64 64 - <BaseLayout title={pageTitle}> 65 + <BaseLayout title={pageTitle} favicon={faviconImage}> 65 66 <SEO 66 67 slot="seo" 67 68 title={ogTitle}
+12
src/utils/rewrite/images.ts
··· 12 12 )(); 13 13 } 14 14 15 + export async function getSeasonFaviconImage(season: string) { 16 + const seasonImages = import.meta.glob<{ default: ImageMetadata }>( 17 + '/src/assets/rewrite/images/seasons/favicons/*', 18 + ); 19 + return ( 20 + seasonImages[ 21 + `/src/assets/rewrite/images/seasons/favicons/${season}.png` 22 + ] ?? 23 + seasonImages[`/src/assets/rewrite/images/seasons/favicons/3rd-life.png`] 24 + )(); 25 + } 26 + 15 27 export async function getSeasonImage(season: string) { 16 28 const seasonImages = import.meta.glob<{ default: ImageMetadata }>( 17 29 '/src/assets/rewrite/images/seasons/*',