This commit is contained in:
parent
0afe61add2
commit
2af757d5bd
12 changed files with 83 additions and 9 deletions
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
export interface Props {
|
||||
baseurl: string
|
||||
slug: string
|
||||
title: string
|
||||
releaseDate: Date
|
||||
|
@ -12,8 +13,8 @@ const options_date: Intl.DateTimeFormatOptions = {
|
|||
day: '2-digit',
|
||||
}
|
||||
|
||||
const { shortdescription, releaseDate, slug, title } = Astro.props
|
||||
const url = `/database/${slug}`
|
||||
const { shortdescription, releaseDate, slug, title, baseurl } = Astro.props
|
||||
const url = `/${baseurl}/${slug}`
|
||||
const render_date = releaseDate.toLocaleDateString(
|
||||
'en-GB',
|
||||
options_date
|
||||
|
|
|
@ -36,4 +36,5 @@ const taData = defineCollection({
|
|||
|
||||
export const collections = {
|
||||
taInfoData: taData,
|
||||
teslafest: taData,
|
||||
}
|
||||
|
|
24
src/content/teslafest/gc-summer-4.json
Normal file
24
src/content/teslafest/gc-summer-4.json
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"info": {
|
||||
"title": "Giga Coil - Western Arts Ninja Style",
|
||||
"releaseDate": "2024-03-28",
|
||||
"shortdescription": "Fuuma Quest",
|
||||
"releaseNumber": 1
|
||||
},
|
||||
"quests": [
|
||||
{
|
||||
"questTitle": "Giga Coil - Western Arts Ninja Style",
|
||||
"description": "aaa",
|
||||
"data": [
|
||||
{
|
||||
"title": "Skadi 3T",
|
||||
"link": "https://www.youtube.com/watch?v=VMVus__ZYXE",
|
||||
"date": "2024-03-30",
|
||||
"servant": "skadi",
|
||||
"turns": "3T",
|
||||
"runner": "Firq"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -5,6 +5,7 @@ import navdata from '../../static/data/_navdata.json'
|
|||
import embed from '../assets/embed.png'
|
||||
import home from 'iconoir/icons/home.svg'
|
||||
import database from 'iconoir/icons/database.svg'
|
||||
import databasestar from 'iconoir/icons/database-star.svg'
|
||||
import mail from 'iconoir/icons/mail.svg'
|
||||
import type { IconsLookup } from '../types/generic'
|
||||
|
||||
|
@ -17,6 +18,7 @@ export interface Props {
|
|||
const icons: IconsLookup = {
|
||||
home: home,
|
||||
database: database,
|
||||
databasestar: databasestar,
|
||||
about: mail
|
||||
}
|
||||
|
||||
|
|
|
@ -5,11 +5,13 @@ import TACard from '../components/taCard.astro'
|
|||
import { plsLoadTAEntry } from '../utils/tools'
|
||||
|
||||
export interface Props {
|
||||
collection: "teslafest" | "taInfoData"
|
||||
collectionKey: string
|
||||
baseurl: "database" | "teslafest"
|
||||
}
|
||||
|
||||
const { collectionKey } = Astro.props
|
||||
const taEntry = await plsLoadTAEntry(collectionKey)
|
||||
const { collection, collectionKey, baseurl } = Astro.props
|
||||
const taEntry = await plsLoadTAEntry(collectionKey, collection)
|
||||
const pagetitle = `${taEntry.info.title} - FGO TA`
|
||||
---
|
||||
|
||||
|
@ -18,7 +20,7 @@ const pagetitle = `${taEntry.info.title} - FGO TA`
|
|||
currentpage="database-entry"
|
||||
descriptionOverride={taEntry.info.shortdescription}
|
||||
>
|
||||
<a href="/database"><< Back to database</a>
|
||||
<a href=`/${baseurl}`><< Back to database</a>
|
||||
{
|
||||
taEntry.quests.map((item) => (
|
||||
<BaseSection title={item.questTitle} description={item.description}>
|
||||
|
|
|
@ -10,4 +10,4 @@ export async function getStaticPaths() {
|
|||
const { slug } = Astro.params
|
||||
---
|
||||
|
||||
<TaShowcaseLayout collectionKey={slug} />
|
||||
<TaShowcaseLayout collection="taInfoData" collectionKey={slug} baseurl="database"/>
|
||||
|
|
|
@ -19,7 +19,7 @@ fulldata.sort(
|
|||
descriptionOverride={description}
|
||||
>
|
||||
<DatabaseSection title="FGO NA TA Database">
|
||||
{fulldata.map((quest) => <QuestListing { ...{...quest.data.info, slug: quest.id} } />)}
|
||||
{fulldata.map((quest) => <QuestListing { ...{...quest.data.info, slug: quest.id} } baseurl="database" />)}
|
||||
</DatabaseSection>
|
||||
</Layout>
|
||||
|
||||
|
|
13
src/pages/teslafest/[slug].astro
Normal file
13
src/pages/teslafest/[slug].astro
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
import { getCollection } from 'astro:content';
|
||||
import TaShowcaseLayout from '../../layouts/taShowcaseLayout.astro'
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const fulldata = (await getCollection('teslafest')).map((data) => data.id)
|
||||
return fulldata.map((slug) => ({ params: { slug } }))
|
||||
}
|
||||
|
||||
const { slug } = Astro.params
|
||||
---
|
||||
|
||||
<TaShowcaseLayout collection="teslafest" collectionKey={slug} baseurl="teslafest" />
|
26
src/pages/teslafest/index.astro
Normal file
26
src/pages/teslafest/index.astro
Normal file
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
import { getCollection } from 'astro:content';
|
||||
import Layout from '../../layouts/Layout.astro'
|
||||
import QuestListing from '../../components/questListing.astro'
|
||||
import DatabaseSection from '../../layouts/databaseSection.astro'
|
||||
|
||||
const description = 'NA Teslafest'
|
||||
const fulldata = await getCollection('teslafest')
|
||||
|
||||
fulldata.sort(
|
||||
(a, b) => b.data.info.releaseDate.valueOf() - a.data.info.releaseDate.valueOf() || b.data.info.releaseNumber - a.data.info.releaseNumber
|
||||
)
|
||||
|
||||
---
|
||||
|
||||
<Layout
|
||||
title="Teslafest - FGO TA"
|
||||
currentpage="teslafest"
|
||||
descriptionOverride={description}
|
||||
>
|
||||
<DatabaseSection title="Teslafest - All Quests">
|
||||
{fulldata.map((quest) => <QuestListing { ...{...quest.data.info, slug: quest.id} } baseurl="teslafest" />)}
|
||||
</DatabaseSection>
|
||||
</Layout>
|
||||
|
||||
<style></style>
|
|
@ -7,8 +7,8 @@ export function plsLoadImage(record: ImportRecord<GlobImage>, path: string) {
|
|||
return loadedImage
|
||||
}
|
||||
|
||||
export async function plsLoadTAEntry(key: string) {
|
||||
const filecontent = (await getEntry('taInfoData', key))?.data
|
||||
export async function plsLoadTAEntry(key: string, file: "taInfoData" | "teslafest" = 'taInfoData') {
|
||||
const filecontent = (await getEntry(file, key))?.data
|
||||
if (!filecontent) throw new Error(`Datafile was not found for key ${key}`)
|
||||
return filecontent
|
||||
}
|
||||
|
|
|
@ -8,5 +8,10 @@
|
|||
"link": "/database",
|
||||
"text": "TA Database",
|
||||
"icon": "database"
|
||||
},
|
||||
{
|
||||
"link": "/teslafest",
|
||||
"text": "Teslafest",
|
||||
"icon": "databasestar"
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue