Skip to content

Commit

Permalink
codespace (#2978)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoonz authored Aug 16, 2022
2 parents 04b3a3e + 0c0fde3 commit 7b8d285
Show file tree
Hide file tree
Showing 7 changed files with 1,115 additions and 1,622 deletions.
8 changes: 3 additions & 5 deletions .vscode/PythonImportHelper-v2-Completion.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[
{
"label": "Flask",
"importPath": "flask",
"description": "flask",
[{
"label": "argparse",
"kind": 6,
"isExtraImport": true,
"detail": "flask",
"documentation": {}
Expand Down
2,421 changes: 814 additions & 1,607 deletions docs/README.md

Large diffs are not rendered by default.

275 changes: 275 additions & 0 deletions docs/docs/css/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions gatsby-browser.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const React = require("react")
const Layout = require("./src/components/layout")
// Logs when the client route changes
exports.onRouteUpdate = ({ location, prevLocation }) => {
console.log("new pathname", location.pathname)
console.log("old pathname", prevLocation ? prevLocation.pathname : null)
}
// Wraps every page in a component
exports.wrapPageElement = ({ element, props }) => {<Layout {...props}>{element}</Layout>
2 changes: 1 addition & 1 deletion src/utils/getPages.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import _ from 'lodash';
export default function getPages( pages, urlPath ) {
urlPath = _.trim( urlPath, '/' );
const urlPathParts = _.split( urlPath, '/' );
return _.filter( pages, page => {
return _.filter( pages, (page) => {
const pageUrlPath = _.trim( page.url, '/' );
const pageUrlParts = _.split( pageUrlPath, '/' );
return pageUrlParts.length > urlPathParts.length && _.isEqual( pageUrlParts.slice( 0, urlPathParts.length ), urlPathParts );
Expand Down
14 changes: 9 additions & 5 deletions src/utils/htmlToReact.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ export default function htmlToReact(html) {
return ReactHtmlParser(html, {
transform: (node, index) => {
if (node.type === 'script') {
return !_.isEmpty(node.children) ? (
<ScriptTag key={index} {...node.attribs}>
{convertChildren(node.children, index)}
</ScriptTag>
) : <ScriptTag key={index} {...node.attribs}/>;
if (!_.isEmpty(node.children)) {
return (
<ScriptTag key={index} {...node.attribs}>
{convertChildren(node.children, index)}
</ScriptTag>
);
} else {
return <ScriptTag key={index} {...node.attribs} />;
}
} else if (node.type === 'tag' && node.name === 'a') {
const { href } = node.attribs;
const props = _.omit(node.attribs, 'href');
Expand Down
8 changes: 4 additions & 4 deletions static/admin/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ collections:
label: Docs
folder: src/pages/docs
create: true
#path: '/' # allows to walk inside folders, see https://www.netlifycms.org/docs/beta-features/#folder-collections-path and https://github.com/netlify/netlify-cms/issues/513 and nested collections which allow for recursive subfolders walking without requiring a specific path template: https://www.netlifycms.org/docs/beta-features/#nested-collections
slug: '{{title}}/index'
preview_path: 'src/pages/docs/preview/{{slug}}'
#extension: md
path: '/' # allows to walk inside folders, see https://www.netlifycms.org/docs/beta-features/#folder-collections-path and https://github.com/netlify/netlify-cms/issues/513 and nested collections which allow for recursive subfolders walking without requiring a specific path template: https://www.netlifycms.org/docs/beta-features/#nested-collections
slug: '{{title}}/{{title}}'
preview_path: 'src/pages/doc/{{slug}}'
extension: md
media_folder: '{{media_folder}}/docs'
# adding a nested object will show the collection folder structure, see https://www.netlifycms.org/docs/beta-features/#nested-collections and https://github.com/netlify/netlify-cms/issues/4741#issuecomment-748627801
summary: '{{title}} (last modified {{commit_date}})' # text displayed as the name of each entry in the UI listing
Expand Down

1 comment on commit 7b8d285

@vercel
Copy link

@vercel vercel bot commented on 7b8d285 Aug 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment failed with the following error:

Resource is limited - try again in 17 hours (more than 100, code: "api-deployments-free-per-day").

Please sign in to comment.