Add last-updated to default listing template

This commit is contained in:
Sam Carlton 2022-04-29 13:30:54 -05:00
parent ab2dbe2cd6
commit fcbca7ae1c
2 changed files with 36 additions and 0 deletions

View file

@ -10,6 +10,7 @@ import RelatedLinks from '~/src/components/listing-parts/related-links.astro'
import Devices from '~/src/components/listing-parts/devices.astro'
import RelatedVideos from '~/src/components/listing-parts/related-videos.astro'
import Bundles from '~/src/components/listing-parts/bundles.astro'
import LastUpdated from '~/src/components/listing-parts/last-updated.astro'
import AllUpdatesSubscribe from '~/components/all-updates-subscribe.vue'
@ -65,4 +66,8 @@ const details = new ListingDetails( listing )
listing={ listing }
/>
<LastUpdated
listing={ listing }
/>
</section>

View file

@ -0,0 +1,31 @@
---
import { makeLastUpdatedFriendly } from '~/helpers/parse-date.js'
const {
listing
} = Astro.props
console.log( 'listing.lastUpdated', listing.lastUpdated )
const lastUpdatedFriendly = makeLastUpdatedFriendly( listing.lastUpdated )
---
<div class="report-update text-xs text-center w-full shadow-none py-24">
{ lastUpdatedFriendly !== null &&
<div>
<time
datetime={ listing.lastUpdated.raw }
>
Last Updated { lastUpdatedFriendly }
</time>
</div>
}
<!-- https://eric.blog/2016/01/08/prefilling-github-issues/ -->
<a
href={ `https://github.com/ThatGuySam/doesitarm/issues?q=is%3Aissue+${ listing.name }` }
target="_blank"
class="underline"
rel="noopener"
>Report Update</a>
</div>