From e72029d2ded4ce75e29f3e2c3b7a5315c5a1a077 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Wed, 27 Apr 2022 13:10:26 -0500 Subject: [PATCH] Add headings to app template --- src/components/default-listing.astro | 40 +++++++++++++++++++ .../{[...slug].astro => [...appPath].astro} | 24 +++++------ 2 files changed, 52 insertions(+), 12 deletions(-) create mode 100644 src/components/default-listing.astro rename src/pages/app/{[...slug].astro => [...appPath].astro} (85%) diff --git a/src/components/default-listing.astro b/src/components/default-listing.astro new file mode 100644 index 0000000..e19e29e --- /dev/null +++ b/src/components/default-listing.astro @@ -0,0 +1,40 @@ +--- +// Default Listing template for Apps, Games, and formulas + +import { + ListingDetails +} from '~/helpers/listing-page.js' + +import AllUpdatesSubscribe from '~/components/all-updates-subscribe.vue' + + +const { + listing +} = Astro.props + +const details = new ListingDetails( listing ) + +--- +
+ +
+

+ { details.mainHeading } +

+

+ { details.subtitle } +

+ + + + + + + +
+ +
diff --git a/src/pages/app/[...slug].astro b/src/pages/app/[...appPath].astro similarity index 85% rename from src/pages/app/[...slug].astro rename to src/pages/app/[...appPath].astro index d16af30..6112cd2 100644 --- a/src/pages/app/[...slug].astro +++ b/src/pages/app/[...appPath].astro @@ -5,12 +5,12 @@ import axios from 'axios' import Layout from '../../layouts/default.astro' +import Listing from '../../components/default-listing.astro' import { makeLastUpdatedFriendly } from '~/helpers/parse-date' import { getAppEndpoint } from '~/helpers/app-derived.js' import LinkButton from '~/components/link-button.vue' -import AllUpdatesSubscribe from '~/components/all-updates-subscribe.vue' import VideoRow from '~/components/video/row.vue' // import appList from '~/static/app-list.json' @@ -29,9 +29,9 @@ import VideoRow from '~/components/video/row.vue' // } -const { - slug -} = Astro.params +// const { +// appPath +// } = Astro.params // Parse the request url @@ -58,7 +58,7 @@ console.log('Astro.request.url', Astro.request.url ) console.log('Astro.site.pathname', Astro.site.pathname ) // console.log('Astro.request', Astro.request ) -const appEntry = await axios.get( apiUrl.toString() ) +const appListing = await axios.get( apiUrl.toString() ) .then( response => { // console.log( 'response', response ) return response.data @@ -80,15 +80,15 @@ const lastUpdatedFriendly = null --- - { slug } -
-
- { JSON.stringify( appEntry ) } - + +