Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
homotechsual committed May 19, 2024
2 parents c23eb16 + da4a2ee commit e2fdc56
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 23 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
18 changes: 8 additions & 10 deletions docs/component-library/new/Columns/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,18 @@ The code for the component used for this functionality for should be placed in `
import React from 'react';
// Import clsx library for conditional classes.
import clsx from 'clsx';
// MDXContent is a component used in Docusaurus to display Markdown content with embedded JSX components.
import MDXContent from '@theme/MDXContent';
// Define the Column component as a function
// with children, className, style as properties
// Look https://infima.dev/docs/ for learn more
// Style only affects the element inside the column, but we could have also made the same distinction as for the classes.
export default function Column({ children , className, style }) {
return (
<MDXContent>
<div className={clsx('col' , className)} style={style}>
{children}
</div>
</MDXContent>
);
}
```
Expand All @@ -107,8 +106,7 @@ The code for the component used for this functionality for should be placed in `
import React, { ReactNode, CSSProperties } from 'react';
// Import clsx library for conditional classes.
import clsx from 'clsx';
// MDXContent is a component used in Docusaurus to display Markdown content with embedded JSX components.
import MDXContent from '@theme/MDXContent';
interface ColumnProps {
children: ReactNode;
className?: string;
Expand All @@ -120,11 +118,11 @@ The code for the component used for this functionality for should be placed in `
// Style only affects the element inside the column, but we could have also made the same distinction as for the classes.
export default function Column({ children, className, style }: ColumnProps) {
return (
<MDXContent>
<div className={clsx('col', className)} style={style}>
{children}
</div>
</MDXContent>
);
}
```
Expand Down Expand Up @@ -310,7 +308,7 @@ To follow the Docusaurus documentation, we create a theme folder that will host
### Example Classes and Styling - Source

```html
<Columns className='item shadow--tl padding--lg margin-bottom-xl '>
<Columns className='item padding--lg margin-bottom-xl '>
<Column className='text--success text--bold text--justify item shadow--tl padding--lg'>
#### My First Column
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Expand All @@ -328,7 +326,7 @@ To follow the Docusaurus documentation, we create a theme folder that will host

### Example Classes and Styling - Result

<Columns className='item shadow--tl padding--lg margin-bottom-xl '>
<Columns className='item padding--lg margin-bottom-xl '>
<Column className='text--success text--bold text--justify item shadow--tl padding--lg'>
#### My First Column
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Expand Down
4 changes: 2 additions & 2 deletions docs/deployment/docker/_partials/_dockerfile-npm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ WORKDIR /opt/docusaurus
## Expose the port that Docusaurus will run on.
EXPOSE 3000
## Run the development server.
CMD [ -d "node_modules" ] && npm run start || npm run install && npm run start --host 0.0.0.0
CMD [ -d "node_modules" ] && npm run start --host 0.0.0.0 --poll 1000 || npm run install && npm run start --host 0.0.0.0 --poll 1000
# Stage 2b: Production build mode.
FROM base as prod
Expand All @@ -36,7 +36,7 @@ FROM prod as serve
## Expose the port that Docusaurus will run on.
EXPOSE 3000
## Run the production server.
CMD ["npm", "run", "serve", "--host", "0.0.0.0", "--no-open"]
CMD ["npm", "run", "serve", "--", "--host", "0.0.0.0", "--no-open"]
# Stage 3b: Serve with Caddy.
FROM caddy:2-alpine as caddy
Expand Down
4 changes: 2 additions & 2 deletions docs/deployment/docker/_partials/_dockerfile-pnpm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ WORKDIR /opt/docusaurus
## Expose the port that Docusaurus will run on.
EXPOSE 3000
## Run the development server.
CMD [ -d "node_modules" ] && pnpm start || pnpm install && pnpm start --host 0.0.0.0
CMD [ -d "node_modules" ] && pnpm start --host 0.0.0.0 --poll 1000 || pnpm install && pnpm start --host 0.0.0.0 --poll 1000
# Stage 2b: Production build mode.
FROM base as prod
Expand All @@ -36,7 +36,7 @@ FROM prod as serve
## Expose the port that Docusaurus will run on.
EXPOSE 3000
## Run the production server.
CMD ["pnpm", "serve", "--host", "0.0.0.0", "--no-open"]
CMD ["pnpm", "serve", "--host", "--", "0.0.0.0", "--no-open"]
# Stage 3b: Serve with Caddy.
FROM caddy:2-alpine as caddy
Expand Down
4 changes: 2 additions & 2 deletions docs/deployment/docker/_partials/_dockerfile-yarn.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ WORKDIR /opt/docusaurus
## Expose the port that Docusaurus will run on.
EXPOSE 3000
## Run the development server.
CMD [ -d "node_modules" ] && yarn start || yarn install && yarn start --host 0.0.0.0
CMD [ -d "node_modules" ] && yarn start --host 0.0.0.0 --poll 1000 || yarn install && yarn start --host 0.0.0.0 --poll 1000
# Stage 2b: Production build mode.
FROM base as prod
Expand All @@ -36,7 +36,7 @@ FROM prod as serve
## Expose the port that Docusaurus will run on.
EXPOSE 3000
## Run the production server.
CMD ["yarn", "serve", "--host", "0.0.0.0", "--no-open"]
CMD ["yarn", "serve", "--host", "--", "0.0.0.0", "--no-open"]
# Stage 3b: Serve with Caddy.
FROM caddy:2-alpine as caddy
Expand Down
16 changes: 15 additions & 1 deletion docs/deployment/docker/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,21 @@ This can be done from your package.json:
```
Or in your Dockerfile as an argument to your project’s start command:
```bash
CMD ["npm", "start", “--host”, “0.0.0.0”]
CMD ["npm", "start", "--", "--host", "0.0.0.0"]
```
In order to enable live-reloading in a Docker environment, we can use `--poll` option (See [options](https://docusaurus.io/docs/cli#options) for more details):
```bash
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start --poll 1000",
```
Or in your Dockerfile as an argument to your project’s start command:
```bash
CMD ["npm", "start", "--", "--poll", "1000"]
```
## Building the Docker Image
Expand Down
9 changes: 3 additions & 6 deletions src/components/Column/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { ReactNode, CSSProperties } from 'react';
import clsx from 'clsx';
import MDXContent from '@theme/MDXContent';

interface ColumnProps {
children: ReactNode;
Expand All @@ -10,10 +9,8 @@ interface ColumnProps {

export default function Column({ children, className, style }: ColumnProps) {
return (
<MDXContent>
<div className={clsx('col', className)} style={style}>
{children}
</div>
</MDXContent>
<div className={clsx('col', className)} style={style}>
{children}
</div>
);
}

0 comments on commit e2fdc56

Please sign in to comment.