Skip to content

Commit 5737070

Browse files
authored
Merge pull request #8 from USRSE/jsubida/usrse25
Join our Slack button and QR code redirect
2 parents 8e2b74b + 3e5019c commit 5737070

File tree

6 files changed

+120
-0
lines changed

6 files changed

+120
-0
lines changed

assets/css/custom-buttons.css

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/* Button styling aligned with hugo-book theme */
2+
.slack-button {
3+
--btn-bg: var(--color-link);
4+
--btn-bg-hover: color-mix(in srgb, var(--color-link) 85%, black);
5+
--btn-fg: #fff;
6+
display: inline-flex;
7+
align-items: center;
8+
gap: 0.35rem;
9+
font-size: 0.875rem; /* matches $font-size-14 */
10+
font-weight: 600;
11+
line-height: 1.2;
12+
padding: 0.55rem 1rem; /* derive from theme padding scale */
13+
border-radius: 0.25rem; /* matches $padding-4 */
14+
background: var(--btn-bg);
15+
color: var(--btn-fg) !important;
16+
text-decoration: none;
17+
border: 1px solid var(--btn-bg);
18+
transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .1s ease;
19+
box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 0 0 0 rgba(0,85,187,.4);
20+
cursor: pointer;
21+
}
22+
23+
.slack-button:hover,
24+
.slack-button:focus-visible {
25+
background: var(--btn-bg-hover);
26+
border-color: var(--btn-bg-hover);
27+
text-decoration: none;
28+
}
29+
30+
.slack-button:focus-visible {
31+
outline: none;
32+
box-shadow: 0 2px 4px rgba(0,0,0,.2), 0 0 0 3px rgba(0,85,187,.35);
33+
}
34+
35+
.slack-button:active {
36+
transform: translateY(1px);
37+
box-shadow: 0 1px 2px rgba(0,0,0,.25) inset;
38+
}
39+
40+
/* Outline variant: blends with theme body background, accent border */
41+
.slack-button.outline {
42+
background: transparent;
43+
color: var(--color-link) !important;
44+
border: 1px solid var(--color-link);
45+
--btn-bg: var(--color-link);
46+
--btn-bg-hover: var(--color-link);
47+
}
48+
.slack-button.outline:hover,
49+
.slack-button.outline:focus-visible {
50+
background: var(--color-link);
51+
color: #fff !important;
52+
}
53+
54+
/* Subtle variant (text style button) */
55+
.slack-button.texty {
56+
background: transparent;
57+
border: none;
58+
padding: 0.25rem 0.35rem;
59+
color: var(--color-link) !important;
60+
box-shadow: none;
61+
}
62+
.slack-button.texty:hover,
63+
.slack-button.texty:focus-visible {
64+
background: rgba(0,0,0,0.06);
65+
color: var(--color-link) !important;
66+
}
67+
68+
/* Dark theme adjustments (hugo-book sets different link color) */
69+
@media (prefers-color-scheme: dark) {
70+
.slack-button {
71+
--btn-bg-hover: color-mix(in srgb, var(--color-link) 70%, white);
72+
box-shadow: 0 1px 2px rgba(0,0,0,.6), 0 0 0 0 rgba(132,178,255,.4);
73+
}
74+
.slack-button.outline:hover,
75+
.slack-button.outline:focus-visible {
76+
box-shadow: 0 2px 4px rgba(0,0,0,.6), 0 0 0 3px rgba(132,178,255,.4);
77+
}
78+
.slack-button.texty:hover,
79+
.slack-button.texty:focus-visible {
80+
background: rgba(255,255,255,0.07);
81+
}
82+
}
83+
84+
/* Reduced motion */
85+
@media (prefers-reduced-motion: reduce) {
86+
.slack-button { transition: none; }
87+
}

content/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ The Institutional RSE Networking Affinity Group connects Research Software Engin
77
* Developing effective networking and engagement strategies
88
* Sharing best practices for community leadership
99
* We welcome participants at any stage of their RSE community-building journey, from those exploring initial steps to those leading established groups. Through regular meetings, members exchange practical insights on community outreach, event planning, and maintaining active engagement while addressing the unique organizational contexts and challenges each institution faces.
10+
11+
{{< slackbutton href="<https://usrse.slack.com/archives/C07U53KED19>" >}}Join our Slack{{< /slackbutton >}}

content/qr/usrse25.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+++
2+
title = "QR Redirect"
3+
url = "/qr/usrse25"
4+
+++
5+
6+
{{< redirect "/ag-institutional-rse-networking/" >}}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{/* Project override: inject custom button styles */}}
2+
{{ $btns := resources.Get "css/custom-buttons.css" | minify | fingerprint }}
3+
<link rel="stylesheet" href="{{ $btns.RelPermalink }}" integrity="{{ $btns.Data.Integrity }}" crossorigin="anonymous">

layouts/shortcodes/redirect.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<meta http-equiv="refresh" content="0; url={{ .Get 0 }}">
2+
<p>If you are not redirected, <a href="{{ .Get 0 }}">click here</a>.</p>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{/*
2+
Shortcode: slackbutton
3+
Usage examples:
4+
{{< slackbutton href="https://usrse.slack.com/archives/C07U53KED19" >}}Join our Slack{{< /slackbutton >}}
5+
6+
Optional named params:
7+
href - (string) destination URL (required)
8+
target - (string) defaults to _blank for external links
9+
rel - (string) defaults to noopener noreferrer
10+
class - (string) extra classes to append
11+
12+
Security: Keeps HTML in a trusted template instead of inline raw HTML in Markdown, so Goldmark unsafe mode is not required.
13+
*/}}
14+
{{ $href := .Get "href" | default (.Get 0) }}
15+
{{ if not $href }}{{ errorf "slackbutton shortcode: missing required 'href' parameter" }}{{ end }}
16+
{{ $text := .Inner | default "Slack" }}
17+
{{ $target := .Get "target" | default "_blank" }}
18+
{{ $rel := .Get "rel" | default "noopener noreferrer" }}
19+
{{ $extra := .Get "class" }}
20+
<a href="{{ $href }}" class="slack-button{{ if $extra }} {{ $extra }}{{ end }}" target="{{ $target }}" rel="{{ $rel }}">{{ $text }}</a>

0 commit comments

Comments
 (0)