Skip to content

Commit

Permalink
Merge pull request #2343 from ewels/sigs-blog-post
Browse files Browse the repository at this point in the history
Blog post: special interest groups
  • Loading branch information
ewels authored Mar 30, 2024
2 parents b9e029d + 4751b78 commit 16912c3
Show file tree
Hide file tree
Showing 34 changed files with 791 additions and 258 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: prettier
additional_dependencies:
- [email protected].2
- [email protected].5
- prettier-plugin-svelte@^3.1.2
- prettier-plugin-astro@^0.12.3
files: \.(astro|svelte|mdx|md|yml|yaml)$
6 changes: 3 additions & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ export default defineConfig({
'microsoft-azure',
'github-actions',
'youtube-icon',
'linkedin'
'linkedin',
],
fa: ['github'],
'fa-brands': ['github'],
'line-md': ['check-list-3-twotone'],
mdi: ['aws', 'slack', 'youtube'],
octicon: ['link-external-16', 'table-16'],
"simple-icons": ['bluesky'],
'simple-icons': ['bluesky'],
},
}),
sitemap(),
Expand Down Expand Up @@ -159,7 +159,7 @@ export default defineConfig({
rehypeAutolinkHeadings,
{
behavior: 'append',
content: h('i.ms-1.fas.fa-link.invisible'),
content: h('i.ms-1.fas.fa-link.fa-xs.invisible'),
},
],
[
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@iconify-json/simple-icons": "^1.1.96",
"@nanostores/persistent": "^0.9.1",
"astro": "^3.6.0",
"astro-icon": "^1.0.2",
"astro-icon": "^1.1.0",
"astro-remark-description": "^1.1.1",
"bootstrap": "^5.3.2",
"bootstrap-print-css": "^1.0.1",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 54 additions & 25 deletions src/components/GitHubProfilePicture.svelte
Original file line number Diff line number Diff line change
@@ -1,41 +1,70 @@
<script lang="ts">
export let name: string;
export let count: number = 0;
export let image: string;
export let image: string = 'https://github.com/' + name + '.png';
export let size: number = 60;
export let circle: boolean = false;
export let wrapperClasses = '';
export let imgClasses = '';
export let linkClasses: string = '';
export let wrapperClasses: string = '';
export let imgClasses: string = '';
export let containerQuery: boolean = false;
const tooltip = count > 0 ? `${name} (${count} commits)` : name;
let tooltip = count > 0 ? `${name} (${count} commits)` : name;
tooltip = count === 1 ? `${name} (1 commit)` : tooltip;
tooltip = containerQuery ? '' : tooltip;
const avatar_url = image.match(/\?/) ? `${image}&s=${size}` : `${image}?s=${size}`;
</script>

<a
href="https://github.com/{name}"
class={'text-decoration-none me-1 ' + wrapperClasses}
target="_blank"
rel="noopener noreferrer"
>
<img
src={avatar_url}
width={size}
height={size}
class:rounded-circle={circle}
data-bs-placement="bottom"
data-bs-toggle="tooltip"
title={tooltip}
alt={`Github user ${name}`}
<div class={wrapperClasses} class:github-profile={containerQuery}>
<a
href="https://github.com/{name}"
class={'text-decoration-none d-block ' + linkClasses}
target="_blank"
rel="noopener noreferrer"
style="--size:{size};"
class={imgClasses}
/>
<slot />
</a>
>
<img
src={avatar_url}
width={size}
height={size}
class:rounded-circle={circle}
data-bs-placement="bottom"
data-bs-toggle="tooltip"
title={tooltip}
alt={`Github user ${name}`}
style="--size:{size};"
class={' ' + imgClasses}
/>
<div class="profile-name text-nowrap">
<slot />
</div>
</a>
</div>

<style lang="scss">
@import '@styles/_variables.scss';
@import '../styles/_variables.scss';
img {
max-height: calc(var(--size) * 1px);
background-color: $white;
}
.github-profile {
container-type: size;
container-name: github-profile;
flex-grow: 1;
}
a {
width: fit-content;
}
@container github-profile (width < 10rem) {
:global(.profile-name) {
display: none;
}
}
:global(.github-profile:hover) {
z-index: 1000;
width: 40%; // should cover most cases, but extra long usernames, will still be not completely covered
:global(.profile-name) {
display: block !important;
z-index: 1000;
}
}
</style>
33 changes: 23 additions & 10 deletions src/components/GitHubProfilePictureExtended.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,38 @@
export let username: string;
export let affiliation: string = '';
export let size: number = 50;
export let wrapperClasses: string = '';
export let labelClasses: string = '';
export let containerQuery: boolean = false;
const affiliation_str =
affiliation.length > 0
? `<div class="small"><abbr class="small d-inline-block text-truncate" data-bs-placement="bottom" data-bs-toggle="tooltip" title="${affiliation}" style="max-width: 12rem;">${affiliation}</abbr></div>`
? `<div class="small"><abbr class="small d-block text-truncate" data-bs-placement="bottom" data-bs-toggle="tooltip" title="${affiliation}" style="max-width: 12rem;">${affiliation}</abbr></div>`
: '';
const extra_classes = affiliation.length > 0 ? 'small' : '';
labelClasses = affiliation.length > 0 ? labelClasses + ' small' : labelClasses;
</script>

<GitHubProfilePicture
wrapperClasses="btn btn-light rounded-pill mb-2 p-0 pe-2 d-inline-flex align-items-center"
wrapperClasses={'d-block ' + wrapperClasses}
linkClasses="btn btn-light rounded-pill mb-2 p-0 d-flex align-items-center"
image={'https://github.com/' + username + '.png'}
name={username}
circle={true}
size={Math.max(size, 25)}
{containerQuery}
>
<div class={'ms-2 text-start d-inline-flex flex-column px-2 ' + extra_classes}>
<slot>
<div>@{username}</div>
</slot>
{@html affiliation_str}
</div>
</GitHubProfilePicture>
<div class={'ms-2 pe-2 text-start d-flex flex-column profile-name ' + labelClasses}>
<div class={'ps-2 pe-3 ' + labelClasses}>
<slot>
@{username}
</slot>
{@html affiliation_str}
</div>
</div></GitHubProfilePicture
>

<style lang="scss">
:global(.profile-name p) {
margin-bottom: 0;
}
</style>
2 changes: 1 addition & 1 deletion src/components/Heading.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ const Heading = 'h' + level;

<Heading level={level} id={id}>
<slot /><a aria-hidden="true" tabindex="-1" href={'#' + id}></a><i
class="ms-1 fas fa-link invisible"
class="ms-1 fas fa-link fa-xs invisible"
aria-hidden="true"></i>
</Heading>
4 changes: 2 additions & 2 deletions src/components/IconSocial.astro
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const {
data-bs-delay="500"
class={'text-decoration-none ' + additionalClass}
>
<Icon name={icon} class={icon_dark && 'hide-dark'} color={color} width="16px" height="16px" />
{icon_dark && <Icon name={icon_dark} color="white" class="hide-light" width="16px" height="16px" />}
<Icon name={icon} class={icon_dark && 'hide-dark'} color={color} width="14pt" height="14pt" />
{icon_dark && <Icon name={icon_dark} color="white" class="hide-light" width="14pt" height="14pt" />}
</a>

<style lang="scss" define:vars={{ marginLeft, marginRight }}>
Expand Down
6 changes: 6 additions & 0 deletions src/components/ListingCard.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
export let recentRelease: boolean = false;
export let footer: boolean = false;
</script>

<div class="card">
Expand All @@ -11,6 +12,11 @@
<div class="card-body" class:pt-0={recentRelease}>
<slot name="card-body" />
</div>
{#if footer}
<div class="card-footer">
<slot name="card-footer" />
</div>
{/if}
</div>

<style lang="scss">
Expand Down
125 changes: 125 additions & 0 deletions src/components/SpecialInterestGroupsListing.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<script lang="ts">
import ListingTableHeader from '@components/ListingTableHeader.svelte';
import ListingCard from './ListingCard.svelte';
import { DisplayStyle, SearchQuery } from '@components/store';
import GitHubProfilePictureExtended from '@components/GitHubProfilePictureExtended.svelte';
import type { CollectionEntry } from 'astro:content';
export let groups: CollectionEntry<'special-interest-groups'>[] = [];
let filteredGroups = groups;
</script>

<div class="listing px-2 py-4">
{#if $DisplayStyle === 'grid'}
<div class="grid">
{#if filteredGroups.length === 0 && $SearchQuery !== ''}
<div class="g-col-12 g-col-md-8 g-start-md-3">
<div class="alert alert-secondary text-center" role="alert">
No Groups found. Try changing your search query or filters.
</div>
</div>
{:else}
{#each filteredGroups as group (group.id)}
<div class="g-col-12 g-col-lg-6 g-col-xl-6 g-col-xxl-4 g-col-xxxxl-2">
<ListingCard footer={true}>
<a slot="card-header" href={'/special-interest-groups/' + group.slug} class="success"
>{group.data.groupName}</a
>
<p slot="card-body">{group.data.subtitle}</p>
<div slot="card-footer" class="grid align-content-start">
<div class="pipeline-badges small g-col-8">
{#if group.data.pipelines}
<p class="text-muted small mb-1">Pipelines:</p>
{#each group.data.pipelines as pipeline}
<span class={`badge me-2 pipeline-badge small`}>{pipeline}</span>
{/each}
{/if}
</div>
<div class="small g-col-4">
{#if group.data.leads}
<p class="text-muted small mb-2">Group leads:</p>
<div class="leads d-flex flex-wrap w-100">
{#each group.data.leads as lead}
{#if typeof lead === 'string'}
<GitHubProfilePictureExtended
username={lead}
size={25}
wrapperClasses="flex-grow-1"
labelClasses=""
/>
{:else}
<GitHubProfilePictureExtended
username={Object.keys(lead)[0]}
size={25}
wrapperClasses="flex-grow-1"
labelClasses=""
>
{Object.values(lead)[0]}
</GitHubProfilePictureExtended>
{/if}
{/each}
</div>
{/if}
</div>
</div></ListingCard
>
</div>
{/each}
{/if}
</div>
{:else}
<table class="table table-hove table-responsive">
<thead>
<tr>
<ListingTableHeader name="Name" />
<th scope="col">Description</th>
<th scope="col">Included pipelines</th>
<th scope="col">Leads</th>
</tr>
</thead>
<tbody>
{#each filteredGroups as group (group.id)}
<tr>
<td class=" name p-0">
<div class="position-relative p-3">
<a class="stretched-link" href={'/special-interest-groups' + group.slug + '/'}
>{group.data.title}</a
>
</div>
</td>
<td class="text-small">
{group.data.subtitle}
</td>
<td class="pipeline-badges small">
{#each group.data.pipelines ?? [] as pipeline}
<span class={`badge me-2 pipeline-badge`}>{pipeline}</span>
{/each}
</td>
<td>
{#each group.data.leads ?? [] as lead}
{#if typeof lead === 'string'}
<GitHubProfilePictureExtended username={lead} size={25} />
{:else}
<GitHubProfilePictureExtended username={Object.keys(lead)[0]} size={25}>
{Object.values(lead)[0]}
</GitHubProfilePictureExtended>
{/if}
{/each}
</td>
</tr>
{/each}
</tbody>
</table>
{/if}
</div>

<style lang="scss">
.leads {
width: fit-content;
}
:global(h2) a {
color: var(--bs-success);
}
</style>
2 changes: 1 addition & 1 deletion src/components/component/ComponentListing.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
{#if $DisplayStyle === 'grid'}
<div class="grid">
{#each paginatedItems as component (component.name)}
<div class="g-col-12 g-col-md-6 g-col-xl-4 g-col-xxl-3">
<div class="g-col-12 g-col-md-6 g-col-xl-6 g-col-xxl-4 g-col-xxxl-3 g-col-xxxxl-2">
<ComponentCard {component} />
</div>
{/each}
Expand Down
15 changes: 6 additions & 9 deletions src/components/event/EventIndicator.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@
import { EventIsOngoing } from '@components/store';
</script>

{#if $EventIsOngoing}
<div class="event-indicator align-center">
<slot />
</div>
{/if}
<div class="event-indicator align-center d-inline-block" class:d-none={!$EventIsOngoing}>
<slot />
</div>

<style lang="scss">
@import '@styles/_variables.scss';
.event-indicator :global(svg[astro-icon]) {
fill: $danger;
.event-indicator :global(svg[data-icon]) {
color: var(--bs-danger);
width: 10pt;
margin-bottom: 0.1rem;
}
.event-indicator :global(svg[astro-icon] .fa-secondary) {
.event-indicator :global(svg[data-icon] .fa-secondary) {
opacity: 0.4;
}
</style>
Loading

0 comments on commit 16912c3

Please sign in to comment.