Skip to content

Commit a28c9a5

Browse files
committed
Provide mechanism to give page feedback
1 parent 0b51542 commit a28c9a5

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Page Feedback
2+
description: Suggest changes or report issues with a page
3+
labels: [feedback]
4+
body:
5+
- type: input
6+
id: url
7+
attributes:
8+
label: Page URL
9+
description: The page this feedback is about.
10+
placeholder: https://ofthemachine.github.io/100hellos-docs/...
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: suggestions
15+
attributes:
16+
label: Feedback
17+
description: What would you like to change or report?
18+
placeholder: Describe the issue or suggestion.
19+
validations:
20+
required: true

src/components/Footer.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
import React from 'react'
22

3+
const SITE_URL = 'https://ofthemachine.github.io/100hellos-docs'
4+
5+
function feedbackUrl(path) {
6+
const pageUrl = `${SITE_URL}${path}`
7+
const params = new URLSearchParams({
8+
template: 'page-feedback.yml',
9+
title: `[Feedback] ${path}`,
10+
url: pageUrl,
11+
})
12+
return `https://github.com/ofthemachine/100hellos-docs/issues/new?${params}`
13+
}
14+
315
const styles = {
416
footer: {
517
borderTop: '1px solid var(--border)',
@@ -20,6 +32,7 @@ const styles = {
2032
}
2133

2234
export default function Footer() {
35+
const path = typeof window !== 'undefined' ? window.location.pathname.replace('/100hellos-docs', '') || '/' : '/'
2336
return (
2437
<footer style={styles.footer}>
2538
<p style={styles.text}>
@@ -30,6 +43,10 @@ export default function Footer() {
3043
<a href="https://github.com/ofthemachine/fraglet" style={styles.link} target="_blank" rel="noopener noreferrer">
3144
fraglet
3245
</a>
46+
{' · '}
47+
<a href={feedbackUrl(path)} style={styles.link} target="_blank" rel="noopener noreferrer">
48+
Suggest Changes
49+
</a>
3350
</p>
3451
</footer>
3552
)

0 commit comments

Comments
 (0)