forked from mapbox/mapbox-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9af0c49
commit cc16fa4
Showing
256 changed files
with
10,946 additions
and
4,368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
url: https://122e4e-mapbox.global.ssl.fastly.net | ||
api: https://122e4e-mapbox.global.ssl.fastly.net/core | ||
tileApi: https://api-maps-staging.tilestream.net | ||
source: docs | ||
permalink: /:categories/:title/ | ||
baseurl: /mapbox-gl-js | ||
excerpt_separator: "" | ||
mapboxglbase: /mapbox-gl-js/dist | ||
future: true | ||
# When Publisher runs Jekyll (which it always does), it will simply copy this | ||
# source directory to _site. Then Publisher will copy _site to S3. | ||
source: _batfish_site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const webpack = require('webpack'); | ||
|
||
module.exports = () => { | ||
const config = { | ||
siteBasePath: '/mapbox-gl-js', | ||
siteOrigin: 'https://www.mapbox.com', | ||
pagesDirectory: `${__dirname}/docs/pages`, | ||
stylesheets: [ | ||
`${__dirname}/docs/components/site.css`, | ||
`${__dirname}/docs/components/prism_highlight.css`, | ||
`${__dirname}/vendor/dotcom-page-shell/page-shell-styles.css` | ||
], | ||
applicationWrapperPath: `${__dirname}/docs/components/application-wrapper.js`, | ||
webpackLoaders: [ | ||
// Use raw loader to get the HTML string contents of examples | ||
{ | ||
test: /\.html$/, | ||
use: 'raw-loader' | ||
} | ||
], | ||
ignoreWithinPagesDirectory: ['example/*.html'], | ||
webpackPlugins: [ | ||
// Make environment variables available within JS that Webpack compiles. | ||
new webpack.DefinePlugin({ | ||
// DEPLOY_ENV is used in config to pick between local/production. | ||
'process.env.DEPLOY_ENV': `"${process.env.DEPLOY_ENV}"` | ||
}) | ||
], | ||
inlineJs: [ | ||
{ | ||
filename: `${__dirname}/vendor/dotcom-page-shell/page-shell-script.js` | ||
} | ||
], | ||
dataSelectors: { | ||
examples: ({pages}) => { | ||
return pages | ||
.filter(({path, frontMatter}) => /\/example\//.test(path) && frontMatter.tags) | ||
.map(({frontMatter}) => frontMatter); | ||
} | ||
} | ||
}; | ||
|
||
// Local builds treat the `dist` directory as static assets, allowing you to test examples against the | ||
// local branch build. Non-local builds ignore the `dist` directory, and examples load assets from the CDN. | ||
config.unprocessedPageFiles = ['dist/**/*.*']; | ||
if (process.env.DEPLOY_ENV !== 'local') { | ||
config.ignoreWithinPagesDirectory.push('dist/**/*.*'); | ||
} | ||
|
||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const fs = require('fs'); | ||
const matter = require('gray-matter'); | ||
|
||
fs.readdirSync(`examples`).forEach((file) => { | ||
if (file[0] === '.') { | ||
return; | ||
} | ||
|
||
const name = /\d\d\d\d-\d\d-\d\d-(.*)\.html$/.exec(file)[1]; | ||
const example = matter(fs.readFileSync(`examples/${file}`, 'utf8')); | ||
|
||
fs.writeFileSync(`docs/pages/example/${name}.html`, example.content); | ||
|
||
delete example.data.layout; | ||
delete example.data.category; | ||
delete example.data.permalink; | ||
|
||
example.data.pathname = `/mapbox-gl-js/example/${name}/`; | ||
|
||
fs.writeFileSync(`docs/pages/example/${name}.js`, | ||
`/*${matter.stringify('', example.data).slice(0, -2)}*/ | ||
import Example from '../../components/example'; | ||
import html from './${name}.html'; | ||
export default Example(html); | ||
`) | ||
}); | ||
|
||
fs.readdirSync(`redirects`).forEach((file) => { | ||
if (file[0] === '.') { | ||
return; | ||
} | ||
|
||
const name = /\d\d\d\d-\d\d-\d\d-(.*)\.html$/.exec(file)[1]; | ||
const example = matter(fs.readFileSync(`redirects/${file}`, 'utf8')); | ||
|
||
fs.writeFileSync(`docs/pages/example/${name}.js`, | ||
`import Redirect from '../../components/redirect'; | ||
import {prefixUrl} from '@mapbox/batfish/modules/prefix-url'; | ||
export default Redirect(prefixUrl('${example.data.redirect}')); | ||
`) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.