diff --git a/src/components/overrides/LastUpdated.astro b/src/components/overrides/LastUpdated.astro index b793d504b..821a9f379 100644 --- a/src/components/overrides/LastUpdated.astro +++ b/src/components/overrides/LastUpdated.astro @@ -1,5 +1,6 @@ --- import { REPO, getCommitInfo } from "../../utils/git"; +import { Image } from "astro:assets"; const { lang, lastUpdated } = Astro.locals.starlightRoute; const filePath = Astro.locals.starlightRoute.entry.filePath; @@ -21,7 +22,20 @@ const info = await getCommitInfo(filePath); {" "} {info && ( - by {info.committer.name} + by{" "} + + {info.committer.avatar && ( + {info.committer.name} + )} + {info.committer.name} + {" "} in {info.hash.substring(0, 7)} )} @@ -38,4 +52,11 @@ const info = await getCommitInfo(filePath); .nowrap { white-space: nowrap; } + + .avatar { + vertical-align: middle; + border-radius: 50%; + margin-left: 1px; + margin-right: 4px; + } diff --git a/src/utils/git.ts b/src/utils/git.ts index abdf4ddd6..8d051a3a9 100644 --- a/src/utils/git.ts +++ b/src/utils/git.ts @@ -3,6 +3,7 @@ import { execSync } from "child_process"; export interface CommitterInfo { name: string; href: string; + avatar?: string; } export interface CommitInfo { @@ -47,6 +48,7 @@ export const getCommitInfo = async (filePath: string): Promise