Skip to content

Commit

Permalink
clean up website stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
nmccready committed Aug 27, 2019
1 parent d628412 commit 8fa52fc
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 28 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,3 @@ babel.config.js

docs/website/*.md
docs/api_website
docs/public
4 changes: 2 additions & 2 deletions docs/website/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const hardRoutes = [
{
key: './api.md',
name: 'Api',
href: 'https://localhost:9090',
path: 'https://localhost:9090',
href: 'https://nmccready.github.io/use-global-hook-api-website/',
path: 'https://nmccready.github.io/use-global-hook-api-website/',
},
{
key: './coverage.md',
Expand Down
2 changes: 1 addition & 1 deletion docs/website/_logo.js

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

42 changes: 20 additions & 22 deletions gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,31 @@ const build = (

gulp.task('build', build());

gulp.task('docs:website', () => run('yarn x0 docs').exec());

const docsSource = ['**/*.md?(x)', '!docs/**/*', '!node_modules/**/*'];

gulp.task(
'docs:website',
gulp.series('docs:clean', () =>
gulp
.src(docsSource)
.pipe(replace(/\/index.md/g, '')) // fix links
.pipe(
rename((filePath) => {
if (filePath.basename.toUpperCase() === 'README') {
filePath.basename = 'index';
if (filePath.dirname === '.') {
// we're at root README
filePath.basename = 'docs';
}
const setupWebsiteMarkdown = () =>
gulp
.src(docsSource)
.pipe(replace(/\/index.md/g, '')) // fix links
.pipe(
rename((filePath) => {
if (filePath.basename.toUpperCase() === 'README') {
filePath.basename = 'index';
if (filePath.dirname === '.') {
// we're at root README
filePath.basename = 'docs';
}
})
)
.pipe(gulp.dest('docs/website'))
)
);
}
})
)
.pipe(gulp.dest('docs/website'));

const runDevWebsite = () => run('yarn x0 docs/website', { verbosity: 3 }).exec();

gulp.task('docs:website', gulp.series('docs:clean', setupWebsiteMarkdown, runDevWebsite));

gulp.task(
'docs:watch',
'docs:website:dev',
gulp.series('docs:website', () => {
gulp.watch(docsSource, gulp.series('docs:website'));
})
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"build": "yarn gulp default && yarn roll:it",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"docs:api:markdown": "yarn typedoc --theme markdown --exclude ./src/*.spec.ts --exclude ./src/test/* --out ./docs/api ./src",
"docs:api:website": "yarn typedoc --exclude ./src/*.spec.ts --exclude ./src/test/* --out ../docs/api_website ./src",
"docs:api:website": "yarn typedoc --exclude ./src/*.spec.ts --exclude ./src/test/* --out docs/api_website ./src",
"gulp": "node -r esm ./node_modules/.bin/gulp",
"jest": "node -r esm ./node_modules/.bin/jest",
"lint": "eslint --ext .js,.ts,.tsx *.js src --color",
Expand All @@ -29,7 +29,7 @@
"test": "yarn jest",
"test:ci": "yarn lint && yarn test --coverage && yarn coveralls",
"preversion": "yarn build",
"website": "yarn x0 build docs/website",
"website": "yarn x0 build docs",
"website:dev": "yarn gulp docs:website:dev"
},
"devDependencies": {
Expand Down

0 comments on commit 8fa52fc

Please sign in to comment.