Skip to content

Commit

Permalink
2.0 doc
Browse files Browse the repository at this point in the history
  • Loading branch information
PonyCui authored Jan 31, 2024
1 parent d23b91f commit f29a2b2
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 68 deletions.
51 changes: 13 additions & 38 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const siteConfig = {
],
],
title: "MPFlutter",
tagline: "跨平台 Flutter 开发框架",
tagline: "Flutter 小程序开发框架",
organizationName: "mpflutter",
projectName: "mpflutter.github.io",
url: "https://mpflutter.github.io",
Expand All @@ -44,18 +44,18 @@ const siteConfig = {
src: "img/logo.png",
},
items: [
{ label: "教程", to: "docs/concepts" },
{
label: "指南",
items: [
{ label: "Web 应用开发指南", to: "docs/web-intro" },
{ label: "小程序开发指南", to: "docs/weapp-intro" },
{ label: "Flutter Native 开发指南", to: "docs/fn-intro" },
],
label: "起步",
to: "https://mpflutter.feishu.cn/wiki/Wh0OwQF0oiUKrIkyLHrcgwMfn6d",
},
{
label: "平台特性指南",
to: "https://mpflutter.feishu.cn/wiki/FASdwpqeKi2ej8kpALOcsECbnuM",
},
{
label: "商用授权购买",
to: "https://mpflutter.feishu.cn/wiki/KEL9wIQ7ji4ChmkFnTfcIvJPnzb",
},
{ label: "支持我们", to: "docs/support-us" },
{ label: "技术咨询", to: "docs/tech-support" },
{ label: "MPFlutter 2.0", to: "https://weypl4zsnv.feishu.cn/wiki/TayPw6pxKiZGdxkNe4bcmSnNnSg" },
{
label: "GitHub(点个 Star 支持一下呗)",
href: "https://github.com/mpflutter/mpflutter",
Expand All @@ -65,38 +65,13 @@ const siteConfig = {
},
footer: {
style: "dark",
links: [
{
title: "文档",
items: [
{ label: "介绍", to: "docs/concepts" },
{ label: "Web 应用开发指南", to: "docs/web-intro" },
{ label: "微信小程序开发指南", to: "docs/weapp-intro" },
],
},
{
title: "交流",
items: [
{
label: "Stack Overflow",
href: "https://stackoverflow.com/questions/tagged/mpflutter",
},
],
},
{
title: "更多",
items: [
{ label: "Blog", to: "blog" },
{ label: "GitHub", href: "https://github.com/mpflutter/mpflutter" },
],
},
],
links: [],
logo: {
alt: "MPFlutter Logo",
src: "img/oss_logo.png",
href: "https://github.com/mpflutter/mpflutter",
},
copyright: `Copyright © ${new Date().getFullYear()} MPFlutter Team. Built with Docusaurus. <br /><a href="https://beian.miit.gov.cn/" style="color:white" target="_blank">粤ICP备2021121985号</a><br /><span style="color: white">本项目不接受任何违反中国法律行为项目资助,我们也不对任何使用 MPFlutter 开源代码构建的任何应用承担任何法律责任。</span>`,
copyright: `Copyright © ${new Date().getFullYear()} MPFlutter Team. Built with Docusaurus. <br /><a href="https://beian.miit.gov.cn/" style="color:white" target="_blank">粤ICP备2021121985号</a>`,
},
image: "img/logo.png",
gtag: {
Expand Down
65 changes: 35 additions & 30 deletions website/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,43 @@
* @format
*/

'use strict';
"use strict";

import styles from './styles.module.css';
import Link from '@docusaurus/Link';
import useBaseUrl from '@docusaurus/useBaseUrl';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Layout from '@theme/Layout';
import classnames from 'classnames';
import React from 'react';
import styles from "./styles.module.css";
import Link from "@docusaurus/Link";
import useBaseUrl from "@docusaurus/useBaseUrl";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import Layout from "@theme/Layout";
import classnames from "classnames";
import React from "react";

const contents = [
{
content:
'保留 Flutter 秒级、有状态的热重载能力,真正做到所写即所得。',
image: 'img/content/high-speed-train.png',
title: '快速',
content: "自适应的构建脚本,构建小程序就像构建原生应用一般简单。",
image: "img/content/high-speed-train.png",
title: "无缝迁移",
},
{
content: '裁去不必要的 Flutter 渲染层,产物更轻量,运行更流畅。',
image: 'img/content/scales.png',
title: '轻量',
content:
"快速预览,在 Desktop 上使用 Hot Reload / Hot Restart 快速预览界面及应用逻辑。",
image: "img/content/scales.png",
title: "实时预览能力",
},
{
content: '保留 Flutter 工具链,无需变更编码工具、习惯,一行命令即可开始使用。',
image: 'img/content/atom.png',
title: '易用',
content:
"无须裁剪 Flutter Framework,你可以使用 Material / Cupertino 这些官方组件搭建 UI。",
image: "img/content/atom.png",
title: "纯正的 Flutter ",
},
];

const Button = ({children, href}) => {
const Button = ({ children, href }) => {
return (
<div className="col col--2 margin-horiz--sm">
<Link
className="button button--outline button--primary button--lg"
to={href}>
to={href}
>
{children}
</Link>
</div>
Expand All @@ -50,23 +52,25 @@ const Button = ({children, href}) => {

const HomeSplash = () => {
const context = useDocusaurusContext();
const {siteConfig = {}} = context;
const { siteConfig = {} } = context;

return (
<div className={classnames('hero hero-dark', styles.heroBanner)}>
<div className={classnames("hero hero-dark", styles.heroBanner)}>
<div className="container">
<img
className={classnames(styles.heroBannerLogo, 'margin-vert--md')}
src={'img/logo.png'}
className={classnames(styles.heroBannerLogo, "margin-vert--md")}
src={"img/logo.png"}
alt="MPFlutter"
/>
<h1 className="hero__title">{siteConfig.title}</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div
className={classnames(styles.heroButtons, 'name', 'margin-vert--md')}>
<Button href={useBaseUrl('docs/concepts')}>快速开始</Button>
className={classnames(styles.heroButtons, "name", "margin-vert--md")}
>
<Button href="https://weypl4zsnv.feishu.cn/wiki/TayPw6pxKiZGdxkNe4bcmSnNnSg">
快速开始
</Button>
</div>
<a target="_blank" href="https://weypl4zsnv.feishu.cn/wiki/TayPw6pxKiZGdxkNe4bcmSnNnSg"><p style={{fontSize: 14, color: 'grey'}}>MPFlutter 2.0 正式版发布,欢迎使用。</p></a>
</div>
</div>
);
Expand All @@ -78,14 +82,15 @@ const Index = () => {
<HomeSplash />
<div className="container">
<div class="row">
{contents.map(({content, title, image}) => {
{contents.map(({ content, title, image }) => {
return (
<div className="col col--4 margin-vert--md">
<div
className={classnames(
styles.blockContainer,
'padding-horiz--md',
)}>
"padding-horiz--md"
)}
>
<img src={image} className={classnames(styles.blockImage)} />
<h2>{title}</h2>
<p>{content}</p>
Expand Down

0 comments on commit f29a2b2

Please sign in to comment.