Skip to content

Commit

Permalink
Upgrade to Docusaurus v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danforbes committed Jun 6, 2020
1 parent f83cecb commit 0aa893e
Show file tree
Hide file tree
Showing 14 changed files with 5,287 additions and 2,444 deletions.
20 changes: 20 additions & 0 deletions website/.gitignore
@@ -0,0 +1,20 @@
# dependencies
/node_modules

# production
/build

# generated files
.docusaurus
.cache-loader

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
140 changes: 140 additions & 0 deletions website/docusaurus.config.js
@@ -0,0 +1,140 @@
/**
* Copyright 2019 Parity Technologies
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// See https://docusaurus.io/docs/site-config for all the possible
// site configuration options.

// List of videos on the "videos" page
const videos = require('./data/videos')

const title_prefix = 'Substrate Developer Hub'
const is_staging = process.env['NODE_ENV'] == 'staging'
const git_rev = is_staging ? process.env['GIT_REV'] : null
const title = is_staging ? `${title_prefix} (@${git_rev})` : title_prefix

const siteConfig = {

title, // Title for your website.
tagline: 'The place for blockchain innovators.',

// Used for publishing and more
organizationName: 'substrate-developer-hub',
projectName: 'substrate-developer-hub.github.io',
// For top-level user or org sites, the organization is still the same.
// e.g., for the https://JoelMarcey.github.io site, it would be set like...
// organizationName: 'JoelMarcey'

// Your website URL
url: 'https://substrate-developer-hub.github.io/',
baseUrl: '/', // Base URL for your project */
// For github.io type URLs, you would set the url and baseUrl like:
// url: 'https://facebook.github.io',
// baseUrl: '/test-site/',

/* path to images for header/footer */
favicon: 'img/favicon.png',

presets: [
[
'@docusaurus/preset-classic',
{
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
docs: {
// Docs folder path relative to website dir.
path: '../docs',
// Sidebars file relative to website dir.
sidebarPath: require.resolve('./sidebars.json'),
// Edit this page button
editUrl: 'https://github.com/substrate-developer-hub/substrate-developer-hub.github.io/edit/source/docs/',
// Show documentation's last contributor and update time
// at the bottom of the page:
showLastUpdateAuthor: true,
showLastUpdateTime: true,
},
},
],
],

themeConfig: {
navbar: {
logo: {
src: 'img/Substrate-logo.svg',
}
},
links: [
{ to: 'docs/index', label: 'Docs', position: 'left' },
{ href: 'https://substrate.dev/recipes/', label: 'Recipes', position: 'left' },
{ to: 'tutorials', label: 'Tutorials' },
{ to: 'community', label: 'Community' },
{ href: 'https://github.com/paritytech/substrate', label: 'GitHub' },
],
// Algolia Search
algolia: {
apiKey: '9b6167fbfe26440cbf4cd75b254e0425',
indexName: 'substrate',
algoliaOptions: {
// https://www.algolia.com/doc/api-reference/api-parameters/
facetFilters: [ 'language:LANGUAGE' ]
}
},
footer:{
logo: {
src: 'img/Substrate-logo.svg'
},
// This copyright info is used in /core/Footer.js and blog RSS/Atom feeds.
copyright: `Copyright © ${new Date().getFullYear()} Parity Technologies`,
},
// Open Graph and Twitter card images.
image: 'img/substrate-dev-hub-card.png',
// Collapsible Categories
sidebarCollapsible: true,
},

// Add custom scripts here that would be placed in <script> tags.
scripts: [
'https://buttons.github.io/buttons.js',
'/js/clipboard.min.js',
'/js/code-block-buttons.js',
'/js/load.js',
{
src: '/js/ui.js',
defer: true
},
{
src: '/js/config.js',
defer: true
},
{
src: '/js/klaro.min.js',
defer: true
}
],

// Style sheets to import
stylesheets: [ 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' ],

// customised blast banner on top
// blast: {
// img: '/img/substrate-v2-doc-invite.png',
// link: '/docs/en/next/getting-started',
// background: 'url(/img/bg-sub01.svg); background-size: cover; background-position: right 0px bottom 500px;',
// fontColor: '#18FFB2'
// }
}

module.exports = siteConfig;
17 changes: 9 additions & 8 deletions website/package.json
@@ -1,19 +1,20 @@
{
"scripts": {
"examples": "docusaurus-examples",
"start": "docusaurus-start",
"build": "docusaurus-build",
"publish-gh-pages": "docusaurus-publish",
"write-translations": "docusaurus-write-translations",
"version": "docusaurus-version",
"rename-version": "docusaurus-rename-version",
"examples": "docusaurus examples",
"start": "docusaurus start",
"build": "docusaurus build",
"publish-gh-pages": "docusaurus deploy",
"write-translations": "docusaurus write-translations",
"version": "docusaurus version",
"rename-version": "docusaurus rename-version",
"crowdin-upload": "crowdin --config ../crowdin.yaml upload sources --auto-update -b master",
"crowdin-download": "crowdin --config ../crowdin.yaml download -b master",
"check-links": "yarn blc http://localhost:3000 -ro --exclude \"http://localhost:3000/docs/ru\" --exclude \"http://localhost:3000/docs/zh-CN\" --exclude \"https://playground.substrate.dev/\" --exclude \"https://player.twitch.tv/?channel=paritylivecoding\" --exclude \"http://localhost:8000/\""
},
"devDependencies": {
"broken-link-checker": "^0.7.8",
"docusaurus": "^1.14.4"
"@docusaurus/core": "^2.0.0-alpha.40",
"@docusaurus/preset-classic": "^2.0.0-alpha.40"
},
"license": "GFDL-1.3-or-later",
"dependencies": {
Expand Down
164 changes: 0 additions & 164 deletions website/siteConfig.js

This file was deleted.

20 changes: 20 additions & 0 deletions website/src/css/custom.css
@@ -0,0 +1,20 @@
/**
* You can override the default Infima variables here.
* Note: this is not a complete list of --ifm- variables.
*/
:root {
--ifm-color-primary: #ff1864;
--ifm-color-primary-dark: #fb0053;
--ifm-color-primary-darker: #ed004e;
--ifm-color-primary-darkest: #c30040;
--ifm-color-primary-light: #ff3477;
--ifm-color-primary-lighter: #ff4280;
--ifm-color-primary-lightest: #ff6c9c;
--ifm-color-secondary: #222222;
--ifm-color-secondary-dark: #1f1f1f;
--ifm-color-secondary-darker: #1d1d1d;
--ifm-color-secondary-darkest: #181818;
--ifm-color-secondary-light: #252525;
--ifm-color-secondary-lighter: #272727;
--ifm-color-secondary-lightest: #2c2c2c;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0aa893e

Please sign in to comment.