Skip to content

Commit b656ea7

Browse files
committed
Add GitHub file links on Reference pages
1 parent b093adf commit b656ea7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/layouts/ReferenceItemLayout.astro

+16
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import type {
1818
ReferenceParam,
1919
} from "@/types/parsers.interface";
2020
import { setJumpToState } from "../globals/state";
21+
import { p5Version } from "../globals/p5-version";
2122
2223
const { entry, relatedEntries } = Astro.props;
2324
const currentLocale = getCurrentLocale(Astro.url.pathname);
@@ -207,6 +208,21 @@ const seenParams: Record<string, true> = {};
207208
</div>
208209
)
209210
}
211+
{
212+
entry.data.file && entry.data.line &&(
213+
<div class="my-xl">
214+
<div class="text-body [&_a]:text-type-magenta-dark [&_a]:!decoration-type-magenta-dark my-lg">
215+
Notice any errors or typos? <a href ="https://github.com/processing/p5.js/issues">Please let us know</a>. Please feel free to edit
216+
<a
217+
href={`https://github.com/processing/p5.js/blob/v${p5Version}/${entry.data.file}#L${entry.data.line}`}
218+
>
219+
{entry.data.file}
220+
</a>
221+
and open a pull request!
222+
</div>
223+
</div>
224+
)
225+
}
210226
</div>
211227
</div>
212228
<RelatedItems

0 commit comments

Comments
 (0)