mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Add initial kind page
This commit is contained in:
parent
5992a0a51b
commit
cf5ba18cd8
1 changed files with 69 additions and 0 deletions
69
src/pages/kind/[...kindPath].astro
Normal file
69
src/pages/kind/[...kindPath].astro
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
---
|
||||
// Full Astro Component Syntax:
|
||||
// https://docs.astro.build/core-concepts/astro-components/
|
||||
|
||||
|
||||
// import { ListingDetails } from '~/helpers/listing-page.js'
|
||||
import { getPathPartsFromAstroRequest } from '~/helpers/url.js'
|
||||
import { catchRedirectResponse } from '~/helpers/astro/request.js'
|
||||
|
||||
import Layout from '../../layouts/default.astro'
|
||||
import Listing from '../../components/default-listing.astro'
|
||||
|
||||
// const {
|
||||
// appPath
|
||||
// } = Astro.params
|
||||
|
||||
|
||||
|
||||
// Get type and slug from the request path
|
||||
// so that we don't have extra parts for
|
||||
// urls like /:type/:slug/benchmarks
|
||||
const pathParts = getPathPartsFromAstroRequest( Astro.request )
|
||||
|
||||
// Create an empty API URL
|
||||
const apiUrl = new URL( import.meta.env.PUBLIC_API_DOMAIN )
|
||||
|
||||
// Use request path parts to set api url path
|
||||
// apiUrl.pathname = `/api/${ pathType }/${ pathSlug }.json`
|
||||
|
||||
|
||||
// Astro Request reference
|
||||
// https://docs.astro.build/en/reference/api-reference/#astrorequests
|
||||
|
||||
// console.log('Astro.params', Astro.params )
|
||||
// console.log('Astro.request.url', Astro.request.url )
|
||||
// console.log('Astro.site.pathname', Astro.site.pathname )
|
||||
// console.log('Astro.request', Astro.request )
|
||||
|
||||
// const appListing = await axios.get( apiUrl.toString() )
|
||||
// .then( response => {
|
||||
// // console.log( 'response', response )
|
||||
// return response.data
|
||||
// })
|
||||
|
||||
// const listingDetails = new ListingDetails( appListing )
|
||||
|
||||
|
||||
const redirectResponse = await catchRedirectResponse( Astro )
|
||||
|
||||
if ( redirectResponse !== null ) {
|
||||
return redirectResponse
|
||||
}
|
||||
|
||||
---
|
||||
<Layout
|
||||
headOptions={{
|
||||
title: 'Test',
|
||||
description: 'Test',
|
||||
// meta,
|
||||
// link,
|
||||
// structuredData: this.structuredData,
|
||||
|
||||
// domain,
|
||||
pathname: '/test',
|
||||
}}
|
||||
>
|
||||
|
||||
Kind: { JSON.stringify( pathParts ) }
|
||||
</Layout>
|
||||
Loading…
Add table
Add a link
Reference in a new issue