File tree Expand file tree Collapse file tree 1 file changed +11
-19
lines changed
apps/svelte.dev/src/routes/packages Expand file tree Collapse file tree 1 file changed +11
-19
lines changed Original file line number Diff line number Diff line change 1717 hour: ' numeric' ,
1818 minute: ' numeric'
1919 });
20+
21+ const href = $derived (pkg .homepage || pkg .repo_url || ` https://npmjs.org/package/${pkg .name } ` );
2022 </script >
2123
2224<article >
23- {#snippet contents ()}
25+ <a
26+ class =" contents"
27+ {href }
28+ target ={href .startsWith (' /' ) ? null : ' _blank' }
29+ rel =" noreferrer"
30+ aria-label =" View project homepage"
31+ onclick ={(e ) => e .stopPropagation ()}
32+ >
2433 <header >
2534 <h3 >
2635 {#if pkg .official }
5867
5968 <span style =" flex: 1 1 auto" ></span >
6069 </p >
61- {/ snippet }
62-
63- {#if pkg .homepage }
64- <a
65- class =" contents"
66- href ={pkg .homepage }
67- target ={pkg .homepage .startsWith (' /' ) ? null : ' _blank' }
68- rel =" noreferrer"
69- aria-label =" View project homepage"
70- onclick ={(e ) => e .stopPropagation ()}
71- >
72- {@render contents ()}
73- </a >
74- {:else }
75- <div class =" contents" >
76- {@render contents ()}
77- </div >
78- {/if }
70+ </a >
7971
8072 <!-- this is a sibling element so that we don't have links inside links -->
8173 <div class =" links" >
You can’t perform that action at this time.
0 commit comments