AWS Amplify 文档项目教程
docsAWS Amplify Framework Documentation项目地址:https://gitcode.com/gh_mirrors/docs28/docs
1. 项目的目录结构及介绍
AWS Amplify 文档项目的目录结构如下:
docs/
├── README.md
├── _category_.json
├── _category_.yml
├── docusaurus.config.js
├── sidebars.js
├── src/
│ ├── components/
│ ├── css/
│ ├── pages/
│ └── theme/
├── static/
│ ├── img/
│ └── js/
└── versioned_docs/
└── version-1.0.0/
目录结构介绍
README.md
: 项目的基本介绍文件。_category_.json
和_category_.yml
: 用于定义文档分类的配置文件。docusaurus.config.js
: Docusaurus 项目的配置文件。sidebars.js
: 侧边栏的配置文件。src/
: 包含自定义组件、样式和页面的目录。components/
: 自定义 React 组件。css/
: 自定义 CSS 样式文件。pages/
: 自定义页面。theme/
: 自定义主题组件。
static/
: 静态资源目录,如图片和 JavaScript 文件。img/
: 图片资源。js/
: JavaScript 文件。
versioned_docs/
: 版本化的文档目录。version-1.0.0/
: 特定版本的文档。
2. 项目的启动文件介绍
AWS Amplify 文档项目使用 Docusaurus 作为静态站点生成器。启动文件主要包括:
docusaurus.config.js
: 这是 Docusaurus 的主要配置文件,包含了站点的基本配置信息,如标题、描述、URL 等。
docusaurus.config.js 示例
module.exports = {
title: 'AWS Amplify 文档',
tagline: '构建全栈应用的强大工具',
url: 'https://docs.amplify.aws',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'aws-amplify',
projectName: 'docs',
themeConfig: {
navbar: {
title: 'AWS Amplify',
logo: {
alt: 'AWS Amplify Logo',
src: 'img/logo.svg',
},
items: [
{
to: 'docs/',
activeBasePath: 'docs',
label: '文档',
position: 'left',
},
{to: 'blog', label: '博客', position: 'left'},
{
href: 'https://github.com/aws-amplify/docs',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: '文档',
items: [
{
label: '入门指南',
to: 'docs/',
},
],
},
{
title: '社区',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/aws-amplify',
},
],
},
{
title: '更多',
items: [
{
label: '博客',
to: 'blog',
},
{
label: 'GitHub',
href: 'https://github.com/aws-amplify/docs',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} AWS Amplify. Built with Docusaurus.`,
},
},
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/aws-amplify/docs/edit/main/',
},
blog: {
showReadingTime: true,
editUrl:
docsAWS Amplify Framework Documentation项目地址:https://gitcode.com/gh_mirrors/docs28/docs