-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
5a506bf
commit 69ad848
Showing
11 changed files
with
173 additions
and
9 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
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,24 @@ | ||
const title = 'Ganning Xu - Developer, Student, Aviation Enthusiast.' | ||
const description = | ||
'Personal website for Ganning Xu, a high school junior at the North Carolina School of Science and Mathematics.' | ||
|
||
const SEO = { | ||
title, | ||
description, | ||
canonical: 'https://www.ganning.me', | ||
openGraph: { | ||
type: 'website', | ||
locale: 'en_IE', | ||
url: 'https://www.ganning.me', | ||
title, | ||
description, | ||
images: [ | ||
{ | ||
url: 'https://benjamincarlson.io/images/favicon.png', | ||
alt: title | ||
} | ||
] | ||
} | ||
} | ||
|
||
export default SEO |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,2 @@ | ||
User-agent: * | ||
Sitemap: https://www.ganning.me/sitemap.xml |
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,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | ||
<url> | ||
<loc>https://ganning.me/blog</loc> | ||
</url> | ||
|
||
<url> | ||
<loc>https://ganning.me/experience</loc> | ||
</url> | ||
|
||
<url> | ||
<loc>https://ganning.me</loc> | ||
</url> | ||
|
||
<url> | ||
<loc>https://ganning.me/projects</loc> | ||
</url> | ||
|
||
<url> | ||
<loc>https://ganning.me/timeline</loc> | ||
</url> | ||
|
||
<url> | ||
<loc>https://ganning.me/blog/creating-a-hello-world-website</loc> | ||
</url> | ||
|
||
<url> | ||
<loc>https://ganning.me/blog/how-to-create-a-discord-bot</loc> | ||
</url> | ||
|
||
<url> | ||
<loc>https://ganning.me/blog/how-to-learn-web-development</loc> | ||
</url> | ||
|
||
<url> | ||
<loc>https://ganning.me/blog/how-to-pick-a-programming-language</loc> | ||
</url> | ||
|
||
<url> | ||
<loc | ||
>https://ganning.me/blog/learning-a-new-programming-language-from-scratch</loc | ||
> | ||
</url> | ||
|
||
<url> | ||
<loc>https://ganning.me/blog/what-is-programming</loc> | ||
</url> | ||
</urlset> |
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,42 @@ | ||
const fs = require('fs'); | ||
|
||
const globby = require('globby'); | ||
const prettier = require('prettier'); | ||
|
||
(async () => { | ||
const prettierConfig = await prettier.resolveConfig('./.prettierrc.js'); | ||
const pages = await globby([ | ||
'pages/*.js', | ||
'data/**/*.mdx', | ||
'!pages/_*.js', | ||
'!pages/api' | ||
]); | ||
const sitemap = ` | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | ||
${pages | ||
.map((page) => { | ||
const path = page | ||
.replace('pages', '') | ||
.replace('data', '') | ||
.replace('.js', '') | ||
.replace('.mdx', ''); | ||
const route = path === '/index' ? '' : path; | ||
return ` | ||
<url> | ||
<loc>${`https://ganning.me${route}`}</loc> | ||
</url> | ||
`; | ||
}) | ||
.join('')} | ||
</urlset> | ||
`; | ||
|
||
const formatted = prettier.format(sitemap, { | ||
...prettierConfig, | ||
parser: 'html' | ||
}); | ||
|
||
// eslint-disable-next-line no-sync | ||
fs.writeFileSync('public/sitemap.xml', formatted); | ||
})(); |