Skip to content

Commit ef3cdf5

Browse files
committed
feat: ✨ update component form and add github pages support
1 parent 953b3cf commit ef3cdf5

File tree

7 files changed

+234
-12
lines changed

7 files changed

+234
-12
lines changed

.github/ISSUE_TEMPLATE/new-component-request.yml

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,55 @@ body:
1515
required: true
1616

1717
- type: input
18-
id: maintainer
18+
id: maintainers
1919
attributes:
20-
label: 'Maintainer'
21-
description: 'The maintaining team(s) or individual(s) for this component.'
22-
placeholder: 'Maintainer...'
20+
label: 'Maintainers'
21+
description: 'The maintaining team(s) or individual(s) for this component, separated by commas. (e.g. "TUM, LRZ")'
22+
placeholder: 'Maintainers...'
2323
validations:
2424
required: true
2525

26+
- type: input
27+
id: docs
28+
attributes:
29+
label: 'Documentation URL'
30+
description: 'A link to the component documentation or homepage. Can be left blank if not available.'
31+
placeholder: 'https://...'
32+
validations:
33+
required: false
34+
35+
- type: input
36+
id: github
37+
attributes:
38+
label: 'GitHub Repository URL'
39+
description: 'A link to the component source code on GitHub. Can be left blank if not available.'
40+
placeholder: 'https://...'
41+
validations:
42+
required: false
43+
44+
- type: input
45+
id: languages
46+
attributes:
47+
label: 'Programming Languages'
48+
description: 'The programming languages used in this component, separated by commas. (e.g. "python, c++")'
49+
placeholder: 'pyton...'
50+
validations:
51+
required: false
52+
53+
- type: input
54+
id: frameworks
55+
attributes:
56+
label: 'Built on:'
57+
description: 'The quantum computing frameworks this component is built on, separated by commas. (e.g. "qiskit, PennyLane")'
58+
placeholder: 'qiskit...'
59+
validations:
60+
required: false
61+
2662
- type: textarea
2763
id: description
2864
attributes:
2965
label: 'Description'
3066
description: 'Describe the component in a few sentences, including what it does and how to use it.'
31-
placeholder: 'Description...'
67+
placeholder: 'Description... (Use Markdown syntax and `##` for subsections if needed)'
3268
validations:
3369
required: true

.github/workflows/issue-to-pr.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,20 @@ jobs:
2828
- name: 'Create Branch, Commit, and Push'
2929
run: |
3030
NAME="${{ steps.issue-parser.outputs.issueparser_name }}"
31-
MAINTAINER="${{ steps.issue-parser.outputs.issueparser_maintainer }}"
31+
MAINTAINERS="${{ steps.issue-parser.outputs.issueparser_maintainers }}"
32+
DOCS="${{ steps.issue-parser.outputs.issueparser_docs }}"
33+
GITHUB_REPO="${{ steps.issue-parser.outputs.issueparser_github }}"
3234
DESCRIPTION="${{ steps.issue-parser.outputs.issueparser_description }}"
35+
LANGUAGES="${{ steps.issue-parser.outputs.issueparser_languages }}"
36+
FRAMEWORKS="${{ steps.issue-parser.outputs.issueparser_frameworks }}"
3337
ISSUE_NUMBER="${{ github.event.issue.number }}"
3438
SANITIZED_NAME=$(echo "$NAME" | tr '[:upper:]' '[:lower:]' | sed -e 's/[ \/]\+/-/g' -e 's/[^a-z0-9-]\+//g')
3539
BRANCH_NAME="new/component-${ISSUE_NUMBER}-${SANITIZED_NAME}"
3640
41+
LANG_ARRAY=$(echo "$LANGUAGES" | sed 's/[^,]\+/\"&\"/g' | sed 's/, /", "/g' | sed 's/.*/[&]/')
42+
FW_ARRAY=$(echo "$FRAMEWORKS" | sed 's/[^,]\+/\"&\"/g' | sed 's/, /", "/g' | sed 's/.*/[&]/')
43+
MAINT_ARRAY=$(echo "$MAINTAINERS" | sed 's/[^,]\+/\"&\"/g' | sed 's/, /", "/g' | sed 's/.*/[&]/')
44+
3745
AUTHOR_NAME="${{ github.event.issue.user.login }}"
3846
AUTHOR_EMAIL="${{ github.event.issue.user.id }}+${{ github.event.issue.user.login }}@users.noreply.github.com"
3947
@@ -43,12 +51,30 @@ jobs:
4351
4452
# Create branch, add file, commit, and push
4553
git checkout -b $BRANCH_NAME
46-
echo -e "# ${NAME}" > "components/${SANITIZED_NAME}.md"
47-
echo -e "" >> "components/${SANITIZED_NAME}.md"
48-
echo -e "_Maintainer: ${MAINTAINER}_" >> "components/${SANITIZED_NAME}.md"
49-
echo -e "" >> "components/${SANITIZED_NAME}.md"
50-
echo -e "${DESCRIPTION}" >> "components/${SANITIZED_NAME}.md"
51-
git add "components/${SANITIZED_NAME}.md"
54+
echo -e "---" > "_components/${SANITIZED_NAME}.md"
55+
echo -e "title: \"${NAME}\"" >> "_components/${SANITIZED_NAME}.md"
56+
57+
echo -e "languages: $LANG_ARRAY" >> "_components/${SANITIZED_NAME}.md"
58+
echo -e "frameworks: $FW_ARRAY" >> "_components/${SANITIZED_NAME}.md"
59+
60+
if [ -n "$DOCS" ] || [ -n "$GITHUB_REPO" ]; then
61+
echo -e "links:" >> "_components/${SANITIZED_NAME}.md"
62+
if [ -n "$DOCS" ]; then
63+
echo -e " docs: \"${DOCS}\"" >> "_components/${SANITIZED_NAME}.md"
64+
fi
65+
if [ -n "$GITHUB_REPO" ]; then
66+
echo -e " github: \"${GITHUB_REPO}\"" >> "_components/${SANITIZED_NAME}.md"
67+
fi
68+
fi
69+
70+
echo -e "maintainers: $MAINT_ARRAY" >> "_components/${SANITIZED_NAME}.md"
71+
72+
echo -e "---" >> "_components/${SANITIZED_NAME}.md"
73+
echo -e "" >> "_components/${SANITIZED_NAME}.md"
74+
echo -e "${DESCRIPTION}" >> "_components/${SANITIZED_NAME}.md"
75+
76+
git add "_components/${SANITIZED_NAME}.md"
77+
5278
git -c "author.name=${AUTHOR_NAME}" -c "author.email=${AUTHOR_EMAIL}" \
5379
commit -m "feat: :card_file_box: add component \"${NAME}\" from Issue #${ISSUE_NUMBER}"
5480
git push origin $BRANCH_NAME

_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This tells Jekyll to treat the 'components' directory as a collection
2+
collections:
3+
- components

_layouts/default.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>{{ page.title }}</title>
6+
<link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
7+
</head>
8+
<body>
9+
<main>
10+
{{ content }}
11+
</main>
12+
</body>
13+
</html>

assets/css/style.css

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/* Add these new and updated styles to /assets/css/style.css */
2+
3+
body {
4+
font-family: sans-serif;
5+
background-color: #f4f4f9;
6+
margin: 0;
7+
padding: 2rem;
8+
}
9+
10+
.component-grid {
11+
display: grid;
12+
/* Creates 3 columns of equal width. Change '3' to your liking. */
13+
grid-template-columns: repeat(3, 1fr);
14+
gap: 20px; /* The space between the boxes */
15+
}
16+
17+
.component-box {
18+
background-color: #ffffff;
19+
border-radius: 8px;
20+
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
21+
border: 1px solid #e1e4e8;
22+
/* Use flexbox to easily space out header, body, and footer */
23+
display: flex;
24+
flex-direction: column;
25+
justify-content: space-between;
26+
padding: 20px;
27+
}
28+
29+
/* --- Header --- */
30+
.component-header {
31+
display: flex;
32+
flex-direction: column;
33+
align-items: flex-start;
34+
padding-bottom: 15px;
35+
gap: 5px;
36+
}
37+
38+
.component-header h2 {
39+
margin: 0;
40+
font-size: 1.25rem;
41+
}
42+
43+
44+
.component-links a {
45+
font-size: 0.9rem;
46+
text-decoration: none;
47+
margin-right: 8px;
48+
}
49+
50+
/* --- Body --- */
51+
.component-body {
52+
flex-grow: 1; /* Allows the body to take up available space */
53+
line-height: 1.6;
54+
color: #333;
55+
}
56+
57+
/* --- Footer & Tags --- */
58+
.component-footer {
59+
padding-top: 15px;
60+
display: flex;
61+
flex-direction: column;
62+
gap: 8px;
63+
}
64+
65+
.component-maintainer {
66+
font-size: 0.9rem;
67+
color: #888;
68+
font-style: italic;
69+
}
70+
71+
.component-tags {
72+
}
73+
74+
.tag {
75+
display: inline-block;
76+
font-size: 0.75rem;
77+
font-weight: bold;
78+
padding: 4px 10px;
79+
border-radius: 12px;
80+
margin-right: 5px;
81+
margin-bottom: 5px;
82+
}
83+
84+
.language {
85+
background-color: #e6f7ff;
86+
color: #2b619b;
87+
border: 1px solid #2b619b;
88+
}
89+
90+
.framework {
91+
background-color: #f7ebb1;
92+
color: #d46b08;
93+
border: 1px solid #d46b08;
94+
}

index.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
layout: default
3+
title: Component Overview
4+
---
5+
6+
<h1>MQSS Components</h1>
7+
8+
<div class="component-grid">
9+
{% for component in site.components %}
10+
<div class="component-box">
11+
12+
<div class="component-header">
13+
<h2>{{ component.title }}</h2>
14+
<div class="component-links">
15+
{% if component.links.docs %}
16+
<a href="{{ component.links.docs }}" title="Documentation">Docs</a>
17+
{% endif %}
18+
{% if component.links.github %}
19+
<a href="{{ component.links.github }}" title="GitHub">GitHub</a>
20+
{% endif %}
21+
{% if component.links.releases %}
22+
<a href="{{ component.links.releases }}" title="Releases">📦</a>
23+
{% endif %}
24+
</div>
25+
</div>
26+
27+
<div class="component-body">
28+
{{ component.content }}
29+
</div>
30+
31+
<div class="component-footer">
32+
<div class="component-maintainers">
33+
<span class="maintainers">Maintained by</span>
34+
{% for maintainer in component.maintainers %}
35+
<span class="maintainers">{{ maintainer }}</span>
36+
{% endfor %}
37+
</div>
38+
<div class="component-tags">
39+
{% for lang in component.languages %}
40+
<span class="tag language">{{ lang }}</span>
41+
{% endfor %}
42+
{% for fw in component.frameworks %}
43+
<span class="tag framework">{{ fw }}</span>
44+
{% endfor %}
45+
</div>
46+
</div>
47+
48+
</div>
49+
{% endfor %}
50+
</div>

0 commit comments

Comments
 (0)