Skip to content

Commit

Permalink
Merge pull request #466 from processing/reference-github-link
Browse files Browse the repository at this point in the history
Add GitHub file links on Reference pages
  • Loading branch information
Qianqianye authored Jul 17, 2024
2 parents b093adf + b656ea7 commit d62a698
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/layouts/ReferenceItemLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type {
ReferenceParam,
} from "@/types/parsers.interface";
import { setJumpToState } from "../globals/state";
import { p5Version } from "../globals/p5-version";
const { entry, relatedEntries } = Astro.props;
const currentLocale = getCurrentLocale(Astro.url.pathname);
Expand Down Expand Up @@ -207,6 +208,21 @@ const seenParams: Record<string, true> = {};
</div>
)
}
{
entry.data.file && entry.data.line &&(
<div class="my-xl">
<div class="text-body [&_a]:text-type-magenta-dark [&_a]:!decoration-type-magenta-dark my-lg">
Notice any errors or typos? <a href ="https://github.com/processing/p5.js/issues">Please let us know</a>. Please feel free to edit
<a
href={`https://github.com/processing/p5.js/blob/v${p5Version}/${entry.data.file}#L${entry.data.line}`}
>
{entry.data.file}
</a>
and open a pull request!
</div>
</div>
)
}
</div>
</div>
<RelatedItems
Expand Down

0 comments on commit d62a698

Please sign in to comment.