Skip to content
Snippets Groups Projects
Commit 1f378581 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis
Browse files

Update pages and README.md

- Adapt this to work under page/docusaurus
- Add content to website pointing back to https://gitlab.com/pages/docusaurus
- Add info in README.md
- Change mod for files that were 755
parent ddc5f23f
No related branches found
No related tags found
No related merge requests found
Showing
with 186 additions and 85 deletions
.dockerignore 100755 → 100644
File mode changed from 100755 to 100644
.gitignore 100755 → 100644
File mode changed from 100755 to 100644
......@@ -5,11 +5,14 @@ pages:
- cd website
- yarn install
- yarn build
- mv ./build/test-site ../public
# The build directory is created based on the value set for projectName in
# website/siteConfig.js. If you change it there, you need to change it here
# as well.
- mv ./build/docusaurus ../public
artifacts:
paths:
- public
only:
- master
Dockerfile 100755 → 100644
File mode changed from 100755 to 100644
# docs
![Build Status](https://gitlab.com/pages/mkdocs/badges/master/pipeline.svg)
---
Example [Docusaurus] website using GitLab Pages.
Learn more about GitLab Pages at https://about.gitlab.com/features/pages and the official
documentation https://docs.gitlab.com/ee/user/project/pages/.
---
## GitLab CI/CD
This project's static Pages are built by [GitLab CI/CD](https://about.gitlab.com/product/continuous-integration/),
following the steps defined in [`.gitlab-ci.yml`](.gitlab-ci.yml):
```yaml
image: node:9.11.1
pages:
script:
- cd website
- yarn install
- yarn build
# The build directory is created based on the value set for projectName in
# website/siteConfig.js. If you change it there, you need to change it here
# as well.
- mv ./build/docusaurus ../public
artifacts:
paths:
- public
only:
- master
```
## Building locally
To work locally with this project, you'll have to follow the steps below:
1. Fork, clone or download this project.
1. Install Docusaurus:
```sh
cd website
yarn install
```
1. Preview your project:
```sh
yarn start
```
Your site can be accessed under http://localhost:3000.
1. Add content.
1. Generate the website (optional):
```sh
yarn build
```
The build directory is created based on the value set for `projectName` in
`website/siteConfig.js`. If you didn't change this value, the website will
be built under `website/build/docusaurus/`.
Read more at the [Docusaurus documentation](https://docusaurus.io).
## GitLab User or Group Pages
If you have forked this project, in order to use it as your user/group website
served on the root path, you will need to:
1. Change the path of your project to `namespace.gitlab.io`, where `namespace` is
your `username` or `groupname`. This can be done by navigating to your
project's **Settings > General** page under the Advanced section.
1. Open `website/siteConfig.js` and change:
1. The `url` to be `https://namespace.gitlab.io` or your
[custom domain](https://docs.gitlab.com/ee/user/project/pages/custom_domains_ssl_tls_certification/index.html) of choice.
1. The `baseUrl` to be an empty string.
If you have forked this project, and want to use it under a subpath, you will
need to:
1. Open `website/siteConfig.js` and change:
1. The `url` to be `https://namespace.gitlab.io` or your
[custom domain](https://docs.gitlab.com/ee/user/project/pages/custom_domains_ssl_tls_certification/index.html) of choice.
1. The `baseUrl` to be the same as the name of your project.
Read more about the [types of GitLab Pages](https://docs.gitlab.com/ce/user/project/pages/getting_started_part_one.html).
## Did you fork this project?
If you forked this project for your own use, please go to your project's
**Settings > General > Advanced** and remove the forking relationship, which
won't be necessary unless you want to contribute back to the GitLab upstream project.
## Troubleshooting
1. CSS is missing! That means two things:
Either that you have wrongly set up the CSS URL in your templates, or
your static generator has a configuration option that needs to be explicitly
set in order to serve static assets under a relative URL.
File mode changed from 100755 to 100644
docs/doc1.md 100755 → 100644
File mode changed from 100755 to 100644
docs/doc2.md 100755 → 100644
File mode changed from 100755 to 100644
docs/doc3.md 100755 → 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
website/README.md 100755 → 100644
......@@ -8,19 +8,17 @@ This website was created with [Docusaurus](https://docusaurus.io/).
* [Adding Content](#adding-content)
* [Full Documentation](#full-documentation)
# Get Started in 5 Minutes
## Get Started in 5 Minutes
1. Make sure all the dependencies for the website are installed:
```sh
# Install dependencies
$ yarn
yarn
```
2. Run your dev server:
```sh
# Start the site
$ yarn start
yarn start
```
## Directory Structure
......@@ -65,7 +63,7 @@ title: This Doc Needs To Be Edited
Edit me...
```
For more information about docs, click [here](https://docusaurus.io/docs/en/navigation)
More information about [docs](https://docusaurus.io/docs/en/navigation).
## Editing an existing blog post
......@@ -81,7 +79,7 @@ title: This Blog Post Needs To Be Edited
Edit me...
```
For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog)
More information about [blog posts](https://docusaurus.io/docs/en/adding-blog).
# Adding Content
......@@ -89,105 +87,102 @@ For more information about blog posts, click [here](https://docusaurus.io/docs/e
1. Create the doc as a new markdown file in `/docs`, example `docs/newly-created-doc.md`:
```md
---
id: newly-created-doc
title: This Doc Needs To Be Edited
---
```md
---
id: newly-created-doc
title: This Doc Needs To Be Edited
---
My new content here..
```
My new content here..
```
1. Refer to that doc's ID in an existing sidebar in `website/sidebar.json`:
```javascript
// Add newly-created-doc to the Getting Started category of docs
{
"docs": {
"Getting Started": [
"quick-start",
"newly-created-doc" // new doc here
],
...
},
...
}
```
For more information about adding new docs, click [here](https://docusaurus.io/docs/en/navigation)
```javascript
// Add newly-created-doc to the Getting Started category of docs
{
"docs": {
"Getting Started": [
"quick-start",
"newly-created-doc" // new doc here
],
...
},
...
}
```
More information about [adding new docs](https://docusaurus.io/docs/en/navigation).
## Adding a new blog post
1. Make sure there is a header link to your blog in `website/siteConfig.js`:
`website/siteConfig.js`
```javascript
headerLinks: [
...
{ blog: true, label: 'Blog' },
...
]
```
```javascript
headerLinks: [
...
{ blog: true, label: 'Blog' },
...
]
```
2. Create the blog post with the format `YYYY-MM-DD-My-Blog-Post-Title.md` in `website/blog`:
1. Create the blog post with the format `YYYY-MM-DD-My-Blog-Post-Title.md` in `website/blog`:
`website/blog/2018-05-21-New-Blog-Post.md`
`website/blog/2018-05-21-New-Blog-Post.md`
```markdown
---
author: Frank Li
authorURL: https://twitter.com/foobarbaz
authorFBID: 503283835
title: New Blog Post
---
```markdown
---
author: Frank Li
authorURL: https://twitter.com/foobarbaz
authorFBID: 503283835
title: New Blog Post
---
Lorem Ipsum...
```
Lorem Ipsum...
```
For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog)
More information about [blog posts](https://docusaurus.io/docs/en/adding-blog).
## Adding items to your site's top navigation bar
1. Add links to docs, custom pages or external links by editing the headerLinks field of `website/siteConfig.js`:
`website/siteConfig.js`
```javascript
{
headerLinks: [
...
/* you can add docs */
{ doc: 'my-examples', label: 'Examples' },
/* you can add custom pages */
{ page: 'help', label: 'Help' },
/* you can add external links */
{ href: 'https://github.com/facebook/docusaurus', label: 'GitHub' },
...
],
...
}
```
For more information about the navigation bar, click [here](https://docusaurus.io/docs/en/navigation)
```javascript
{
headerLinks: [
...
/* you can add docs */
{ doc: 'my-examples', label: 'Examples' },
/* you can add custom pages */
{ page: 'help', label: 'Help' },
/* you can add external links */
{ href: 'https://github.com/facebook/docusaurus', label: 'GitHub' },
...
],
...
}
```
More information about the [navigation bar](https://docusaurus.io/docs/en/navigation).
## Adding custom pages
1. Docusaurus uses React components to build pages. The components are saved as .js files in `website/pages/en`:
1. If you want your page to show up in your navigation header, you will need to update `website/siteConfig.js` to add to the `headerLinks` element:
`website/siteConfig.js`
```javascript
{
headerLinks: [
...
{ page: 'my-new-custom-page', label: 'My New Custom Page' },
...
],
...
}
```
```javascript
{
headerLinks: [
...
{ page: 'my-new-custom-page', label: 'My New Custom Page' },
...
],
...
}
```
For more information about custom pages, click [here](https://docusaurus.io/docs/en/custom-pages).
More information about [custom pages](https://docusaurus.io/docs/en/custom-pages).
# Full Documentation
## Full Documentation
Full documentation can be found on the [website](https://docusaurus.io/).
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -69,7 +69,8 @@ class Footer extends React.Component {
<div>
<h5>More</h5>
<a href={`${this.props.config.baseUrl}blog`}>Blog</a>
<a href="https://github.com/">GitHub</a>
<a href="https://gitlab.com/pages/docusaurus" target="_blank">Built by GitLab Pages</a>
<a href="https://github.com/facebook/docusaurus" target="_blank">Docusaurus on GitHub</a>
<a
className="github-button"
href={this.props.config.repoUrl}
......
File mode changed from 100755 to 100644
......@@ -64,7 +64,7 @@ class HomeSplash extends React.Component {
<div className="inner">
<ProjectTitle siteConfig={siteConfig} />
<PromoSection>
<Button href="#try">Try It Out</Button>
<Button href="https://gitlab.com/pages/docusaurus" target="_blank">Host it yourself</Button>
<Button href={docUrl('doc1.html')}>Example Link</Button>
<Button href={docUrl('doc2.html')}>Example Link 2</Button>
</PromoSection>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment