pleshevski.ru/views/uikit/link.ts
Dmitriy Pleshevskiy 890c1f74ed
All checks were successful
continuous-integration/drone/push Build is passing
update to new arch (#2)
Closes #1

Reviewed-on: #2
Co-authored-by: Dmitriy Pleshevskiy <dmitriy@ideascup.me>
Co-committed-by: Dmitriy Pleshevskiy <dmitriy@ideascup.me>
2022-06-08 20:24:19 +00:00

16 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);
}