Skip to content

Commit ea2d7de

Browse files
see7elucaaamaral
authored andcommitted
chore: clean up Docusaurus project by removing unused blog files and updating dependencies and configurations
Signed-off-by: Gabryel Nóbrega <[email protected]>
1 parent 160fd39 commit ea2d7de

18 files changed

+287
-14698
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changes
2+
## Removed
3+
- No need for `docusaurus/blog/` as discussed in Slack, and as the existing text is not relevant to the project, it has been removed.
4+
- Removed `docusaurus/README.md` as it is already present information duplicated with another files like `docs/howtos/documentation_development.md`.
5+
- Removed `docusaurus/package-lock.json` as the local development should be done with `yarn`.
6+
7+
## Added
8+
+ Added `docusaurus/docs/howtos/documentation_development.md` as to give instructions on how to develop documentation.
9+
+ Added `docusaurus/docker.package.json` to include the dependencies needed to build the containers.
10+
11+
## Updated
12+
* Improved `docusaurus/.dockerignore` refenrencing the the other JS modules that are not needed when building the container.
13+
* Updated `docusaurus/package.json` to include the latest versions of the dependencies.
14+
* Included at `docusaurus/Dockerfile` the the new instructions to build the containers of Development and Production.

NOTES.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# TODO
2+
3+
- Check if `package-lock.json` is needed in the repository.
4+
- Confirm repository name for GH Pages deployment:
5+
```js
6+
// Set the production url of your site here
7+
url: 'https://magma.github.io',
8+
// Set the /<baseUrl>/ pathname under which your site is served
9+
// For GitHub pages deployment, it is often '/<projectName>/'
10+
baseUrl: '/magma/',
11+
```
12+
- Create social-card.jpg
13+
14+
---
15+
16+
# Translations
17+
18+
Is possible to make two types of translations in Docusaurus:
19+
20+
- Pages: Will not be possible to use React components as the text to be translated will need to be hardcoded in the js file. For that run the following [command](https://docusaurus.io/docs/cli#docusaurus-write-translations-sitedir):
21+
```sh
22+
yarn run write-translations -- --locale <locale>
23+
```
24+
- Markdowns: Run the following command:
25+
```sh
26+
mkdir -p i18n/<locale>/docusaurus-plugin-content-docs/current
27+
cp -r docs/** i18n/<locale>/docusaurus-plugin-content-docs/current
28+
```
29+
This will create a folder with the translated markdowns. The translated markdowns will be in the `i18n` folder.
30+
Using this method will be needed to manually update all the markdowns for each language.
31+
`TODO` Find a simpler way to translate.
32+

docusaurus/.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
# Local development files
12
**/node_modules
3+
**/package.json
4+
**/package-lock.json
5+
**/yarn.lock

docusaurus/.gitignore

Lines changed: 54 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,54 @@
1-
# Dependencies
2-
/node_modules
3-
4-
# Production
5-
/build
6-
7-
# Generated files
8-
.docusaurus
9-
.cache-loader
10-
11-
# Misc
12-
.DS_Store
13-
.env.local
14-
.env.development.local
15-
.env.test.local
16-
.env.production.local
17-
18-
npm-debug.log*
19-
yarn-debug.log*
20-
yarn-error.log*
1+
# Node modules
2+
**/data/
3+
**/node_modules/
4+
5+
# Build files
6+
**/build/
7+
**/.docusaurus/
8+
**/.cache/
9+
**/.cache-loader/
10+
11+
# Environment variables
12+
**/.env
13+
**/.env.local
14+
**/.env.development.local
15+
**/.env.test.local
16+
**/.env.production.local
17+
18+
# Logs
19+
**/npm-debug.log*
20+
**/yarn-debug.log*
21+
**/yarn-error.log*
22+
**/pnpm-debug.log*
23+
**/lerna-debug.log*
24+
25+
# IDE-specific files
26+
**/.idea/
27+
**/.vscode/
28+
29+
# TypeScript build files
30+
**/*.tsbuildinfo
31+
32+
# MacOS system files
33+
**/.DS_Store
34+
35+
# Linux files
36+
**/*.pid
37+
38+
# Editor-specific files
39+
**/*.suo
40+
**/*.ntvs*
41+
**/*.njsproj
42+
**/*.sln
43+
**/*.sw*
44+
45+
# Miscellaneous
46+
**/*.DS_Store
47+
**/*.log
48+
**/*.swp
49+
50+
# Ignore any package-lock or yarn.lock if using a different package manager
51+
# Uncomment the one you're not using
52+
**/yarn.lock
53+
# **/package-lock.json
54+
# **/pnpm-lock.yaml

docusaurus/Dockerfile

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
1-
# Copyright 2023 The Magma Authors.
1+
FROM node:20-alpine AS base
22

3-
# This source code is licensed under the BSD-style license found in the
4-
# LICENSE file in the root directory of this source tree.
3+
WORKDIR /
54

6-
# Unless required by applicable law or agreed to in writing, software
7-
# distributed under the License is distributed on an "AS IS" BASIS,
8-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9-
# See the License for the specific language governing permissions and
10-
# limitations under the License.
5+
# Copy package.json first
6+
COPY docker.package.json ./package.json
117

12-
FROM node:18
8+
# Check if package-lock.json exists, if not, generate it
9+
RUN [ -f package-lock.json ] || npm install --package-lock-only
1310

14-
WORKDIR /app/website
11+
# Copy package-lock.json only if it exists
12+
COPY package-lock.json* ./
1513

16-
COPY package.json /app/website/package.json
17-
RUN npm install
14+
# Install dependencies
15+
RUN npm ci || npm install
16+
17+
COPY . .
18+
19+
# Development stage
20+
FROM base AS development
21+
CMD ["npm", "run", "start"]
22+
23+
# # Production stage
24+
# FROM base AS build
25+
# RUN npm run build
26+
27+
# # Use Nginx to serve static files
28+
# FROM nginx:alpine
29+
# WORKDIR /usr/share/nginx/html
30+
31+
# # Copy build output from the previous stage
32+
# COPY --from=build /app/build .
33+
34+
# # Expose port for web server
35+
# EXPOSE 80
36+
37+
# # Start Nginx
38+
# CMD ["nginx", "-g", "daemon off;"]

docusaurus/README.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

docusaurus/blog/2019-05-28-first-blog-post.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

docusaurus/blog/2019-05-29-long-blog-post.md

Lines changed: 0 additions & 44 deletions
This file was deleted.

docusaurus/blog/2021-08-01-mdx-blog-post.mdx

Lines changed: 0 additions & 24 deletions
This file was deleted.
Binary file not shown.

0 commit comments

Comments
 (0)