Skip to content
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

Prepare for docusaurus v3 #3439

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"

- name: Install dependencies
run: |
Expand Down
3 changes: 2 additions & 1 deletion website/docs/getting-started/build-a-sample-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ fn main() {
Finally, add an `index.html` file in the root directory of your app.

```html , title=index.html
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Yew App</title>
<body></body>
</head>
</html>
```
Expand Down
2 changes: 1 addition & 1 deletion website/docs/getting-started/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ We also welcome Pull Requests and issues for when they inevitably get neglected
For more details including a list of examples, refer to the [README].

:::note
Most of the examples have a live deployment that can be found at https://examples.yew.rs/<example_name>.
Most of the examples have a live deployment that can be found at https://examples.yew.rs/'example-name'.
Click the shield on their README page in their respective sub-folder to navigate to the live demo.
:::

Expand Down
2 changes: 1 addition & 1 deletion website/docs/tutorial/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fn main() {
Now, let's create an `index.html` at the root of the project.

```html title="index.html"
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head></head>
<body></body>
Expand Down
4 changes: 3 additions & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ module.exports = {
},
i18n: {
defaultLocale: 'en',
locales: ['en', 'ja', 'zh-Hans', 'zh-Hant'],
locales: ['en', 'ja'],
},
plugins: [
'content-pages',
Expand Down Expand Up @@ -177,12 +177,14 @@ module.exports = {
],
},
],
/*
[
'@easyops-cn/docusaurus-search-local',
{
hashed: true,
indexBlog: false,
},
],
*/
],
}
190 changes: 190 additions & 0 deletions website/docusaurus.config.js.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
const { API_BUTTON } = require('./src/constants')

const editUrl = 'https://github.com/yewstack/yew/blob/master/website/'

/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
title: 'Yew',
tagline:
'A framework for creating reliable and efficient web applications.',
url: 'https://yew.rs',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/logo.svg',
organizationName: 'yewstack', // Usually your GitHub org/user name.
projectName: 'yew', // Usually your repo name.
themeConfig: {
docs: {
sidebar: {
hideable: true,
},
},
navbar: {
title: 'Yew',
logo: {
alt: 'Yew Logo',
src: 'img/logo.svg',
},
items: [
{
type: 'docsVersionDropdown',
position: 'left',
},
{
type: 'localeDropdown',
position: 'left',
},
{
type: 'doc',
position: 'left',
docId: 'getting-started/introduction',
label: 'Docs',
},
{
type: 'doc',
position: 'left',
docId: 'tutorial/index',
label: 'Tutorial',
},
{
docsPluginId: 'community',
type: 'doc',
position: 'right',
docId: 'awesome',
label: 'Community',
},
{
position: 'right',
to: 'blog',
label: 'Blog',
},
{
href: 'https://play.yew.rs/',
position: 'right',
label: 'Playground',
},
{
href: 'https://docs.rs/yew',
position: 'right',
label: API_BUTTON,
},
{
href: 'https://github.com/yewstack/yew',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Support',
items: [
{
label: 'Sponsor Project',
href: 'https://opencollective.com/yew',
},
],
},
{
title: 'Participate',
items: [
{
label: 'GitHub',
href: 'https://github.com/yewstack/yew',
},
{
label: 'Discord',
href: 'https://discord.gg/VQck8X4',
},
{
label: 'Twitter',
href: 'https://twitter.com/yewstack',
},
],
},
{
title: 'More',
items: [
{
label: 'Yew Awesome',
href: 'https://github.com/jetli/awesome-yew',
},
],
},
],
},
prism: {
additionalLanguages: ['rust', 'toml'],
},
gtag: {
trackingID: 'G-DENCL8P4YP',
anonymizeIP: true,
},
},
i18n: {
defaultLocale: 'en',
locales: ['en', 'ja', 'zh-Hans', 'zh-Hant'],
},
plugins: [
'content-pages',
'docusaurus-plugin-sass',
[
'@docusaurus/theme-classic',
{
customCss: require.resolve('./src/css/custom.css'),
},
],
[
'@docusaurus/plugin-content-docs',
{
path: 'docs',
sidebarPath: require.resolve('./sidebars/docs.js'),
editUrl,
routeBasePath: '/docs',
},
],
[
'@docusaurus/plugin-content-docs',
{
id: 'community',
path: 'community',
sidebarPath: require.resolve('./sidebars/community.js'),
routeBasePath: '/community',
editUrl,
},
],
[
'@docusaurus/plugin-content-blog',
{
path: 'blog',
blogTitle: 'Yew Blog',
editUrl,
},
],
[
'client-redirects',
{
redirects: [
// this handles the redirect from `/next` -> to the (current) first item in the docs sidebar
// note: if the first item is changed, it should be reflected here
{
to: '/docs/next/getting-started/introduction', // string
from: ['/docs/next'], // string | string[]
},
],
},
],
/*
[
'@easyops-cn/docusaurus-search-local',
{
hashed: true,
indexBlog: false,
},
],
*/
],
}
50 changes: 20 additions & 30 deletions website/i18n/ja/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@
"message": "サイドバーを隠す",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
"message": "Toggle the collapsible sidebar category '{label}'",
"description": "The ARIA label to toggle the collapsible sidebar category"
},
"theme.docs.tagDocListPageTitle.nDocsTagged": {
"message": "One doc tagged|{count} docs tagged",
"description": "Pluralized label for \"{count} docs tagged\". 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)"
Expand Down Expand Up @@ -230,32 +226,6 @@
"message": "Toggle word wrap",
"description": "The title attribute for toggle word wrapping button of code block lines"
},
"theme.SearchBar.noResultsText": {
"message": "No results"
},
"theme.SearchBar.seeAll": {
"message": "See all results"
},
"theme.SearchBar.label": {
"message": "Search",
"description": "The ARIA label and placeholder for search button"
},
"theme.SearchPage.existingResultsTitle": {
"message": "Search results for \"{query}\"",
"description": "The search page title for non-empty query"
},
"theme.SearchPage.emptyResultsTitle": {
"message": "Search the documentation",
"description": "The search page title for empty query"
},
"theme.SearchPage.documentsFound.plurals": {
"message": "1 document found|{count} documents found",
"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.noResultsText": {
"message": "No documents were found",
"description": "The paragraph for empty search result"
},
"theme.admonition.note": {
"message": "note",
"description": "The default label used for the Note admonition (:::note)"
Expand Down Expand Up @@ -295,5 +265,25 @@
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "Toggle navigation bar",
"description": "The ARIA label for hamburger menu button of mobile navigation"
},
"theme.admonition.warning": {
"message": "warning",
"description": "The default label used for the Warning admonition (:::warning)"
},
"theme.DocSidebarItem.expandCategoryAriaLabel": {
"message": "Expand sidebar category '{label}'",
"description": "The ARIA label to expand the sidebar category"
},
"theme.DocSidebarItem.collapseCategoryAriaLabel": {
"message": "Collapse sidebar category '{label}'",
"description": "The ARIA label to collapse the sidebar category"
},
"theme.unlistedContent.title": {
"message": "Unlisted page",
"description": "The unlisted content banner title"
},
"theme.unlistedContent.message": {
"message": "This page is unlisted. Search engines will not index it, and only users having a direct link can access it.",
"description": "The unlisted content banner message"
}
}
Loading
Loading