Skip to content

Commit

Permalink
[FEAT] favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsondev19 committed Jan 8, 2025
1 parent fc44703 commit 23e2b57
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 63 deletions.
2 changes: 1 addition & 1 deletion middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ export { middleware } from "nextra/locales";
export const config = {
// Matcher ignoring `/_next/` and `/api/`
matcher: [
"/((?!api|styles|_next/static|_next/image|favicon.ico|icon.svg|apple-icon.png|sitemap.xml|robots.txt|manifest).*)",
"/((?!api|styles|_next/static|_next/image|favicon|favicon.ico|icon.svg|apple-icon.png|sitemap.xml|robots.txt|manifest).*)",
],
};
37 changes: 0 additions & 37 deletions pages/robots.txt.js

This file was deleted.

Binary file added public/favicon.ico
Binary file not shown.
Binary file added public/favicon/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/favicon/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
17 changes: 17 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Global rules for all bots
User-agent: *
Allow: /

# English section rules
User-agent: *
Allow: /en/
User-agent: *
Allow: /en/Billing/subscription

# Spanish section rules
User-agent: *
Allow: /es/
User-agent: *
Allow: /es/Facturacion/suscripcion

Sitemap: https://docs.rayflat.com/sitemap.xml
27 changes: 3 additions & 24 deletions pages/sitemap.xml.js → public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function generateSiteMap() {
return `<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
Expand All @@ -16,7 +15,7 @@ function generateSiteMap() {
<lastmod>2025-01-07T21:36:02.128Z</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<url>
<loc>https://docs.rayflat.com/es/Facturacion/suscripcion</loc>
<xhtml:link
rel="alternate"
Expand All @@ -29,24 +28,4 @@ function generateSiteMap() {
<lastmod>2025-01-07T21:36:02.128Z</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>`;
}

function SiteMap() {
// getServerSideProps will do the heavy lifting
}

export async function getServerSideProps({ res }) {
const sitemap = generateSiteMap();

res.setHeader("Content-Type", "text/xml");
// we send the XML to the browser
res.write(sitemap);
res.end();

return {
props: {},
};
}

export default SiteMap;
</urlset>
23 changes: 22 additions & 1 deletion theme.config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,28 @@ export default {

return (
<>
{/* OG METADATA */}
<link rel="icon" type="image/icon" href="/favicon.ico" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/favicon/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/favicon/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/favicon/favicon-16x16.png"
/>
<link rel="manifest" href="/favicon/site.webmanifest" />

{/* OG METADATA */}
<meta charset="utf-8" />
<meta property="og:url" content={url} />
<meta property="og:title" content={frontMatter.title} />
<meta property="og:description" content={frontMatter.description} />
Expand Down

0 comments on commit 23e2b57

Please sign in to comment.