Skip to content

Commit

Permalink
fix: baseUrl for custom domain
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiehe99 committed Jan 14, 2025
1 parent f41b578 commit 04978e3
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 59 deletions.
51 changes: 17 additions & 34 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,29 @@
sidebar_position: 1
---

# Tutorial Intro
# 介绍

Let's discover **Docusaurus in less than 5 minutes**.
本工具可部分实现 [希沃云班牌](https://www.seewo.com/article/detail/396) 的功能。

## Getting Started
## 能实现的功能

Get started by **creating a new site**.
- 班主任通知(记录在 Word 文档里)在课间自动在课室的电脑上展示
- 自动抓取家长的留言到通知文档里,并随班主任的通知在课间自动展示

Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
## 需要下载或者安装的东西

### What you'll need
- Python(可选): [下载链接](https://www.python.org/ftp/python/3.12.8/python-3.12.8-amd64.exe)
- 安装一路“Next”到底
- 安装完成之后,按住【win】再按【R】键
- 在弹出的【运行】窗口里输入`cmd`,回车
- 在弹出的黑色窗口里输入下面这行英文,回车

- [Node.js](https://nodejs.org/en/download/) version 18.0 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
```bash
pip install request
```

## Generate a new site
- 注册一个飞书账号(可选)

Generate a new Docusaurus site using the **classic template**.
## Warnning

The classic template will automatically be added to your project after you run the command:

```bash
npm init docusaurus@latest my-website classic
```

You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.

The command also installs all necessary dependencies you need to run Docusaurus.

## Start your site

Run the development server:

```bash
cd my-website
npm run start
```

The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.

The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.

Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
此工具此前为本人担任班主任期间为方便工作而开发,暂未以“产品”形式发布,**易用性有待加强**
28 changes: 14 additions & 14 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import type * as Preset from '@docusaurus/preset-classic';
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)

const config: Config = {
title: 'My Site',
tagline: 'Dinosaurs are cool',
title: 'Banzhuren Notifier 文档',
// tagline: 'Dinosaurs are cool',
favicon: 'img/favicon.ico',

// Set the production url of your site here
url: 'https://your-docusaurus-site.example.com',
url: 'https://docs.banzhuren-notifier.eddiehe.top',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/banzhuren-notifier-docs',
baseUrl: '/',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand All @@ -28,7 +28,7 @@ const config: Config = {
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
locales: ['zh-Hans'],
},

presets: [
Expand All @@ -40,7 +40,7 @@ const config: Config = {
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
'https://github.com/eddiehe99/banzhuren-notifier-docs',
},
blog: {
showReadingTime: true,
Expand All @@ -51,7 +51,7 @@ const config: Config = {
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
'https://github.com/eddiehe99/banzhuren-notifier-docs',
// Useful options to enforce blogging best practices
onInlineTags: 'warn',
onInlineAuthors: 'warn',
Expand All @@ -68,7 +68,7 @@ const config: Config = {
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'My Site',
title: '主页',
logo: {
alt: 'My Site Logo',
src: 'img/logo.svg',
Expand All @@ -82,7 +82,7 @@ const config: Config = {
},
{to: '/blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/facebook/docusaurus',
href: 'https://github.com/eddiehe99/banzhuren-notifier-docs',
label: 'GitHub',
position: 'right',
},
Expand All @@ -92,10 +92,10 @@ const config: Config = {
style: 'dark',
links: [
{
title: 'Docs',
title: '文档',
items: [
{
label: 'Tutorial',
label: '指南',
to: '/docs/intro',
},
],
Expand All @@ -118,20 +118,20 @@ const config: Config = {
],
},
{
title: 'More',
title: '更多',
items: [
{
label: 'Blog',
to: '/blog',
},
{
label: 'GitHub',
href: 'https://github.com/facebook/docusaurus',
href: 'https://github.com/eddiehe99/banzhuren-notifier-docs',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
copyright: `Copyright © ${new Date().getFullYear()} Eddie He. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
Expand Down
15 changes: 6 additions & 9 deletions src/components/HomepageFeatures/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,29 @@ type FeatureItem = {

const FeatureList: FeatureItem[] = [
{
title: 'Easy to Use',
title: '较为易用',
Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default,
description: (
<>
Docusaurus was designed from the ground up to be easily installed and
used to get your website up and running quickly.
配置完成之后即可使用。
</>
),
},
{
title: 'Focus on What Matters',
title: '关注于通知本身',
Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default,
description: (
<>
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
ahead and move your docs into the <code>docs</code> directory.
能实现远程通知,节省班主任搬运通知的时间、精力、体力(特别是需要爬楼梯到班上的班主任)。
</>
),
},
{
title: 'Powered by React',
title: '自动传递家长留言',
Svg: require('@site/static/img/undraw_docusaurus_react.svg').default,
description: (
<>
Extend or customize your website layout by reusing React. Docusaurus can
be extended while reusing the same header and footer.
无需帮家长搬运留言到班上。
</>
),
},
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function HomepageHeader() {
<Link
className="button button--secondary button--lg"
to="/docs/intro">
Docusaurus Tutorial - 5min ⏱️
开始使用 - 15min ⏱️
</Link>
</div>
</div>
Expand All @@ -33,7 +33,7 @@ export default function Home(): ReactNode {
const {siteConfig} = useDocusaurusContext();
return (
<Layout
title={`Hello from ${siteConfig.title}`}
title={`${siteConfig.title}`}
description="Description will go into a meta tag in <head />">
<HomepageHeader />
<main>
Expand Down

0 comments on commit 04978e3

Please sign in to comment.