-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Implement recommendations for docs #339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
96ac609
feat: implement remoendations API and rough UI for recomended posts
moonmeister 925783a
refactor: remove prev/next links infavor of recommendations and rewor…
moonmeister 697e794
refactor: search and recommendations to share code and return consist…
moonmeister afdb9ae
refactor: move mdx doc id generation into shared file
moonmeister 0f5f518
feat: add mdx doc id generation to docs
moonmeister 7fd17fa
refactor: cleanup recommendations/search endpoints
moonmeister d05d029
refactor: extract doc type tag in search for use elsewhere and make i…
moonmeister 23b0e12
feat: fully implement recommendations UI and load on scroll
moonmeister d218c66
refactor: better collors
moonmeister 73b83af
fix: build error
moonmeister e689155
style: cleanup some styles, change to link component
moonmeister 2e2d0e0
refactor: switch to single icon package and move existing imports, ad…
moonmeister e6687d0
Merge branch 'main' into feat-recomendations
moonmeister 2945671
refactor: cleanup console logs
moonmeister 506388a
feat: add GA event to recommendations box
moonmeister 706e91f
refactor: switch to more semantic aside
moonmeister ddd0fc4
refactor: non-fatal error handling
moonmeister d07f3cc
fix: add key to recommendations component to trigger rerender on navi…
moonmeister a538646
Merge branch 'main' into feat-recomendations
moonmeister a1f31bd
feat: enable hybrid search in search bar
moonmeister 8a076a8
Merge branch 'main' into feat-recomendations
moonmeister fa648e4
wip: updating search to be more resilient
moonmeister f101c16
Merge branch 'main' into feat-recomendations
moonmeister d871f0f
fix: references to old field names
moonmeister 68e208c
fix: remove extra console log
moonmeister 870ef76
fix: inconrect post_type field name
moonmeister 834c76f
fix: incorectly named variable
moonmeister File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import { classNames } from "@/utils/strings"; | ||
|
|
||
| export default function DocTypeTag(type) { | ||
| if (!type || !type.type) { | ||
| return; | ||
| } | ||
|
|
||
| const theType = type.type || type; | ||
|
|
||
| const config = { | ||
| name: "Ext", | ||
| className: "bg-gray-500", | ||
| }; | ||
|
|
||
| if (theType === "mdx_doc") { | ||
| config.name = "Doc"; | ||
| config.className = "bg-teal-800"; | ||
| } else if (theType === "post" || theType === "page") { | ||
| config.name = "Blog"; | ||
| config.className = "bg-purple-600"; | ||
| } | ||
|
|
||
| return ( | ||
| <span | ||
| className={classNames( | ||
| "mr-2 inline-block rounded px-2 py-1 text-xs font-semibold text-gray-200 uppercase", | ||
| config.className, | ||
| )} | ||
| > | ||
| {config.name} | ||
| </span> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems weird that the type could be nested one level (
type.type) or it could just be the top-leveltype. Is there a way to make the format the same, or are they necessarily different?