Skip to content

Commit 7429f58

Browse files
authored
Merge pull request #4 from PowerShellOrg/feat/ical-calendar-feed
2 parents f2b2c09 + 79b27dd commit 7429f58

15 files changed

Lines changed: 241 additions & 68 deletions

File tree

.github/ISSUE_TEMPLATE/community-event.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
attributes:
88
value: |
99
Thanks for submitting an event to the PowerShell.org community calendar!
10-
Please fill out the details below.
10+
Please fill out the details below. A maintainer will review and approve it.
1111
1212
- type: input
1313
id: event_name
@@ -29,23 +29,26 @@ body:
2929
id: start_date
3030
attributes:
3131
label: Start Date
32-
placeholder: "YYYY-MM-DD"
32+
description: "Format: YYYY-MM-DD"
33+
placeholder: "2026-10-15"
3334
validations:
3435
required: true
3536

3637
- type: input
3738
id: end_date
3839
attributes:
39-
label: End Date (leave blank for single-day events)
40-
placeholder: "YYYY-MM-DD"
40+
label: End Date
41+
description: "Format: YYYY-MM-DD — leave blank for single-day events"
42+
placeholder: "2026-10-17"
4143
validations:
4244
required: false
4345

4446
- type: input
4547
id: location
4648
attributes:
4749
label: Location
48-
placeholder: "City, State/Country or 'Virtual'"
50+
description: "City, State/Country — use 'Virtual' for online-only events"
51+
placeholder: "Austin, TX"
4952
validations:
5053
required: true
5154

@@ -64,14 +67,7 @@ body:
6467
id: description
6568
attributes:
6669
label: Event Description
67-
placeholder: "Brief description of the event (1-2 sentences)."
70+
description: "1–2 sentences shown on the calendar page."
71+
placeholder: "Brief description of the event."
6872
validations:
6973
required: true
70-
71-
- type: textarea
72-
id: additional_info
73-
attributes:
74-
label: Additional Information
75-
placeholder: "Anything else we should know? (e.g., CFP deadlines, discount codes, etc.)"
76-
validations:
77-
required: false

.github/workflows/add-event.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Add Community Event
2+
3+
on:
4+
issues:
5+
types: [labeled]
6+
7+
jobs:
8+
add-event:
9+
if: |
10+
github.event.label.name == 'approved' &&
11+
contains(github.event.issue.labels.*.name, 'community-event')
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Parse issue and create event content file
22+
id: parse
23+
env:
24+
ISSUE_BODY: ${{ github.event.issue.body }}
25+
ISSUE_NUMBER: ${{ github.event.issue.number }}
26+
ISSUE_TITLE: ${{ github.event.issue.title }}
27+
run: |
28+
python3 - <<'PYEOF'
29+
import os, re
30+
31+
body = os.environ['ISSUE_BODY']
32+
issue_num = os.environ['ISSUE_NUMBER']
33+
34+
def field(label):
35+
m = re.search(rf'### {re.escape(label)}\s+(.+?)(?=\n###|\Z)', body, re.DOTALL)
36+
if not m:
37+
return ''
38+
val = m.group(1).strip()
39+
return '' if val in ('_No response_', '') else val
40+
41+
name = field('Event Name')
42+
url = field('Event Website')
43+
start_date = field('Start Date')
44+
end_date = field('End Date')
45+
location = field('Location')
46+
virtual_s = field('Is this a virtual event?')
47+
description = field('Event Description')
48+
49+
virtual = 'true' if virtual_s.startswith(('Yes', 'Hybrid')) else 'false'
50+
51+
# Generate a URL-safe slug: name + year
52+
slug = re.sub(r'[^a-z0-9]+', '-', name.lower()).strip('-')
53+
slug = f"{slug}-{start_date[:4]}"
54+
55+
end_line = f'\nendDate: "{end_date}"' if end_date else ''
56+
content = f"""---
57+
title: "{name}"
58+
startDate: "{start_date}"{end_line}
59+
where: "{location}"
60+
externalUrl: "{url}"
61+
virtual: {virtual}
62+
---
63+
{description}
64+
"""
65+
# Dedent (the heredoc indents every line)
66+
import textwrap
67+
content = textwrap.dedent(content)
68+
69+
filepath = f'content/calendar/{slug}.md'
70+
os.makedirs('content/calendar', exist_ok=True)
71+
with open(filepath, 'w') as f:
72+
f.write(content)
73+
74+
with open(os.environ['GITHUB_OUTPUT'], 'a') as out:
75+
out.write(f'slug={slug}\n')
76+
out.write(f'filepath={filepath}\n')
77+
out.write(f'event_name={name}\n')
78+
79+
print(f'Created {filepath}')
80+
PYEOF
81+
82+
- name: Open PR
83+
env:
84+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
SLUG: ${{ steps.parse.outputs.slug }}
86+
FILEPATH: ${{ steps.parse.outputs.filepath }}
87+
EVENT_NAME: ${{ steps.parse.outputs.event_name }}
88+
ISSUE_NUMBER: ${{ github.event.issue.number }}
89+
run: |
90+
BRANCH="event/issue-${ISSUE_NUMBER}-${SLUG}"
91+
git config user.name "github-actions[bot]"
92+
git config user.email "github-actions[bot]@users.noreply.github.com"
93+
git checkout -b "$BRANCH"
94+
git add "$FILEPATH"
95+
git commit -m "Add event: ${EVENT_NAME} (closes #${ISSUE_NUMBER})"
96+
git push origin "$BRANCH"
97+
gh pr create \
98+
--title "Add event: ${EVENT_NAME}" \
99+
--body "Closes #${ISSUE_NUMBER}
100+
101+
Auto-generated from community event submission." \
102+
--base main \
103+
--head "$BRANCH"

.github/workflows/hugo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
build-and-deploy:
1616
runs-on: ubuntu-latest
1717
env:
18-
HUGO_VERSION: 0.121.0
18+
HUGO_VERSION: 0.155.1
1919
steps:
2020
- name: Install Hugo CLI
2121
run: |

content/calendar/_index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
title: "Community Calendar"
33
description: "Upcoming conferences, meetups, and community events for PowerShell professionals."
44
layout: "calendar"
5+
outputs:
6+
- HTML
7+
- Calendar
58
---

content/calendar/psconfeu-2026.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: "PSConfEU 2026"
3+
startDate: "2026-06-17"
4+
endDate: "2026-06-20"
5+
where: "Prague, Czech Republic"
6+
externalUrl: "https://psconf.eu"
7+
virtual: false
8+
---
9+
Europe's largest PowerShell conference. Expert-led sessions on automation, DevOps, security, and cloud management.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: "SQL Saturday Baton Rouge 2026"
3+
startDate: "2026-08-01"
4+
where: "Baton Rouge, LA"
5+
externalUrl: "https://sqlsaturday.com/baton-rouge/"
6+
virtual: false
7+
---
8+
A free community event featuring sessions on SQL Server, PowerShell, and data platform technologies.

content/calendar/summit-2026.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: "PowerShell + DevOps Global Summit 2026"
3+
startDate: "2026-04-13"
4+
endDate: "2026-04-16"
5+
where: "Bellevue, WA"
6+
externalUrl: "https://powershellsummit.org"
7+
virtual: false
8+
---
9+
The premier PowerShell and automation conference. Deep technical sessions, hands-on workshops, and community networking.

data/events.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/PowerShellOrg/PowerShellOrgWebsite
2+
3+
go 1.22.2
4+
5+
require github.com/finkregh/hugo-theme-component-ical v0.11.3 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/finkregh/hugo-theme-component-ical v0.11.3 h1:jyHak274hgvbwWKD/LX1x3sWFQ1IwHAj9bWpNh1qbig=
2+
github.com/finkregh/hugo-theme-component-ical v0.11.3/go.mod h1:6EFHEOW6dsEUWQB0bPnSHq6tYYNpQQ9pRu0hy8ZZKNE=

0 commit comments

Comments
 (0)