Serve docs in the landing page

This commit is contained in:
Serafeim Chatzopoulos 2022-09-20 19:25:30 +03:00
parent 741f6dfb3a
commit b03bbabb43
4 changed files with 27 additions and 30 deletions

View File

@ -1,41 +1,31 @@
# Website
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
This website is built using [Docusaurus 2](https://docusaurus.io/); please check [here](https://docusaurus.io/docs/installation#requirements) the requirements to run the project.
### Clone repository
```
$ git clone https://code-repo.d4science.org/D-Net/openaire-graph-docs.git
```
### Installation
```
$ yarn
$ npm install
```
### Local Development
```
$ yarn start
$ npm run start
```
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
### Build
### Build and deploy
```
$ yarn build
$ npm run build
```
This command generates static content into the `build` directory and can be served using any static contents hosting service.
### Deployment
Using SSH:
```
$ USE_SSH=true yarn deploy
```
Not using SSH:
```
$ GIT_USER=<Your GitHub username> yarn deploy
```
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

View File

@ -1,4 +1,5 @@
---
slug: /
sidebar_position: 1
---

View File

@ -11,15 +11,15 @@ const config = {
title: 'OpenAIRE Documentation',
tagline: 'Open Access Infrastructure for Research in Europe',
url: 'http://snf-23385.ok-kno.grnetcloud.net',
baseUrl: '/openaire/',
baseUrl: '/', // serve the website at route
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'schatzopoulos', // Usually your GitHub org/user name.
projectName: 'openaire-docs', // Usually your repo name.
organizationName: 'openaire', // Usually your GitHub org/user name.
projectName: 'openaire-graph-docs', // Usually your repo name.
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
@ -35,20 +35,22 @@ const config = {
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
// routeBasePath: '/', // serve the docs at the site's route
routeBasePath: '/', // serve the docs at the site's route
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
// editUrl:
// 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
remarkPlugins: [math],
rehypePlugins: [katex],
},
blog: {
showReadingTime: true,
remarkPlugins: [ math ],
rehypePlugins: [ katex ],
},
blog: false,
// {
// showReadingTime: true,
// },
theme: {
customCss: require.resolve('./src/css/custom.css'),
},

View File

@ -1,9 +1,12 @@
// this file is renamed so as to serve the docs in the site's route
import React from 'react';
import clsx from 'clsx';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Layout from '@theme/Layout';
import HomepageFeatures from '@site/src/components/HomepageFeatures';
import { Redirect } from '@docusaurus/router';
import styles from './index.module.css';
@ -27,6 +30,7 @@ function HomepageHeader() {
}
export default function Home() {
// return <Redirect to="/docs" />;
const {siteConfig} = useDocusaurusContext();
return (
<Layout