File tree Expand file tree Collapse file tree
apps/dialtone-documentation/docs/.vuepress/baseComponents Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323 :size =" 300"
2424 :seed =" author"
2525 :full-name =" author"
26+ :image-src =" avatarSrc"
27+ :image-alt =" `${author} avatar`"
2628 />
2729 <dt-stack >
2830 <dt-text :size =" 200" kind =" label" tone =" secondary" density =" 200" >
5658import { format } from ' date-fns' ;
5759import { computed } from ' vue' ;
5860import CopyButton from ' ./CopyButton.vue' ;
61+ import { authorAvatarUrl } from ' ./authorHandles.js' ;
5962
60- defineProps ({
63+ const props = defineProps ({
6164 posted: {
6265 type: Date ,
6366 required: true ,
@@ -80,6 +83,8 @@ defineProps({
8083 },
8184});
8285
86+ const avatarSrc = computed (() => authorAvatarUrl (props .author ));
87+
8388const blogLink = computed (() => {
8489 return window .location .href ;
8590});
Original file line number Diff line number Diff line change 1+ export const authorHandles = {
2+ 'Brad Paugh' : 'braddialpad' ,
3+ 'Francis Rupert' : 'francisrupert' ,
4+ 'Tico Ortega' : 'juliodialpad' ,
5+ 'Nina Repetto' : 'ninarepetto' ,
6+ 'Yorbi Barriento' : 'yorbi-dp' ,
7+ 'Julio Ortega' : 'juliodialpad' ,
8+ 'Federico Sarassola' : 'fede-dp' ,
9+ 'Josh Everhart' : 'jeverhart-dialpad' ,
10+ 'Joshua Hynes' : 'hynes-dialpad' ,
11+ 'Belu Montoya' : 'belumontoya' ,
12+ 'Ignacio Ropolo' : 'iropolo' ,
13+ 'Paulo Reis' : 'paulojreis-dialpad' ,
14+ } ;
15+
16+ // Returns the GitHub avatar URL for an author, or '' if unmapped.
17+ // '' means DtAvatar renders seeded initials (the unmapped fallback).
18+ export function authorAvatarUrl ( author ) {
19+ const handle = authorHandles [ author ] ;
20+ return handle ? `https://github.com/${ handle } .png` : '' ;
21+ }
You can’t perform that action at this time.
0 commit comments