-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
74 changed files
with
1,914 additions
and
844 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ module.exports = { | |
description: 'Lorem ipsum dolor sit amet.', | ||
link: 'https://osmium-blog.vercel.app', | ||
since: 2023, | ||
footerText: '', | ||
author: 'Osmium user', | ||
email: '[email protected]', | ||
socialLink: '', | ||
|
@@ -15,10 +16,10 @@ module.exports = { | |
darkBackground: '#191919', | ||
postsPerPage: 7, | ||
sortByDate: false, | ||
showAbout: true, | ||
|
||
path: '', | ||
ogImageGenerateURL: 'https://og-image-craigary.vercel.app', | ||
ogImageGenerateURL: '', | ||
rss: true, | ||
seo: { | ||
keywords: ['Blog', 'Website', 'Notion'], | ||
googleSiteVerification: '', | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { useConfig } from '@/lib/config' | ||
import { execTemplate } from '@/lib/utils' | ||
|
||
type Props = { | ||
fullWidth: boolean | ||
} | ||
|
||
/** | ||
* The site footer | ||
*/ | ||
export default function Footer ({ fullWidth }: Props) { | ||
const { author, since, footerText, version } = useConfig() | ||
|
||
let text: string | ||
// If user defined `footerText`, use it as a template | ||
if (footerText) { | ||
text = execTemplate(footerText, { since }) | ||
} | ||
// If not, generate a simple version | ||
else { | ||
text = `© ${author} ${getSinceText(since)}` | ||
} | ||
|
||
return ( | ||
<div | ||
className={`mt-6 flex-shrink-0 m-auto w-full text-gray-500 dark:text-gray-400 transition-all ${ | ||
!fullWidth ? 'max-w-2xl px-4' : 'px-4 md:px-24' | ||
}`} | ||
> | ||
<div className="py-4 text-sm leading-6 border-t border-gray-200 dark:border-gray-600"> | ||
<div className="flex align-baseline flex-wrap"> | ||
<span dangerouslySetInnerHTML={{ __html: text }}/> | ||
{version && ( | ||
<span className="ml-auto text-right"> | ||
Osmium ver. | ||
{/^[0-9a-f]+$/.test(version) ? <code>{version}</code> : version} | ||
</span> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
function getSinceText (since: string | number): string { | ||
since = +since | ||
const now = new Date().getFullYear() | ||
return Number.isNaN(since) || since === now ? String(since) : `${since} - ${now}` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.