Skip to content

Commit

Permalink
Merge pull request #1508 from skillrecordings/zac/hide-course-lessons…
Browse files Browse the repository at this point in the history
…-in-the-feed

feat: hide course lessons in TheFeed
  • Loading branch information
Creeland authored Feb 20, 2025
2 parents 931e351 + 710b801 commit 48b4943
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/pages/home/the-feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ import {QueryClient, QueryClientProvider} from '@tanstack/react-query'
import Pagination from '@/components/search/pagination'
import PresetOptions from '@/components/search/components/preset-options'
import {usePagination} from 'react-instantsearch'
import {typsenseAdapterConfig} from '@/utils/typesense'

typesenseAdapter.updateConfiguration({
...typsenseAdapterConfig,
additionalSearchParameters: {
preset: 'the_feed',
},
})
const searchClient = typesenseAdapter.searchClient
const queryClient = new QueryClient()

Expand Down
9 changes: 9 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import groq from 'groq'
import {getServerState} from 'react-instantsearch'
import {renderToString} from 'react-dom/server'
import TheFeed from '@/components/pages/home/the-feed'
import {typsenseAdapterConfig} from '@/utils/typesense'
import {typesenseAdapter} from './q/[[...all]]'

const HomePage: FunctionComponent<React.PropsWithChildren<any>> = ({
data,
Expand Down Expand Up @@ -87,6 +89,13 @@ const homepageQuery = groq`*[_type == 'resource' && slug.current == "curated-hom
export async function getStaticProps() {
const data = await sanityClient.fetch(homepageQuery)

typesenseAdapter.updateConfiguration({
...typsenseAdapterConfig,
additionalSearchParameters: {
preset: 'the_feed',
},
})

const searchServerState = await getServerState(<TheFeed />, {
renderToString,
})
Expand Down

0 comments on commit 48b4943

Please sign in to comment.