Skip to content

Commit eb8fefa

Browse files
Merge pull request #200 from NishidhJain/main
Fixes Issue #199: Update year in meta description automatically based on current Date
2 parents 57aeb37 + 27587f9 commit eb8fefa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

next-seo.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
const today = new Date();
2+
const currentMonth = today.getMonth();
3+
const currentYear = today.getFullYear();
4+
15
const config = {
26
title: 'Hacktoberfest Projects',
3-
description: `Quickly and easily find projects to contribute to this Hacktoberfest 2021!`,
7+
description: `Quickly and easily find projects to contribute to ${currentMonth > 9 ? `upcoming Hacktoberfest ${currentYear + 1}` : `this Hacktoberfest ${currentYear}`}!`,
48
additionalMetaTags: [
59
{
610
property: 'keywords',
@@ -24,7 +28,7 @@ const config = {
2428
locale: 'en_US',
2529
url: 'https://hacktoberfest-projects.vercel.app',
2630
title: 'Hacktoberfest projects',
27-
description: `Quickly and easily find projects to contribute to this Hacktoberfest 2022!`,
31+
description: `Quickly and easily find projects to contribute to ${currentMonth > 9 ? `upcoming Hacktoberfest ${currentYear + 1}` : `this Hacktoberfest ${currentYear}`}!`,
2832
site_name: 'Hacktoberfest projects',
2933
images: [
3034
{

0 commit comments

Comments
 (0)