From b03bbabb43d4d0b552d42e41b447d948ed74e39a Mon Sep 17 00:00:00 2001 From: Serafeim Chatzopoulos Date: Tue, 20 Sep 2022 19:25:30 +0300 Subject: [PATCH] Serve docs in the landing page --- README.md | 30 ++++++++++------------------ docs/intro.md | 1 + docusaurus.config.js | 22 ++++++++++---------- src/pages/{index.js => index.js.old} | 4 ++++ 4 files changed, 27 insertions(+), 30 deletions(-) rename src/pages/{index.js => index.js.old} (88%) diff --git a/README.md b/README.md index aaba2fa..a7428f1 100644 --- a/README.md +++ b/README.md @@ -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= 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. diff --git a/docs/intro.md b/docs/intro.md index d5d3f65..1f2830e 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -1,4 +1,5 @@ --- +slug: / sidebar_position: 1 --- diff --git a/docusaurus.config.js b/docusaurus.config.js index 97df166..d4c318d 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -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'), }, diff --git a/src/pages/index.js b/src/pages/index.js.old similarity index 88% rename from src/pages/index.js rename to src/pages/index.js.old index 49742f9..65d9b0c 100644 --- a/src/pages/index.js +++ b/src/pages/index.js.old @@ -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 ; const {siteConfig} = useDocusaurusContext(); return (