Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit fc27983

Browse files
authored
Updated Docs engine (#233)
* WIP: setting up theme * removing unused * fixed crash issue with pkg upgrade * disabled tailwind prefilght and minor fixes * updated theme pkg * exmaple usage * added wrapped layout for 404 page * removed unused markdownContent * removed docs code
1 parent 7140957 commit fc27983

File tree

33 files changed

+2276
-2205
lines changed

33 files changed

+2276
-2205
lines changed

content/docs/ref/ci.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Command Reference: `ci`
22

3-
```bash
3+
```usage
44
cml ci [options]
55
```
66

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

28-
```bash
29-
cml ci
28+
```cml
29+
$ cml ci
3030
```

gatsby-browser.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
/* eslint-env node */
2-
3-
const PageWrapper = require('./src/components/organisms/PageWrapper').default
4-
5-
exports.wrapPageElement = PageWrapper
2+
require('./src/styles/global.css')

gatsby-config.js

Lines changed: 9 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ const keywords = [
2424

2525
const plugins = [
2626
{
27-
resolve: `gatsby-plugin-typescript`,
27+
resolve: '@dvcorg/gatsby-theme-iterative',
2828
options: {
29-
isTSX: true,
30-
allExtensions: true
29+
remark: true,
30+
cssBase: path.join('src', 'components', 'organisms', 'Page', 'base.css')
3131
}
3232
},
3333
{
@@ -38,83 +38,14 @@ const plugins = [
3838
}
3939
}
4040
},
41-
'gatsby-plugin-postcss',
42-
'gatsby-plugin-react-helmet',
43-
'gatsby-plugin-sitemap',
4441
`gatsby-plugin-theme-ui`,
45-
{
46-
resolve: 'gatsby-source-filesystem',
47-
options: {
48-
name: 'content',
49-
path: path.join(__dirname, 'content')
50-
}
51-
},
5242
{
5343
resolve: 'gatsby-source-filesystem',
5444
options: {
5545
name: 'images',
5646
path: path.join(__dirname, 'static', 'img')
5747
}
5848
},
59-
{
60-
resolve: 'gatsby-transformer-remark',
61-
options: {
62-
plugins: [
63-
'gatsby-remark-embedder',
64-
{
65-
resolve: 'gatsby-remark-prismjs',
66-
options: {
67-
noInlineHighlight: true,
68-
languageExtensions: [
69-
{
70-
language: 'text',
71-
definition: {}
72-
}
73-
]
74-
}
75-
},
76-
{
77-
resolve: 'gatsby-remark-smartypants',
78-
options: {
79-
quotes: false
80-
}
81-
},
82-
`gatsby-plugin-robots-txt`,
83-
{
84-
resolve: 'gatsby-remark-embed-gist',
85-
options: {
86-
includeDefaultCss: true
87-
}
88-
},
89-
'gatsby-remark-relative-images',
90-
'gatsby-remark-copy-linked-files',
91-
'gatsby-remark-external-links',
92-
{
93-
resolve: 'gatsby-remark-autolink-headers',
94-
options: {
95-
enableCustomId: true,
96-
isIconAfterHeader: true
97-
}
98-
},
99-
{
100-
resolve: 'gatsby-remark-images',
101-
options: {
102-
maxWidth: 700,
103-
withWebp: true,
104-
quality: 90
105-
}
106-
},
107-
'gatsby-remark-responsive-iframe'
108-
]
109-
}
110-
},
111-
{
112-
resolve: 'gatsby-plugin-svgr',
113-
options: {
114-
ref: true
115-
}
116-
},
117-
'gatsby-plugin-sharp',
11849
'gatsby-plugin-catch-links',
11950
{
12051
resolve: 'gatsby-plugin-manifest',
@@ -238,8 +169,12 @@ module.exports = {
238169
description,
239170
author: 'Iterative',
240171
keywords,
241-
siteUrl: 'https://cml.dev',
242-
title
172+
title,
173+
siteUrl: process.env.HEROKU_APP_NAME
174+
? `https://${process.env.HEROKU_APP_NAME}.herokuapp.com`
175+
: 'https://cml.dev',
176+
twitterUsername: '@DVCorg',
177+
titleTemplate: '%s | CML'
243178
},
244179
developMiddleware: app => {
245180
app.use(redirectsMiddleware)

gatsby-ssr.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* eslint-env node */
22
const React = require('react')
33

4-
const PageWrapper = require('./src/components/organisms/PageWrapper').default
5-
64
const onRenderBody = ({ setHeadComponents }) => {
75
return setHeadComponents([
86
<script
@@ -15,5 +13,4 @@ const onRenderBody = ({ setHeadComponents }) => {
1513
])
1614
}
1715

18-
exports.wrapPageElement = PageWrapper
1916
exports.onRenderBody = onRenderBody

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"dev": "gatsby develop",
99
"author": "LIMIT_BLOG_PAGES=1 SKIP_DOCS=true gatsby develop",
1010
"build": "gatsby build",
11+
"clean": "gatsby clean",
1112
"start": "node ./src/server/index.js",
1213
"test": "jest",
1314
"format-staged": "pretty-quick --staged --no-restage --bail",
@@ -35,6 +36,7 @@
3536
"node": "<=14.x"
3637
},
3738
"dependencies": {
39+
"@dvcorg/gatsby-theme-iterative": "^0.1.0",
3840
"@emotion/react": "^11.7.1",
3941
"@emotion/styled": "^11.6.0",
4042
"@hapi/wreck": "^17.0.0",
@@ -54,7 +56,7 @@
5456
"ease-component": "^1.0.0",
5557
"express": "^4.17.2",
5658
"fs-extra": "^10.0.0",
57-
"gatsby": "^4.5.3",
59+
"gatsby": "^4.13.1",
5860
"gatsby-cli": "4.5.2",
5961
"gatsby-link": "^4.5.0",
6062
"gatsby-plugin-alias-imports": "^1.0.5",
@@ -127,10 +129,9 @@
127129
"gatsby-plugin-postcss": "^5.5.0",
128130
"gatsby-plugin-react-helmet": "^5.5.0",
129131
"gatsby-plugin-sentry": "^1.0.1",
130-
"gatsby-plugin-sharp": "4.5.2",
132+
"gatsby-plugin-sharp": "^4.13.0",
131133
"gatsby-plugin-sitemap": "^5.5.0",
132134
"gatsby-plugin-svgr": "^3.0.0-beta.0",
133-
"gatsby-plugin-typescript": "^4.5.2",
134135
"gatsby-plugin-webpack-bundle-analyzer": "^1.0.5",
135136
"gatsby-remark-autolink-headers": "^5.5.0",
136137
"gatsby-remark-copy-linked-files": "^5.5.0",
@@ -144,8 +145,9 @@
144145
"gatsby-remark-smartypants": "^5.5.0",
145146
"gatsby-source-filesystem": "^4.5.2",
146147
"gatsby-transformer-remark": "^5.5.2",
148+
"gatsby-transformer-sharp": "^4.13.0",
147149
"hast-util-select": "^5.0.1",
148-
"husky": "4",
150+
"husky": "^7.0.4",
149151
"jest": "^27.4.7",
150152
"lint-staged": "^12.2.0",
151153
"postcss-color-mod-function": "^3.0.3",
@@ -159,6 +161,7 @@
159161
"remark-parse": "^10.0.1",
160162
"stylelint": "^14.2.0",
161163
"stylelint-config-standard": "^24.0.0",
164+
"tailwindcss": "^3.0.24",
162165
"typescript": "^4.5.4",
163166
"unist-util-remove-position": "^4.0.1"
164167
},

postcss.config.js

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Page from '../../../../components/organisms/Page'
2+
3+
export default Page
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const getEditLink = (sourcePath: string): string =>
2+
`https://github.com/iterative/cml.dev/blob/master/content${sourcePath}`
3+
export default getEditLink
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('../../../content/docs/sidebar.json')
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react'
2+
3+
import MainLayout from '../MainLayout'
4+
import SiteHeader from '../../organisms/SiteHeader'
5+
import SiteFooter from '../../organisms/SiteFooter'
6+
import { IPageProps } from '../../organisms/Page'
7+
8+
const WrappedLayout: React.FC<IPageProps> = ({ children, ...restProps }) => {
9+
return (
10+
<>
11+
<SiteHeader isMain={false} />
12+
<MainLayout {...restProps}>{children}</MainLayout>
13+
<SiteFooter />
14+
</>
15+
)
16+
}
17+
18+
export default WrappedLayout

0 commit comments

Comments
 (0)