Skip to content

Commit 7c5d625

Browse files
authored
fix(blogs): update sitemap and fix loading strat on blogs to prevent mobile crash (#2067)
* fix(blogs): update sitemap and fix loading strat on blogs to prevent mobile crash * updated sitemap
1 parent e5cb6e3 commit 7c5d625

File tree

7 files changed

+49
-25
lines changed

7 files changed

+49
-25
lines changed

apps/sim/app/(landing)/studio/[slug]/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export default async function Page({ params }: { params: Promise<{ slug: string
6161
width={450}
6262
height={360}
6363
className='h-auto w-full'
64+
sizes='(max-width: 768px) 100vw, 450px'
6465
priority
6566
itemProp='image'
6667
/>
@@ -131,7 +132,7 @@ export default async function Page({ params }: { params: Promise<{ slug: string
131132
{related.length > 0 && (
132133
<div className='mx-auto max-w-[900px] px-6 pb-24 sm:px-8 md:px-12'>
133134
<h2 className='mb-4 font-medium text-[24px]'>Related posts</h2>
134-
<div className='grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3'>
135+
<div className='grid grid-cols-1 gap-4 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3'>
135136
{related.map((p) => (
136137
<Link key={p.slug} href={`/studio/${p.slug}`} className='group'>
137138
<div className='overflow-hidden rounded-lg border border-gray-200'>
@@ -141,6 +142,8 @@ export default async function Page({ params }: { params: Promise<{ slug: string
141142
width={600}
142143
height={315}
143144
className='h-[160px] w-full object-cover'
145+
sizes='(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw'
146+
loading='lazy'
144147
/>
145148
<div className='p-3'>
146149
<div className='mb-1 text-gray-600 text-xs'>

apps/sim/app/(landing)/studio/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default async function StudioIndex({
6363
</div> */}
6464

6565
{/* Grid layout for consistent rows */}
66-
<div className='grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3'>
66+
<div className='grid grid-cols-1 gap-4 md:grid-cols-2 md:gap-6 lg:grid-cols-3'>
6767
{posts.map((p, i) => {
6868
return (
6969
<Link key={p.slug} href={`/studio/${p.slug}`} className='group flex flex-col'>
@@ -74,6 +74,8 @@ export default async function StudioIndex({
7474
width={800}
7575
height={450}
7676
className='h-48 w-full object-cover'
77+
sizes='(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw'
78+
loading='lazy'
7779
/>
7880
<div className='flex flex-1 flex-col p-4'>
7981
<div className='mb-2 text-gray-600 text-xs'>

apps/sim/app/sitemap.ts

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,56 @@ import { getAllPostMeta } from '@/lib/blog/registry'
44
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
55
const baseUrl = 'https://sim.ai'
66

7-
const staticPages = [
7+
const now = new Date()
8+
9+
const staticPages: MetadataRoute.Sitemap = [
810
{
911
url: baseUrl,
10-
lastModified: new Date(),
11-
changeFrequency: 'daily' as const,
12-
priority: 1,
12+
lastModified: now,
13+
priority: 1.0, // Homepage - highest priority
14+
},
15+
{
16+
url: `${baseUrl}/studio`,
17+
lastModified: now,
18+
priority: 0.9, // Blog index - high value content
19+
},
20+
{
21+
url: `${baseUrl}/studio/tags`,
22+
lastModified: now,
23+
priority: 0.7, // Tags page - discovery/navigation
24+
},
25+
{
26+
url: `${baseUrl}/templates`,
27+
lastModified: now,
28+
priority: 0.8, // Templates - important discovery page
1329
},
1430
{
15-
url: `${baseUrl}/signup`,
16-
lastModified: new Date(),
17-
changeFrequency: 'weekly' as const,
18-
priority: 0.9,
31+
url: `${baseUrl}/changelog`,
32+
lastModified: now,
33+
priority: 0.8, // Changelog - important for users
1934
},
2035
{
21-
url: `${baseUrl}/login`,
22-
lastModified: new Date(),
23-
changeFrequency: 'monthly' as const,
24-
priority: 0.8,
36+
url: `${baseUrl}/careers`,
37+
lastModified: new Date('2024-10-06'),
38+
priority: 0.6, // Careers - important but not core content
2539
},
2640
{
2741
url: `${baseUrl}/terms`,
28-
lastModified: new Date(),
29-
changeFrequency: 'monthly' as const,
30-
priority: 0.5,
42+
lastModified: new Date('2024-10-14'),
43+
priority: 0.5, // Terms - utility page
3144
},
3245
{
3346
url: `${baseUrl}/privacy`,
34-
lastModified: new Date(),
35-
changeFrequency: 'monthly' as const,
36-
priority: 0.5,
47+
lastModified: new Date('2024-10-14'),
48+
priority: 0.5, // Privacy - utility page
3749
},
3850
]
3951

4052
const posts = await getAllPostMeta()
41-
const blogPages = posts.map((p) => ({
53+
const blogPages: MetadataRoute.Sitemap = posts.map((p) => ({
4254
url: p.canonical,
4355
lastModified: new Date(p.updated ?? p.date),
44-
changeFrequency: 'monthly' as const,
45-
priority: 0.9 as const,
56+
priority: 0.9, // Blog posts - high value content
4657
}))
4758

4859
return [...staticPages, ...blogPages]

apps/sim/lib/blog/mdx.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export const mdxComponents: MDXRemoteProps['components'] = {
1111
width={props.width ? Number(props.width) : 800}
1212
height={props.height ? Number(props.height) : 450}
1313
className={clsx('h-auto w-full rounded-lg', props.className)}
14+
sizes='(max-width: 768px) 100vw, 800px'
15+
loading='lazy'
1416
/>
1517
),
1618
h2: (props: any) => (

apps/sim/tailwind.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,5 @@ export default {
162162
},
163163
},
164164
},
165-
plugins: [require('tailwindcss-animate')],
165+
plugins: [require('tailwindcss-animate'), require('@tailwindcss/typography')],
166166
} satisfies Config

bun.lock

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@biomejs/biome": "2.0.0-beta.5",
2424
"@next/env": "15.4.1",
2525
"@octokit/rest": "^21.0.0",
26+
"@tailwindcss/typography": "0.5.19",
2627
"drizzle-kit": "^0.31.4",
2728
"husky": "9.1.7",
2829
"lint-staged": "16.0.0",
@@ -1227,6 +1228,8 @@
12271228

12281229
"@tailwindcss/postcss": ["@tailwindcss/[email protected]", "", { "dependencies": { "@alloc/quick-lru": "^5.2.0", "@tailwindcss/node": "4.1.13", "@tailwindcss/oxide": "4.1.13", "postcss": "^8.4.41", "tailwindcss": "4.1.13" } }, "sha512-HLgx6YSFKJT7rJqh9oJs/TkBFhxuMOfUKSBEPYwV+t78POOBsdQ7crhZLzwcH3T0UyUuOzU/GK5pk5eKr3wCiQ=="],
12291230

1231+
"@tailwindcss/typography": ["@tailwindcss/[email protected]", "", { "dependencies": { "postcss-selector-parser": "6.0.10" }, "peerDependencies": { "tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1" } }, "sha512-w31dd8HOx3k9vPtcQh5QHP9GwKcgbMp87j58qi6xgiBnFFtKEAgCWnDw4qUT8aHwkCp8bKvb/KGKWWHedP0AAg=="],
1232+
12301233
"@tanstack/query-core": ["@tanstack/[email protected]", "", {}, "sha512-4E0RP/0GJCxSNiRF2kAqE/LQkTJVlL/QNU7gIJSptaseV9HP6kOuA+N11y4bZKZxa3QopK3ZuewwutHx6DqDXQ=="],
12311234

12321235
"@tanstack/query-devtools": ["@tanstack/[email protected]", "", {}, "sha512-GtINOPjPUH0OegJExZ70UahT9ykmAhmtNVcmtdnOZbxLwT7R5OmRztR5Ahe3/Cu7LArEmR6/588tAycuaWb1xQ=="],
@@ -2613,7 +2616,7 @@
26132616

26142617
"postcss-nested": ["[email protected]", "", { "dependencies": { "postcss-selector-parser": "^6.1.1" }, "peerDependencies": { "postcss": "^8.2.14" } }, "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ=="],
26152618

2616-
"postcss-selector-parser": ["postcss-selector-parser@7.1.0", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA=="],
2619+
"postcss-selector-parser": ["postcss-selector-parser@6.0.10", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w=="],
26172620

26182621
"postcss-value-parser": ["[email protected]", "", {}, "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="],
26192622

@@ -3479,6 +3482,8 @@
34793482

34803483
"fumadocs-ui/@radix-ui/react-slot": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A=="],
34813484

3485+
"fumadocs-ui/postcss-selector-parser": ["[email protected]", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA=="],
3486+
34823487
"gaxios/https-proxy-agent": ["[email protected]", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="],
34833488

34843489
"gaxios/node-fetch": ["[email protected]", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="],

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"@biomejs/biome": "2.0.0-beta.5",
5454
"@next/env": "15.4.1",
5555
"@octokit/rest": "^21.0.0",
56+
"@tailwindcss/typography": "0.5.19",
5657
"drizzle-kit": "^0.31.4",
5758
"husky": "9.1.7",
5859
"lint-staged": "16.0.0",

0 commit comments

Comments
 (0)