Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions sites/configs/src/pages/configs/[configslug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ const metadata = config.rendered.metadata;
// Format the raw config for display
const raw_config = '```groovy title="' + config.id + '"\n' + config.body + "\n```";

// Extract GitHub username from contact
const contact = metadata.config_profile_contact?.match(/@([A-Za-z0-9-]+)/)
? metadata.config_profile_contact.match(/@([A-Za-z0-9-]+)/)[1]
// Extract GitHub username from contact but only if it not an email
const contact = metadata.config_profile_contact?.match(/[\s,\(,\',\"]@([A-Za-z0-9_-]+)/)
? metadata.config_profile_contact.match(/[\s,\(,\',\"]@([A-Za-z0-9_-]+)/)[1]
: "";

const gh_url = `https://github.com/nf-core/configs/blob/master/docs/${configslug}.md`;
Expand Down Expand Up @@ -163,15 +163,15 @@ if (pipelineConfigs.length > 0) {
content={[
{ title: "executor", value: metadata.executor?.toString() },
{
title: "contact",
title: contact ? "contact" : "",
value: contact
? `<a
href="https://github.com/${contact}"
target="_blank"
rel="noopener noreferrer"
slot="contact"
>
<img class="me-2 pb-2" src="https://github.com/${contact}.png?size=50" alt="${contact}" />
<img class="me-2 pb-2" src="https://github.com/${contact}.png?size=50" height="50" alt="${contact}" />
</a>`
: "",
},
Expand Down Expand Up @@ -205,17 +205,21 @@ if (pipelineConfigs.length > 0) {
!metadata.executor && contact && (
<SidebarStatsRow
content={[
{
title: "contact",
value: `<a
...(contact
? [
{
title: "contact",
value: `<a
href="https://github.com/${contact}"
target="_blank"
rel="noopener noreferrer"
slot="contact"
>
<img class="me-2 pb-2" src="https://github.com/${contact}.png?size=50" alt="${contact}" />
</a>`,
},
},
]
: []),
]}
/>
)
Expand Down
26 changes: 15 additions & 11 deletions sites/main-site/src/components/sidebar/SidebarStatsRow.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,21 @@ export interface Props {

<div class:list={["row g-0 w-100", { "border-bottom": !lastChild }]}>
{
content.map((entry) => (
<div class="col mb-1">
<h6 class="text-body-secondary my-1">
{entry.icon && <i class={entry.icon + " fa-fw me-1"} />}
{entry.title}
</h6>
<div class="overflow-x-auto" set:html={entry.value}>
<slot />
</div>
</div>
))
content.map(
(entry) =>
entry.title &&
entry.value && (
<div class="col mb-1">
<h6 class="text-body-secondary my-1">
{entry.icon && <i class={entry.icon + " fa-fw me-1"} />}
{entry.title}
</h6>
<div class="overflow-x-auto" set:html={entry.value}>
<slot />
</div>
</div>
),
)
}
</div>

Expand Down
Loading