diff --git a/README.md b/README.md index ae35f13..06fb2d6 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ Graphene docs are powered by [gatsby](https://github.com/gatsbyjs/gatsby). ## Installation -For running locally this docs. You have to execute +To run the docs locally, you have to execute ```bash yarn ``` -And then +followed by ```bash yarn develop @@ -18,15 +18,15 @@ yarn develop ## Build -For building the docs into the `public` dir, just run: +To build the docs in the `public` dir, just run: ```bash yarn build ``` -## Playground (temporaly disabled) +## Playground (temporarily disabled) -If you want to have the playground running too, just execute +If you also want to have the playground running, just execute ``` ./playground/graphene-js/build.sh @@ -36,4 +36,4 @@ This command will clone the [pypyjs-release-nojit](https://github.com/pypyjs/pyp ## Automation -Each time we modify the docs in the `master` branch Netlify job runs and updates the website, so [Graphene's website](https://graphene-python.org) have always the latest layout. +Each time we modify the docs in the `master` branch a Netlify job runs and updates the website, so [Graphene's website](https://graphene-python.org) always has the latest layout. diff --git a/package.json b/package.json index 5688d59..ea2603d 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "version": "1.0.0", "author": "Kyle Mathews ", "dependencies": { - "@jacobmischka/gatsby-plugin-react-svg": "git+https://github.com/jacobmischka/gatsby-plugin-react-svg.git", + "@jacobmischka/gatsby-plugin-react-svg": + "git+https://github.com/jacobmischka/gatsby-plugin-react-svg.git", "docsearch.js": "^2.5.2", "gatsby": "^1.9.73", "gatsby-link": "^1.6.22", @@ -21,17 +22,18 @@ "rucksack-css": "^1.0.2", "styled-jsx-plugin-postcss": "0.1.0" }, - "keywords": [ - "gatsby" - ], + "keywords": ["gatsby"], "license": "MIT", "main": "n/a", "scripts": { "clean": "rm -rf ./public", "create-sphinx-theme": "./scripts/create_package", - "build": "yarn clean && gatsby build --prefix-paths && ./scripts/replace && yarn create-sphinx-theme", + "build": + "yarn clean && gatsby build --prefix-paths && ./scripts/replace && yarn create-sphinx-theme", "develop": "gatsby develop", - "format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js'", + "serve": "gatsby serve", + "format": + "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js'", "test": "echo \"Error: no test specified\" && exit 1" }, "devDependencies": { diff --git a/src/layouts/index.css b/src/layouts/index.css index fa8d24f..0b5c29e 100644 --- a/src/layouts/index.css +++ b/src/layouts/index.css @@ -38,6 +38,16 @@ body { font-weight: 400; margin: 1.25em 0 0.75em; } +h1 a, +h2 a, +h3 a, +h4 a, +h5 a, +h6 a, +.sphinxsidebar a { + font-weight: normal; +} + @media (min-width: 768px) { .container { width: 750px; diff --git a/src/layouts/index.js b/src/layouts/index.js index 60a627c..8ea9f14 100644 --- a/src/layouts/index.js +++ b/src/layouts/index.js @@ -11,14 +11,29 @@ import { FaGithub, FaBars } from "react-icons/fa"; import "docsearch.js/dist/cdn/docsearch.min.css"; import "./index.css"; -const SEARCH_DOCS = false; +const SEARCH_DOCS = true; -let docsearch; -if (typeof window !== "undefined" && SEARCH_DOCS) { - docsearch = require("docsearch.js/dist/cdn/docsearch.min"); -} else { - docsearch = false; -} +// let docsearch; +// if (typeof window !== "undefined" && SEARCH_DOCS) { +// docsearch = require("docsearch.js/dist/cdn/docsearch.min"); +// try { +// docsearch({ +// apiKey: "4b6d0afa80197db35886555b5ef4721f", +// inputSelector: "#search-docs", +// indexName: "graphene_python", +// transformData: function(suggestions) { +// return suggestions.map(function(suggestion) { +// suggestion.url.replace("http:", "https:"); +// return suggestion; +// }); +// }, +// // "start_urls": ["https://www.example.com/docs"], +// debug: false +// }); +// } catch (e) {} +// } else { +// docsearch = false; +// } const HeaderLink = ({ to, children, docs, ...extra }) => { if (docs) { @@ -37,34 +52,28 @@ const HeaderLink = ({ to, children, docs, ...extra }) => { class Header extends React.Component { componentDidMount() { - if (SEARCH_DOCS && docsearch) { - docsearch({ - apiKey: "25626fae796133dc1e734c6bcaaeac3c", - inputSelector: "#search-docs", - indexName: "docsearch" - // debug: true - }); - } + try { + if (SEARCH_DOCS && typeof window !== "undefined") { + let docsearch = require("docsearch.js/dist/cdn/docsearch.min"); + docsearch({ + apiKey: "4b6d0afa80197db35886555b5ef4721f", + inputSelector: "#search-docs", + indexName: "graphene_python", + transformData: function(suggestions) { + return suggestions.map(function(suggestion) { + suggestion.url = suggestion.url.replace("http:", "https:"); + return suggestion; + }); + } + // debug: true + }); + } + } catch (e) {} } render() { let { docs } = this.props; return (
-
-
- - - - - Learn{" "} - - how Graphene-Python fits into - {" "} - the Graphene family - - -
-
@@ -99,14 +108,6 @@ class Header extends React.Component { > Team - {/* - Support Graphene - */} + */} +
{children()}
diff --git a/src/pages/_sponsors.js b/src/pages/_sponsors.js deleted file mode 100644 index adf829d..0000000 --- a/src/pages/_sponsors.js +++ /dev/null @@ -1,41 +0,0 @@ -import React from "react"; -import GenericLogo from "./sponsors/generic-logo.png"; - -const Sponsors = ({ active }) => { - return ( -
- { - alert("This link will open your company website"); - e.preventDefault(); - e.stopPropagation(); - }} - href="#" - className="sponsor" - > - - - -
- ); -}; - -export default Sponsors; diff --git a/src/pages/docs.css b/src/pages/docs.css index df62af9..e903a9f 100644 --- a/src/pages/docs.css +++ b/src/pages/docs.css @@ -1,12 +1,3 @@ -.graphene-jobs { - margin-top: 40px; -} -.graphene-jobs-iframe { - border: none; - width: 100%; - margin-top: 8px; - height: 300px; -} .docs-container { margin-top: 54px; display: flex; diff --git a/src/pages/docs.js b/src/pages/docs.js index c35ad68..b0674ea 100644 --- a/src/pages/docs.js +++ b/src/pages/docs.js @@ -21,13 +21,9 @@ const Docs = () => { Table Of Contents
{`{{ toctree() }}`}
- -
-

Jobs

-