-
Notifications
You must be signed in to change notification settings - Fork 5
Issue #536: Fix Blog Authors showing incorrectly #549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| --- | ||
| import { getEntry, render } from "astro:content"; | ||
| import { getBlogCatalog, type BlogCatalog } from "@lib/blog"; | ||
| import { formatAuthorName, getBlogCatalog, type BlogCatalog } from "@lib/blog"; | ||
| import { getOpenGraphImageData } from "@lib/og-image"; | ||
| import { isEmpty, kebabCase, startCase } from "lodash-es"; | ||
|
|
||
|
|
@@ -53,12 +53,6 @@ const metadata: PageMetadata = { | |
| ), | ||
| }; | ||
|
|
||
| function formatName(author) { | ||
| const { name, cited = undefined } = author.data; | ||
| const { first, middle, last } = cited || name; | ||
| return [first, middle, last].filter((n) => n).join(" "); | ||
| } | ||
|
|
||
| const { Content } = await render(blog); | ||
|
|
||
| import components from "../lib/mdx"; | ||
|
|
@@ -75,7 +69,7 @@ import ThemedSection from "@components/ThemedSection.astro"; | |
| property="article:published_time" | ||
| content={blog.data.published.toISOString()} | ||
| /> | ||
| <meta property="article:author" content={formatName(blogAuthor)} /> | ||
| <meta property="article:author" content={formatAuthorName(blogAuthor)} /> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue that copilot is calling out was not introduced by these changes as blogAuthor was used in the previous version. <TeamVignette member={blogAuthor} />When I ran astro check, which runs typescript checks under the hood, no errors were flagged for BlogLayout.astro
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for checking this! |
||
| <meta property="article:section" content="Accessibility" /> | ||
| {blog.data.tags.map((tag) => <meta property="article:tag" content={tag} />)} | ||
| </Fragment> | ||
|
|
@@ -154,7 +148,7 @@ import ThemedSection from "@components/ThemedSection.astro"; | |
| {authors.map((author) => ( | ||
| <li> | ||
| <a href={`/blog/authors/${author.id}`}> | ||
| {formatName(author)} | ||
| {formatAuthorName(author)} | ||
| </a> | ||
| </li> | ||
| ))} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not to reviewer: This was moved to blog.ts so it could be reused in multiple pages