From 20e6712c07dd708adc05d3098d1b5746ad1c2897 Mon Sep 17 00:00:00 2001 From: Robson Oliveira Date: Tue, 23 Jan 2024 10:55:16 -0300 Subject: [PATCH 1/2] refactor(docs): update doctypes --- src/pages/docs/tracks/[slug].tsx | 3 ++- src/pages/docs/tutorial/[slug].tsx | 3 ++- src/pages/updates/announcements/[slug].tsx | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/docs/tracks/[slug].tsx b/src/pages/docs/tracks/[slug].tsx index 475cc138..722a8b3c 100644 --- a/src/pages/docs/tracks/[slug].tsx +++ b/src/pages/docs/tracks/[slug].tsx @@ -109,7 +109,7 @@ const TrackPage: NextPage = ({ <> {serialized.frontmatter?.title as string} - + {serialized.frontmatter?.hidden && ( )} @@ -468,6 +468,7 @@ export const getStaticProps: GetStaticProps = async ({ isListed, breadcrumbList, branch, + locale, }, revalidate: 600, } diff --git a/src/pages/docs/tutorial/[slug].tsx b/src/pages/docs/tutorial/[slug].tsx index c8e7803c..1af7a8bb 100644 --- a/src/pages/docs/tutorial/[slug].tsx +++ b/src/pages/docs/tutorial/[slug].tsx @@ -103,7 +103,7 @@ const TutorialPage: NextPage = ({ <> {serialized.frontmatter?.title as string} - + {serialized.frontmatter?.hidden && ( )} @@ -435,6 +435,7 @@ export const getStaticProps: GetStaticProps = async ({ isListed, breadcrumbList, branch, + locale, }, revalidate: 600, } diff --git a/src/pages/updates/announcements/[slug].tsx b/src/pages/updates/announcements/[slug].tsx index 70f793e3..32beff05 100644 --- a/src/pages/updates/announcements/[slug].tsx +++ b/src/pages/updates/announcements/[slug].tsx @@ -88,7 +88,7 @@ const NewsPage: NextPage = ({ serialized, branch }) => { <> {serialized.frontmatter?.title as string} - + @@ -227,6 +227,7 @@ export const getStaticProps: GetStaticProps = async ({ sidebarfallback, sectionSelected, branch, + locale, }, revalidate: 600, } From 0d1207ee9c078415c9f7f706504871b6ab67d34b Mon Sep 17 00:00:00 2001 From: Robson Oliveira Date: Tue, 23 Jan 2024 10:58:30 -0300 Subject: [PATCH 2/2] feat: get language from page and update scraper_md config --- algolia/scraper_md.json | 9 ++++++--- src/pages/_app.tsx | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/algolia/scraper_md.json b/algolia/scraper_md.json index 7d2c97e2..36b4cbf4 100644 --- a/algolia/scraper_md.json +++ b/algolia/scraper_md.json @@ -1,8 +1,11 @@ { "index_name": "helpcenter-docs", - "start_urls": ["https://helpcenter.vtex.com/docs"], + "start_urls": ["https://leafy-mooncake-7c2e5e.netlify.app//docs"], "stop_urls": [], - "sitemap_urls": ["https://helpcenter.vtex.com/sitemap-0.xml"], + "sitemap_urls": [ + "https://leafy-mooncake-7c2e5e.netlify.app/server-sitemap.xml" + ], + "sitemap_alternate_links": true, "selectors": { "lvl0": "article .title, article h1", "lvl1": "article h2", @@ -13,7 +16,7 @@ }, "custom_settings": { "separatorsToIndex": "_", - "attributesForFaceting": ["doctype"], + "attributesForFaceting": ["doctype", "language"], "attributesToRetrieve": [ "hierarchy", "content", diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 9f2878a4..a0dd9c1e 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -33,6 +33,10 @@ function MyApp({ Component, pageProps }: Props) { property="og:image" content="https://cdn.jsdelivr.net/gh/vtexdocs/devportal@main/public/images/meta-image.png" /> +