Skip to content

Commit e491ef5

Browse files
authored
feat(website): SEO improvements — icons, structured data, redirects (#1435)
- Replace the 1200x628 OG banner being used as favicon with proper square icons (32/180/192/512) generated from the Robyn logo; fix the manifest icon declaration that claimed 512x512 for the banner - Fall back to https://robyn.tech when NEXT_PUBLIC_SITE_URL is unset so the RSS/JSON feed links no longer render as undefined/rss/feed.xml - Normalize trailing slashes in the sitemap siteUrl the same way - Add LinkedIn, X, and PyPI to the Organization sameAs structured data - Add keywords to the SoftwareSourceCode structured data - Make the /documentation -> /documentation/en redirect permanent (308) so link equity is passed - Align the Twitter card handle with the project account (@robyn_oss)
1 parent 8dfe386 commit e491ef5

9 files changed

Lines changed: 31 additions & 7 deletions

File tree

docs_src/next-sitemap.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/** @type {import('next-sitemap').IConfig} */
2-
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://robyn.tech'
2+
const siteUrl = (
3+
process.env.NEXT_PUBLIC_SITE_URL || 'https://robyn.tech'
4+
).replace(/\/+$/, '')
35

46
module.exports = {
57
siteUrl,

docs_src/next.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const nextConfig = {
2929
{
3030
source: '/documentation',
3131
destination: '/documentation/en',
32-
permanent: false,
32+
permanent: true,
3333
},
3434
]
3535
},
21.5 KB
Loading

docs_src/public/favicon-32x32.png

2.24 KB
Loading

docs_src/public/icon-192.png

23.7 KB
Loading

docs_src/public/icon-512.png

119 KB
Loading

docs_src/public/site.webmanifest

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
"theme_color": "#000000",
99
"icons": [
1010
{
11-
"src": "/robynog.png",
11+
"src": "/icon-192.png",
12+
"sizes": "192x192",
13+
"type": "image/png"
14+
},
15+
{
16+
"src": "/icon-512.png",
1217
"sizes": "512x512",
1318
"type": "image/png"
1419
}

docs_src/src/components/SEO.jsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useRouter } from 'next/router'
33

44
const SITE_URL = (process.env.NEXT_PUBLIC_SITE_URL || 'https://robyn.tech').replace(/\/+$/, '')
55
const DEFAULT_OG_IMAGE = `${SITE_URL}/robynog.png`
6-
const TWITTER_HANDLE = '@robaborobyn'
6+
const TWITTER_HANDLE = '@robyn_oss'
77
const SITE_NAME = 'Robyn Framework'
88

99
function escapeJsonLd(obj) {
@@ -120,6 +120,14 @@ export function SoftwareApplicationJsonLd() {
120120
license: 'https://opensource.org/licenses/BSD-2-Clause',
121121
operatingSystem: 'Cross-platform',
122122
runtimePlatform: 'Python 3.10+',
123+
keywords: [
124+
'Python web framework',
125+
'async web framework',
126+
'Rust runtime',
127+
'REST API',
128+
'WebSockets',
129+
'high performance',
130+
],
123131
author: OrganizationJsonLd(),
124132
offers: {
125133
'@type': 'Offer',
@@ -139,6 +147,9 @@ export function OrganizationJsonLd() {
139147
sameAs: [
140148
'https://github.com/sparckles/robyn',
141149
'https://discord.gg/rkERZ5eNU8',
150+
'https://www.linkedin.com/company/robyn-framework/',
151+
'https://twitter.com/robyn_oss',
152+
'https://pypi.org/project/robyn/',
142153
],
143154
}
144155
}

docs_src/src/pages/_document.jsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ const modeScript = `
3636
}
3737
`
3838

39+
const SITE_URL = (
40+
process.env.NEXT_PUBLIC_SITE_URL || 'https://robyn.tech'
41+
).replace(/\/+$/, '')
42+
3943
export default function Document({ __NEXT_DATA__ }) {
4044
const locale = __NEXT_DATA__?.locale || 'en'
4145

@@ -46,14 +50,16 @@ export default function Document({ __NEXT_DATA__ }) {
4650
<link
4751
rel="alternate"
4852
type="application/rss+xml"
49-
href={`${process.env.NEXT_PUBLIC_SITE_URL}/rss/feed.xml`}
53+
href={`${SITE_URL}/rss/feed.xml`}
5054
/>
5155
<link
5256
rel="alternate"
5357
type="application/feed+json"
54-
href={`${process.env.NEXT_PUBLIC_SITE_URL}/rss/feed.json`}
58+
href={`${SITE_URL}/rss/feed.json`}
5559
/>
56-
<link rel="icon" type="image/png" href="/robynog.png" />
60+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
61+
<link rel="icon" type="image/png" sizes="192x192" href="/icon-192.png" />
62+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
5763
<link rel="manifest" href="/site.webmanifest" />
5864
<meta name="theme-color" content="#000000" />
5965
</Head>

0 commit comments

Comments
 (0)