add boolean for edit on github

This commit is contained in:
2025-05-10 19:30:43 +07:00
parent cd77ef10aa
commit cf9e1a6cf0
9 changed files with 1003 additions and 7159 deletions

View File

@@ -9,24 +9,22 @@ interface EditThisPageProps {
const EditThisPage: React.FC<EditThisPageProps> = ({ filePath }) => {
const { repository } = docuConfig;
if (!repository?.editLink || !repository.url || !repository.editPathTemplate) return null;
const editUrl = `${repository.url}${repository.editPathTemplate.replace("{filePath}", filePath)}`;
return (
<div style={{ textAlign: 'right' }}>
<div className="text-right">
<Link
href={editUrl}
target='_blank'
target="_blank"
rel="noopener noreferrer"
style={{
display: 'inline-flex',
alignItems: 'center',
gap: '0.5rem',
textDecoration: 'none',
fontWeight: 'bold',
}}
aria-label="Edit this page on Git"
className="inline-flex items-center gap-2 text-sm font-medium text-muted-foreground no-underline"
>
<span className='text-primary text-sm max-[480px]:hidden'>Edit this page</span>
<SquarePenIcon className="w-4 h-4 text-primary" />
<span className="flex justify-start items-center gap-1">Edit this page
<SquarePenIcon className="w-4 h-4" /></span>
</Link>
</div>
);

View File

@@ -16,7 +16,7 @@ export function Footer() {
<FooterButtons />
</div>
</div>
<div className="flex flex-col items-start justify-center w-full gap-4 mt-4 xl:items-end lg:w-2/5">
<div className="flex flex-col items-center justify-center w-full gap-4 mt-4 lg:items-end lg:w-2/5">
<p className="text-center text-muted-foreground">
Copyright © {new Date().getFullYear()} {footer.copyright} - <MadeWith />
</p>