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

saner docs site versions #2545

Merged
merged 9 commits into from
May 29, 2018
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
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ generated
coverage
/docs
docs-static/**/*.d.ts

# exclude site except for site/docs/versions
site/*
site/docs/*
!site/docs/
!site/docs/versions/
site/docs/versions/**/*.d.ts
13 changes: 0 additions & 13 deletions docs-static/docs/index.html

This file was deleted.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
"bundle": "lerna run --parallel bundle",
"compile": "lerna run compile",
"clean": "lerna run --parallel clean",
"clean-docs": "rm -rf docs/* && cp -rf docs-static/* docs/.",
"copy-docs-app": "mkdir -p docs/docs/v3 && cp -rf packages/docs-app/dist/* docs/docs/v3/.",
"copy-landing-app": "cp -rf packages/landing-app/dist/* docs/.",
"deploy": "gh-pages -d docs -b master",
"copy:docs-app": "cp -rf packages/docs-app/dist/ site/docs",
"copy:landing-app": "cp -rf packages/landing-app/dist/ site",
"deploy": "gh-pages -d site -b master",
"dev:all": "lerna run dev --parallel --scope \"!@blueprintjs/{landing-app,table-dev-app}\"",
"dev:core": "lerna run dev --parallel --scope \"@blueprintjs/{core,icons,docs-app}\"",
"dev:docs": "lerna run dev --parallel --scope \"@blueprintjs/{core,docs-app,docs-theme}\"",
Expand All @@ -22,16 +21,17 @@
"dev:landing": "lerna run dev --parallel --scope \"@blueprintjs/{core,landing-app}\"",
"dev:select": "lerna run dev --parallel --scope \"@blueprintjs/{core,select,docs-app}\"",
"dev:table": "lerna run dev --parallel --scope \"@blueprintjs/table-dev-app\"",
"dist": "run-s dist:libs dist:apps dist:docs",
"dist": "run-s dist:libs dist:apps",
"dist:libs": "lerna run dist --parallel --scope \"@blueprintjs/{core,datetime,docs-theme,icons,labs,select,table,timezone}\"",
"dist:apps": "lerna run dist --parallel --scope \"@blueprintjs/{docs-app,landing-app,table-dev-app}\"",
"dist:docs": "run-s clean-docs copy-docs-app copy-landing-app",
"docs-data": "lerna run compile --scope \"@blueprintjs/docs-data\"",
"lint": "lerna run --parallel lint",
"lint-fix": "lerna run --parallel lint-fix",
"serve": "http-server site",
"site": "npm-run-all site:clean -p copy:* -s serve",
"site:clean": "git clean -xdfq site/",
"test": "lerna run --parallel test",
"verify": "npm-run-all -s compile dist:libs dist:apps -p test lint",
"serve": "http-server docs"
"verify": "npm-run-all -s compile dist:libs dist:apps -p test lint"
},
"dependencies": {
"@types/chai": "^4.1.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/docs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"description": "Blueprint Documentation Site",
"private": true,
"scripts": {
"bundle": "run-s bundle:webpack",
"bundle:webpack": "webpack --config ./webpack.config.js",
"bundle": "webpack --config ./webpack.config.js",
"clean": "rm -rf dist/*",
"dev": "webpack-dev-server --config ./webpack.config.js --host 0.0.0.0",
"dist": "cross-env NODE_ENV=production yarn bundle",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs-app/src/components/navHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class NavHeader extends React.PureComponent<INavHeaderProps, {}> {

const match = /docs\/v([0-9]+)/.exec(location.href);
// default to latest release if we can't find a major version in the URL
const currentRelease = match == null ? versions[versions.length - 1].version : match[1];
const currentRelease = match == null ? versions[0].version : match[1];
const releaseItems = versions.map((rel, i) => <MenuItem key={i} href={rel.url} text={rel.version} />);
const menu = <Menu className="docs-version-list">{releaseItems}</Menu>;

Expand Down
9 changes: 7 additions & 2 deletions packages/docs-app/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ const releases: IPackageInfo[] = releasesData.map(pkg => ({
url: `https://www.npmjs.com/package/${pkg.name}`,
}));

const versions: IPackageInfo[] = Object.keys(versionsData).map(majorVersion => ({
url: `https://palantir.github.io/blueprint/docs/v${majorVersion}`,
// sort versions so latest is first
const majorVersions = Object.keys(versionsData)
.sort()
.reverse();
const latestMajor = majorVersions[0];
const versions: IPackageInfo[] = majorVersions.map(majorVersion => ({
url: majorVersion === latestMajor ? `/docs` : `/docs/versions/${majorVersion}`,
version: versionsData[majorVersion],
}));

Expand Down
2 changes: 1 addition & 1 deletion packages/landing-app/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<h1>Blueprint</h1>
<h3>A React-based UI toolkit for the web</h3>
<div>
<a class="landing-button bp3-button bp3-large bp3-minimal" href="docs/v2/">Documentation</a>
<a class="landing-button bp3-button bp3-large bp3-minimal" href="docs">Documentation</a>
<span class="bp3-icon-standard bp3-icon-dot"></span>
<a class="landing-button bp3-button bp3-large bp3-minimal" href="https://github.com/palantir/blueprint" target="_blank">GitHub</a>
</div>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file added site/docs/versions/2/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
46 changes: 46 additions & 0 deletions site/docs/versions/2/docs-app.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions site/docs/versions/2/docs-app.js

Large diffs are not rendered by default.

Binary file not shown.
31 changes: 31 additions & 0 deletions site/docs/versions/2/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<!--[if lte IE 6]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IEMobile 7]> <html class="no-js iem7" lang="en"> <![endif]-->
<!--[if (IE 7)&(!IEMobile)]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if (gte IE 9)|(gt IEMobile 7)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Blueprint – Documentation</title>

<meta name="description" content="">

<link rel="stylesheet" href="docs-app.css">
<link rel="icon" href="assets/favicon.png" sizes="32x32" type="image/png" />

<script type="text/javascript">
if (location.hostname === "blueprintjs.com") {
(function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,"script","https://www.google-analytics.com/analytics.js","ga");
ga("create", "UA-36986232-47", "auto");
ga("send", "pageview", { page: location.pathname + location.search + location.hash });
}
</script>
</head>
<body>
<div id="blueprint-documentation"></div>
<script src="docs-app.js"></script>
</body>
</html>