Dmitriy Pleshevskiy
890c1f74ed
All checks were successful
continuous-integration/drone/push Build is passing
Closes #1 Reviewed-on: #2 Co-authored-by: Dmitriy Pleshevskiy <dmitriy@ideascup.me> Co-committed-by: Dmitriy Pleshevskiy <dmitriy@ideascup.me>
15 lines
421 B
TypeScript
15 lines
421 B
TypeScript
import { AnyNode, Attrs, E } from "ren/node.ts";
|
|
|
|
export function RepoLink(name: string, repo: string): AnyNode {
|
|
const gitBase = new URL("https://git.pleshevski.ru");
|
|
|
|
return Link(name, {
|
|
target: "_blank",
|
|
href: new URL(repo, gitBase).toString(),
|
|
rel: "external nofollow noopener noreferrer",
|
|
});
|
|
}
|
|
|
|
export function Link(text: string, attrs: Attrs | Attrs[]): AnyNode {
|
|
return E("a", attrs, text);
|
|
}
|