Skip to content

Commit 33704ed

Browse files
committed
FEAT: Add edit button using lucide icons
1 parent af1d282 commit 33704ed

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

quartz/components/ContentMeta.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export default ((opts?: Partial<ContentMetaOptions>) => {
2828

2929
if (text) {
3030
const segments: (string | JSX.Element)[] = []
31+
const fileRelativePath = fileData.filePath
3132

3233
if (fileData.dates) {
3334
segments.push(formatDate(getDate(cfg, fileData)!, cfg.locale))
@@ -46,7 +47,15 @@ export default ((opts?: Partial<ContentMetaOptions>) => {
4647

4748
return (
4849
<p show-comma={options.showComma} class={classNames(displayClass, "content-meta")}>
49-
{segmentsElements}
50+
{segmentsElements} <br/>
51+
<a href={`https://github.com/morrowind-modding/wiki/edit/main/${fileRelativePath}`} class={classNames(displayClass, "external")} target={"_blank"} style={"font-weight:400"}>
52+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-square-pen"><path d="M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"/></svg>
53+
Edit This Page!
54+
</a> &nbsp;
55+
<a href={`https://github.com/morrowind-modding/wiki/blame/main/${fileRelativePath}`} class={classNames(displayClass, "external")} target={"_blank"} style={"font-weight:400"}>
56+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-clock"><circle cx="16" cy="16" r="6"/><path d="M7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2"/><path d="M16 14v2l1 1"/></svg>
57+
History
58+
</a>
5059
</p>
5160
)
5261
} else {

0 commit comments

Comments
 (0)