1.1 Guide: https://docs.astro.build/en/getting-started/
1.2 You can build: use Astro to build User Guide, Ecommerce, Blog....
2.1 Source: https://github.com/truemenews/AstroDocument/
2.2 Source Struct
[PUBLIC API DOCUMENT]
|
|__public
|__src
| |__content
| | |__docs
| | |__project1
| | | |__product
| | | | |__product-1.mdx
| | | | |__product-2.mdx
| | | | |__product-n.mdx
| | | | |__...
| | | |__service
| | | | |__add-product.mdx
| | | | |__edit-product.mdx
| | | | |__...
| | | |__introduction.mdx
| | |
| | |__project2
| | | |__direct
| | | | |__member.mdx
| | | |__...
| | |
| | |__anotherSource
| | | |__category1
| | | | |__page1
| | | | |__page2
| | | |
| | | |__category2
| | | | |__page3
| | | | |__page4
| | | |__....
| | |
| | |__....
| |
| |
| |__styles
| |__custom.css
|
|__astro.config.mjs
|__.env.development
|__.env.production
|__...
2.2.1 Public
This folder will contain assets as images
2.2.2 src
This is folder container that's source code, in there:
2.2.2.1 src/content/docs
This is where to store document page. Currently, we will separate two brand as below, if you want to extend document more for another source. Pls, free to add it here
project3
project4
2.2.2.2 src/styles
This is where to store CSS file. Currently, you only use custom.css
2.2.3 astro.config.mjs
This is route of source. That will help you specify route for all pages.
sidebar: [
{
label: 'Project 1',
items: [
{label: 'Giới thiệu', link: '/project1/introduction'},
{label: 'Nhóm api GET', 'items': [
{label: 'Product 1', link: '/project1/product/product-1'},
{label: 'Product 2', link: '/project1//product/product-2'},
{label: 'Product ...', link: '/project1//product/product-n'}
]
},
{label: 'Nhóm Api POST', 'items': [
{label: 'New Product', link: '/project1/service/add-product'},
{label: 'Edit Product', link: '/project1/service/edit-product'}
]
}
]
},
{
label: 'Project 2',
items: [
{label: 'Direct', 'items': [
{label: 'Member', link: '/project2/direct/member'},
]
}
]
},
{
label: 'Reference',
autogenerate: { directory: 'reference' }
}
]
2.2.4 .env.development
When you need to set and use environment variables so you can set it here. And Environment variables only use on Local && Test:
2.2.5 .env.production
When you need to set and use environment variables so you can set it here. And Environment variables only use on Production:
3.1.1 Clone source to your computer
git clone https://github.com/truemenews/AstroDocument.git
3.1.2 Run command as below to deploy source
Move to source folder: cd YourFolder/AstroDocument
Install package required: npm install
3.1.3 Start web server for test
Run command: npm run dev:process
3.1.4 Enjoy results :))
Open Chrome/Firefox and run: http://localhost:4321/
3.2.1 Clone source into your server
git clone https://github.com/truemenews/AstroDocument.git
3.2.2 Go to brand: Development
$ git checkout developmentSwitched to branch 'development'
3.2.3 Edit/Add document as you want to
Reference item 2.2
3.2.4 Deploy code into test enviroment
Commit your code change on: https://github.com/truemenews/AstroDocument/tree/development
Create merge request from branch: development -> development and merge it
Waiting build and enjoy
3.2.5 Enjoy resuts :]]]
Clear cache browser to get last update of source