Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Docs engine #233

Merged
merged 9 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions content/docs/ref/ci.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Command Reference: `ci`

```bash
```usage
cml ci [options]
```

Expand All @@ -25,6 +25,6 @@ Instead of wrangling with
`git config user.email` before being able to `git commit` or use
[`cml pr`](/doc/ref/pr), simply run:

```bash
cml ci
```cml
$ cml ci
```
5 changes: 1 addition & 4 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
/* eslint-env node */

const PageWrapper = require('./src/components/organisms/PageWrapper').default

exports.wrapPageElement = PageWrapper
require('./src/styles/global.css')
83 changes: 9 additions & 74 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ const keywords = [

const plugins = [
{
resolve: `gatsby-plugin-typescript`,
resolve: '@dvcorg/gatsby-theme-iterative',
options: {
isTSX: true,
allExtensions: true
remark: true,
cssBase: path.join('src', 'components', 'organisms', 'Page', 'base.css')
}
},
{
Expand All @@ -38,83 +38,14 @@ const plugins = [
}
}
},
'gatsby-plugin-postcss',
'gatsby-plugin-react-helmet',
'gatsby-plugin-sitemap',
`gatsby-plugin-theme-ui`,
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'content',
path: path.join(__dirname, 'content')
}
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: path.join(__dirname, 'static', 'img')
}
},
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
'gatsby-remark-embedder',
{
resolve: 'gatsby-remark-prismjs',
options: {
noInlineHighlight: true,
languageExtensions: [
{
language: 'text',
definition: {}
}
]
}
},
{
resolve: 'gatsby-remark-smartypants',
options: {
quotes: false
}
},
`gatsby-plugin-robots-txt`,
{
resolve: 'gatsby-remark-embed-gist',
options: {
includeDefaultCss: true
}
},
'gatsby-remark-relative-images',
'gatsby-remark-copy-linked-files',
'gatsby-remark-external-links',
{
resolve: 'gatsby-remark-autolink-headers',
options: {
enableCustomId: true,
isIconAfterHeader: true
}
},
{
resolve: 'gatsby-remark-images',
options: {
maxWidth: 700,
withWebp: true,
quality: 90
}
},
'gatsby-remark-responsive-iframe'
]
}
},
{
resolve: 'gatsby-plugin-svgr',
options: {
ref: true
}
},
'gatsby-plugin-sharp',
'gatsby-plugin-catch-links',
{
resolve: 'gatsby-plugin-manifest',
Expand Down Expand Up @@ -238,8 +169,12 @@ module.exports = {
description,
author: 'Iterative',
keywords,
siteUrl: 'https://cml.dev',
title
title,
siteUrl: process.env.HEROKU_APP_NAME
? `https://${process.env.HEROKU_APP_NAME}.herokuapp.com`
: 'https://cml.dev',
twitterUsername: '@DVCorg',
titleTemplate: '%s | CML'
},
developMiddleware: app => {
app.use(redirectsMiddleware)
Expand Down
3 changes: 0 additions & 3 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* eslint-env node */
const React = require('react')

const PageWrapper = require('./src/components/organisms/PageWrapper').default

const onRenderBody = ({ setHeadComponents }) => {
return setHeadComponents([
<script
Expand All @@ -15,5 +13,4 @@ const onRenderBody = ({ setHeadComponents }) => {
])
}

exports.wrapPageElement = PageWrapper
exports.onRenderBody = onRenderBody
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"dev": "gatsby develop",
"author": "LIMIT_BLOG_PAGES=1 SKIP_DOCS=true gatsby develop",
"build": "gatsby build",
"clean": "gatsby clean",
"start": "node ./src/server/index.js",
"test": "jest",
"format-staged": "pretty-quick --staged --no-restage --bail",
Expand Down Expand Up @@ -35,6 +36,7 @@
"node": "<=14.x"
},
"dependencies": {
"@dvcorg/gatsby-theme-iterative": "^0.1.0",
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@hapi/wreck": "^17.0.0",
Expand All @@ -54,7 +56,7 @@
"ease-component": "^1.0.0",
"express": "^4.17.2",
"fs-extra": "^10.0.0",
"gatsby": "^4.5.3",
"gatsby": "^4.13.1",
"gatsby-cli": "4.5.2",
"gatsby-link": "^4.5.0",
"gatsby-plugin-alias-imports": "^1.0.5",
Expand Down Expand Up @@ -127,10 +129,9 @@
"gatsby-plugin-postcss": "^5.5.0",
"gatsby-plugin-react-helmet": "^5.5.0",
"gatsby-plugin-sentry": "^1.0.1",
"gatsby-plugin-sharp": "4.5.2",
"gatsby-plugin-sharp": "^4.13.0",
"gatsby-plugin-sitemap": "^5.5.0",
"gatsby-plugin-svgr": "^3.0.0-beta.0",
"gatsby-plugin-typescript": "^4.5.2",
"gatsby-plugin-webpack-bundle-analyzer": "^1.0.5",
"gatsby-remark-autolink-headers": "^5.5.0",
"gatsby-remark-copy-linked-files": "^5.5.0",
Expand All @@ -144,8 +145,9 @@
"gatsby-remark-smartypants": "^5.5.0",
"gatsby-source-filesystem": "^4.5.2",
"gatsby-transformer-remark": "^5.5.2",
"gatsby-transformer-sharp": "^4.13.0",
"hast-util-select": "^5.0.1",
"husky": "4",
"husky": "^7.0.4",
"jest": "^27.4.7",
"lint-staged": "^12.2.0",
"postcss-color-mod-function": "^3.0.3",
Expand All @@ -159,6 +161,7 @@
"remark-parse": "^10.0.1",
"stylelint": "^14.2.0",
"stylelint-config-standard": "^24.0.0",
"tailwindcss": "^3.0.24",
"typescript": "^4.5.4",
"unist-util-remove-position": "^4.0.1"
},
Expand Down
26 changes: 0 additions & 26 deletions postcss.config.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Page from '../../../../components/organisms/Page'

export default Page
3 changes: 3 additions & 0 deletions src/@dvcorg/gatsby-theme-iterative/getEditLink.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const getEditLink = (sourcePath: string): string =>
`https://github.com/iterative/cml.dev/blob/master/content${sourcePath}`
export default getEditLink
1 change: 1 addition & 0 deletions src/@dvcorg/gatsby-theme-iterative/sidebar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../../content/docs/sidebar.json')
18 changes: 18 additions & 0 deletions src/components/layouts/WrappedLayout/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react'

import MainLayout from '../MainLayout'
import SiteHeader from '../../organisms/SiteHeader'
import SiteFooter from '../../organisms/SiteFooter'
import { IPageProps } from '../../organisms/Page'

const WrappedLayout: React.FC<IPageProps> = ({ children, ...restProps }) => {
return (
<>
<SiteHeader isMain={false} />
<MainLayout {...restProps}>{children}</MainLayout>
<SiteFooter />
</>
)
}

export default WrappedLayout
3 changes: 3 additions & 0 deletions src/components/organisms/Page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useRedirects, useAnchorNavigation, useSmoothScroll } from './utils'

import './base.css'
import './fonts.css'
import WrappedLayout from '../../layouts/WrappedLayout'

export interface IPageProps {
location: {
Expand Down Expand Up @@ -37,6 +38,8 @@ const Page: React.FC<IPageProps> = props => {
if (props.pageContext.isDocs) {
LayoutComponent = DocumentationLayout
}
} else {
LayoutComponent = WrappedLayout
}

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/SiteHeader/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.headerForDoc {
top: 0;
z-index: 1;
z-index: 7;

& > div {
height: var(--layout-header-height);
Expand Down
109 changes: 0 additions & 109 deletions src/components/pages/Documentation/Markdown/ToggleProvider/index.tsx

This file was deleted.

Loading