upstream #1

Merged
jblu merged 1007 commits from upstream into main 2024-11-04 22:35:57 -06:00
4 changed files with 30 additions and 22 deletions
Showing only changes of commit ed290bfcdd - Show all commits

View File

@ -16,6 +16,7 @@ module.exports = {
browser: true, browser: true,
amd: true, amd: true,
node: true, node: true,
es6: true,
}, },
extends: [ extends: [
'eslint:recommended', 'eslint:recommended',

View File

@ -6,6 +6,7 @@ tags: ['next-js', 'tailwind', 'guide']
draft: false draft: false
summary: 'Looking for a performant, out of the box template, with all the best in web technology to support your blogging needs? Checkout the Tailwind Nextjs Starter Blog template.' summary: 'Looking for a performant, out of the box template, with all the best in web technology to support your blogging needs? Checkout the Tailwind Nextjs Starter Blog template.'
images: ['/static/images/canada/mountains.jpg', '/static/images/canada/toronto.jpg'] images: ['/static/images/canada/mountains.jpg', '/static/images/canada/toronto.jpg']
authors: ['default', 'sparrowhawk']
--- ---
![tailwind-nextjs-banner](/static/images/twitter-card.png) ![tailwind-nextjs-banner](/static/images/twitter-card.png)

View File

@ -46,26 +46,28 @@ export default function PostLayout({ frontMatter, authorDetails, next, prev, chi
<dt className="sr-only">Authors</dt> <dt className="sr-only">Authors</dt>
<dd> <dd>
<ul className="flex justify-center space-x-8 xl:block sm:space-x-12 xl:space-x-0 xl:space-y-8"> <ul className="flex justify-center space-x-8 xl:block sm:space-x-12 xl:space-x-0 xl:space-y-8">
<li className="flex items-center space-x-2"> {authorDetails.map((author) => (
<img <li className="flex items-center space-x-2" key={author.name}>
src={authorDetails.avatar} {author.avatar && (
alt="avatar" <img src={author.avatar} alt="avatar" className="w-10 h-10 rounded-full" />
className="w-10 h-10 rounded-full" )}
/>
<dl className="text-sm font-medium leading-5 whitespace-nowrap"> <dl className="text-sm font-medium leading-5 whitespace-nowrap">
<dt className="sr-only">Name</dt> <dt className="sr-only">Name</dt>
<dd className="text-gray-900 dark:text-gray-100">{authorDetails.name}</dd> <dd className="text-gray-900 dark:text-gray-100">{author.name}</dd>
<dt className="sr-only">Twitter</dt> <dt className="sr-only">Twitter</dt>
<dd> <dd>
{author.twitter && (
<Link <Link
href={authorDetails.twitter} href={author.twitter}
className="text-blue-500 hover:text-blue-600 dark:hover:text-blue-400" className="text-blue-500 hover:text-blue-600 dark:hover:text-blue-400"
> >
{authorDetails.twitter.replace('https://twitter.com/', '@')} {author.twitter.replace('https://twitter.com/', '@')}
</Link> </Link>
)}
</dd> </dd>
</dl> </dl>
</li> </li>
))}
</ul> </ul>
</dd> </dd>
</dl> </dl>

View File

@ -24,8 +24,12 @@ export async function getStaticProps({ params }) {
const prev = allPosts[postIndex + 1] || null const prev = allPosts[postIndex + 1] || null
const next = allPosts[postIndex - 1] || null const next = allPosts[postIndex - 1] || null
const post = await getFileBySlug('blog', params.slug) const post = await getFileBySlug('blog', params.slug)
const postAuthor = post.frontMatter.author || 'default' const authorList = post.frontMatter.authors || ['default']
const { frontMatter: authorDetails } = await getFileBySlug('authors', [postAuthor]) const authorPromise = authorList.map(async (author) => {
const authorResults = await getFileBySlug('authors', [author])
return authorResults.frontMatter
})
const authorDetails = await Promise.all(authorPromise)
// rss // rss
const rss = generateRss(allPosts) const rss = generateRss(allPosts)