Skip to content

Commit

Permalink
feat(docs): add docSearch powered by algolia
Browse files Browse the repository at this point in the history
  • Loading branch information
manudeli committed Jun 28, 2023
1 parent 485ac53 commit 8f3648a
Show file tree
Hide file tree
Showing 7 changed files with 394 additions and 712 deletions.
897 changes: 193 additions & 704 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions websites/docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ const config = {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
algolia: {
appId: 'CLLTO12ZPK',
apiKey: '2f647aa845d2b067e9860616ad6206a0',
indexName: 'jsxcss',
branch: 'main',
contextualSearch: true,
},
}),
}

Expand Down
141 changes: 140 additions & 1 deletion websites/docs/i18n/ko/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"theme.ErrorPageContent.tryAgain": {
"message": "다시 시도해 보세요",
"description": "The label of the button to try again when the page crashed"
"description": "The label of the button to try again rendering when the React error boundary captures an error"
},
"theme.NotFound.title": {
"message": "페이지를 찾을 수 없습니다.",
Expand Down Expand Up @@ -285,5 +285,144 @@
"theme.tags.tagsPageTitle": {
"message": "태그",
"description": "The title of the tag list page"
},
"theme.SearchBar.seeAll": {
"message": "{count}개의 결과 확인하기"
},
"theme.SearchPage.documentsFound.plurals": {
"message": "{count}개의 문서를 찾았습니다.",
"description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.SearchPage.existingResultsTitle": {
"message": "\"{query}\" 검색 결과",
"description": "The search page title for non-empty query"
},
"theme.SearchPage.emptyResultsTitle": {
"message": "문서를 검색합니다.",
"description": "The search page title for empty query"
},
"theme.SearchPage.inputPlaceholder": {
"message": "검색어를 입력하세요.",
"description": "The placeholder for search page input"
},
"theme.SearchPage.inputLabel": {
"message": "검색",
"description": "The ARIA label for search page input"
},
"theme.SearchPage.algoliaLabel": {
"message": "Algolia로 검색",
"description": "The ARIA label for Algolia mention"
},
"theme.SearchPage.noResultsText": {
"message": "검색 결과가 없습니다.",
"description": "The paragraph for empty search result"
},
"theme.SearchPage.fetchingNewResults": {
"message": "새로운 검색 결과를 불러오는 중입니다.",
"description": "The paragraph for fetching new search results"
},
"theme.SearchBar.label": {
"message": "검색",
"description": "The ARIA label and placeholder for search button"
},
"theme.SearchModal.searchBox.resetButtonTitle": {
"message": "검색어 초기화",
"description": "The label and ARIA label for search box reset button"
},
"theme.SearchModal.searchBox.cancelButtonText": {
"message": "취소",
"description": "The label and ARIA label for search box cancel button"
},
"theme.SearchModal.startScreen.recentSearchesTitle": {
"message": "최근",
"description": "The title for recent searches"
},
"theme.SearchModal.startScreen.noRecentSearchesText": {
"message": "최근 검색어 없음",
"description": "The text when no recent searches"
},
"theme.SearchModal.startScreen.saveRecentSearchButtonTitle": {
"message": "이 검색어를 저장",
"description": "The label for save recent search button"
},
"theme.SearchModal.startScreen.removeRecentSearchButtonTitle": {
"message": "이 검색어를 최근 검색어에서 삭제",
"description": "The label for remove recent search button"
},
"theme.SearchModal.startScreen.favoriteSearchesTitle": {
"message": "즐겨찾기",
"description": "The title for favorite searches"
},
"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle": {
"message": "이 검색어를 즐겨찾기에서 삭제",
"description": "The label for remove favorite search button"
},
"theme.SearchModal.errorScreen.titleText": {
"message": "결과를 불러올 수 없음",
"description": "The title for error screen of search modal"
},
"theme.SearchModal.errorScreen.helpText": {
"message": "인터넷 연결을 다시 확인하시기 바랍니다.",
"description": "The help text for error screen of search modal"
},
"theme.SearchModal.footer.selectText": {
"message": "로 선택",
"description": "The explanatory text of the action for the enter key"
},
"theme.SearchModal.footer.selectKeyAriaLabel": {
"message": "엔터 키",
"description": "The ARIA label for the Enter key button that makes the selection"
},
"theme.SearchModal.footer.navigateText": {
"message": "로 이동",
"description": "The explanatory text of the action for the Arrow up and Arrow down key"
},
"theme.SearchModal.footer.navigateUpKeyAriaLabel": {
"message": "화살표 위 키",
"description": "The ARIA label for the Arrow up key button that makes the navigation"
},
"theme.SearchModal.footer.navigateDownKeyAriaLabel": {
"message": "화살표 아래 키",
"description": "The ARIA label for the Arrow down key button that makes the navigation"
},
"theme.SearchModal.footer.closeText": {
"message": "로 종료",
"description": "The explanatory text of the action for Escape key"
},
"theme.SearchModal.footer.closeKeyAriaLabel": {
"message": "Esc 키",
"description": "The ARIA label for the Escape key button that close the modal"
},
"theme.SearchModal.footer.searchByText": {
"message": "검색 제공",
"description": "The text explain that the search is making by Algolia"
},
"theme.SearchModal.noResultsScreen.noResultsText": {
"message": "검색 결과 없음",
"description": "The text explains that there are no results for the following search"
},
"theme.SearchModal.noResultsScreen.suggestedQueryText": {
"message": "다른 추천 검색어",
"description": "The text for the suggested query when no results are found for the following search"
},
"theme.SearchModal.noResultsScreen.reportMissingResultsText": {
"message": "검색 결과가 없는 것이 오류라고 생각되십니까?",
"description": "The text for the question where the user thinks there are missing results"
},
"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText": {
"message": "알려주시기 바랍니다.",
"description": "The text for the link to report missing results"
},
"theme.SearchModal.placeholder": {
"message": "문서 검색",
"description": "The placeholder of the input of the DocSearch pop-up modal"
},
"theme.NavBar.navAriaLabel": {
"message": "Main",
"description": "The ARIA label for the main navigation"
},
"theme.docs.sidebar.navAriaLabel": {
"message": "Docs sidebar",
"description": "The ARIA label for the sidebar navigation"
}
}
4 changes: 4 additions & 0 deletions websites/docs/i18n/ko/docusaurus-theme-classic/navbar.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
"item.label.GitHub": {
"message": "GitHub",
"description": "Navbar item with label GitHub"
},
"logo.alt": {
"message": "JSXCSS Logo",
"description": "The alt text of navbar logo"
}
}
13 changes: 7 additions & 6 deletions websites/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"build": "pnpm gen:i18n && docusaurus build",
"clear": "docusaurus clear && rm -rf docs i18n/ko/docusaurus-plugin-content-docs/current",
"deploy": "docusaurus deploy",
"dev": "pnpm gen:i18n && docusaurus start",
"dev:ko": "pnpm gen:i18n && docusaurus start --locale ko",
"dev": "pnpm gen:i18n && docusaurus start --port 3100",
"dev:ko": "pnpm gen:i18n && docusaurus start --port 3100 --locale ko",
"docusaurus": "docusaurus",
"gen:i18n": "pnpm clear && pnpm ts-node -T ./scripts/build-docs/index.ts && pnpm write-translations",
"lint": "eslint \"**/*.ts*\"",
Expand All @@ -17,17 +17,18 @@
"write-translations": "docusaurus write-translations --locale ko"
},
"dependencies": {
"@docusaurus/core": "2.2.0",
"@docusaurus/preset-classic": "2.2.0",
"@docusaurus/core": "2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.2.0",
"@docusaurus/theme-classic": "^2.2.0",
"@docusaurus/module-type-aliases": "2.4.1",
"@docusaurus/theme-classic": "^2.4.1",
"@docusaurus/types": "^2.4.1",
"@jsxcss/eslint-config": "workspace:*",
"@tsconfig/docusaurus": "^1.0.5",
"@types/node": "^18.11.9",
Expand Down
42 changes: 42 additions & 0 deletions websites/docs/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,45 @@
--ifm-color-primary-lightest: #d6eaff;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}

/* DocSearch */
[data-theme='light'] .DocSearch {
--docsearch-primary-color: var(--ifm-color-primary);
--docsearch-text-color: var(--ifm-font-color-base);
--docsearch-muted-color: var(--ifm-color-secondary-darkest);
--docsearch-container-background: rgba(255, 255, 255, 0.7);
/* Modal */
--docsearch-modal-background: var(--ifm-color-secondary-lighter);
/* Search box */
--docsearch-searchbox-background: var(--ifm-color-secondary);
--docsearch-searchbox-focus-background: var(--ifm-color-white);
/* Hit */
--docsearch-hit-color: var(--ifm-font-color-base);
--docsearch-hit-active-color: var(--ifm-color-white);
--docsearch-hit-background: var(--ifm-color-white);
/* Footer */
--docsearch-footer-background: var(--ifm-color-white);
}

[data-theme='dark'] .DocSearch {
--docsearch-primary-color: var(--ifm-color-primary);
--docsearch-text-color: var(--ifm-font-color-base);
--docsearch-muted-color: var(--ifm-color-secondary-darkest);
--docsearch-container-background: rgba(0, 0, 0, 0.7);
/* Modal */
--docsearch-modal-background: var(--ifm-background-color);
/* Search box */
--docsearch-searchbox-background: var(--ifm-background-color);
--docsearch-searchbox-focus-background: var(--ifm-color-black);
/* Hit */
--docsearch-hit-color: var(--ifm-font-color-base);
--docsearch-hit-active-color: var(--ifm-color-white);
--docsearch-hit-background: var(--ifm-color-emphasis-100);
/* Footer */
--docsearch-footer-background: var(--ifm-background-surface-color);
--docsearch-key-gradient: linear-gradient(
-26.5deg,
var(--ifm-color-emphasis-200) 0%,
var(--ifm-color-emphasis-100) 100%
);
}
2 changes: 1 addition & 1 deletion websites/emotion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev --port 3001",
"dev": "next dev --port 3101",
"lint": "next lint",
"start": "next start"
},
Expand Down

2 comments on commit 8f3648a

@vercel
Copy link

@vercel vercel bot commented on 8f3648a Jun 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./websites/docs

docs.jsxcss.org
jsxcss.org
www.jsxcss.org
docs-git-main-jsxcss.vercel.app
docs-jsxcss.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 8f3648a Jun 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

emotion – ./websites/emotion

emotion-git-main-jsxcss.vercel.app
emotion-jsxcss.vercel.app
emotion.jsxcss.org

Please sign in to comment.