Skip to content

Commit

Permalink
Merge pull request #27 from vtexdocs/feat/algolia-index
Browse files Browse the repository at this point in the history
Feat/algolia index
  • Loading branch information
RobsonOlv authored Feb 1, 2024
2 parents 8a052ec + 0d1207e commit c1802e5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
9 changes: 6 additions & 3 deletions algolia/scraper_md.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -13,7 +16,7 @@
},
"custom_settings": {
"separatorsToIndex": "_",
"attributesForFaceting": ["doctype"],
"attributesForFaceting": ["doctype", "language"],
"attributesToRetrieve": [
"hierarchy",
"content",
Expand Down
4 changes: 4 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
/>
<meta
property="docsearch:language"
content={pageProps.locale || currentLocale}
/>
</Head>
<PreviewContextProvider>
<Layout
Expand Down
3 changes: 2 additions & 1 deletion src/pages/docs/tracks/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const TrackPage: NextPage<Props> = ({
<>
<Head>
<title>{serialized.frontmatter?.title as string}</title>
<meta name="docsearch:doctype" content="Start here" />
<meta name="docsearch:doctype" content="tracks" />
{serialized.frontmatter?.hidden && (
<meta name="robots" content="noindex" />
)}
Expand Down Expand Up @@ -468,6 +468,7 @@ export const getStaticProps: GetStaticProps = async ({
isListed,
breadcrumbList,
branch,
locale,
},
revalidate: 600,
}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/docs/tutorial/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const TutorialPage: NextPage<Props> = ({
<>
<Head>
<title>{serialized.frontmatter?.title as string}</title>
<meta name="docsearch:doctype" content="Tutorials & Solutions" />
<meta name="docsearch:doctype" content="tutorials" />
{serialized.frontmatter?.hidden && (
<meta name="robots" content="noindex" />
)}
Expand Down Expand Up @@ -435,6 +435,7 @@ export const getStaticProps: GetStaticProps = async ({
isListed,
breadcrumbList,
branch,
locale,
},
revalidate: 600,
}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/updates/announcements/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const NewsPage: NextPage<Props> = ({ serialized, branch }) => {
<>
<Head>
<title>{serialized.frontmatter?.title as string}</title>
<meta name="docsearch:doctype" content="News" />
<meta name="docsearch:doctype" content="announcements" />
</Head>
<DocumentContextProvider headings={headings}>
<Flex sx={styles.innerContainer}>
Expand Down Expand Up @@ -227,6 +227,7 @@ export const getStaticProps: GetStaticProps = async ({
sidebarfallback,
sectionSelected,
branch,
locale,
},
revalidate: 600,
}
Expand Down

0 comments on commit c1802e5

Please sign in to comment.