Skip to content

Commit

Permalink
Merge remote-tracking branch 'radiant/dev' into master-radiant, v2.0.…
Browse files Browse the repository at this point in the history
…0-rc.1

# Conflicts:
#	src/migrate.js
  • Loading branch information
m-mohr committed May 9, 2021
2 parents 93aae66 + 8226f83 commit ca80331
Show file tree
Hide file tree
Showing 28 changed files with 628 additions and 22,893 deletions.
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

19 changes: 0 additions & 19 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ dist/
.env
yarn.lock
node_modules/
.netlify
.vscode/
/package-lock.json
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
.env
yarn.lock
node_modules/
.netlify
.vscode/
70 changes: 4 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ npm install
CATALOG_URL=http://path/to/catalog.json npm start -- --open
```

Validation will happen against the version of stac defined in the Catalog, Collection or Item
`stac_version` property. If you are running against an older STAC version where the objects
do not contain a `stac_version` property, you'll need to set the `STAC_VERSION` environment
variable e.g.:

```
STAC_VERSION=0.6.0 CATALOG_URL=http://path/to/catalog.json npm start -- --open
```

STAC Browser defaults to using [HTML5 History
Mode](https://router.vuejs.org/guide/essentials/history-mode.html), which can
cause problems on certain web hosts. To use _hash mode_, set
Expand Down Expand Up @@ -96,65 +87,14 @@ TILE_SOURCE_TEMPLATE=http://localhost:8000/cog/tiles/{z}/{x}/{y}?url={ASSET_HREF
CATALOG_URL=http://path/to/catalog.json npm run build
```

## Prerendering

STAC Browser includes the ability to prerender catalog pages to HTML using
[Puppeteer](https://github.com/GoogleChrome/puppeteer) to control a headless
Chromium instance. This facilitates search engine indexing, as metadata and
content will be present in the HTML prior to loading external catalogs.

To prerender, run:

```bash
bin/prerender.js -p <public URL> <catalog URL>
```

`dist/` will contain all assets necessary to host the browser.

After publishing (see below), the generated sitemap can be submitted for
crawling by Google:

```bash
curl http://www.google.com/ping?sitemap=https://planet.stac.cloud/sitemap.txt
```
If you'd like to publish the STAC Browser instance not on the root path of your domain,
you can set the option [`publicPath`](https://cli.vuejs.org/config/#publicpath) in the file vue.config.js.

## Publishing

After building or prerendering, `dist/` will contain all assets necessary to
After building, `dist/` will contain all assets necessary to
host the browser. These can be manually copied to your web host of choice.

Alternately, you can publish to [Netlify](https://www.netlify.com/) for free.

First, create a new site:

```bash
node_modules/.bin/netlify init
```

The generated site id will be used as `NETLIFY_SITE_ID` in your environment.

To deploy without prerendering:

```bash
CATALOG_URL=... NETLIFY_SITE_ID=... npm run deploy
```

To deploy a prerendered version you'll also need the target URL:

```bash
CATALOG_URL=... NETLIFY_SITE_ID=... STAC_URL=... npm run deploy-prerendered
```

## Crawling

To facilitate prerendering, STAC Browser includes functionality for crawling
catalogs in `bin/crawl.js`.

As-is, this will just output the type and URL for all entries in the catalog.
In real-world use, you'll probably want to use it as an example and write
custom JavaScript to process each entry (similar to how `bin/prerender.js`
uses it).

## Contributing

STAC Browser uses [Vue](https://vuejs.org/).
Expand All @@ -163,6 +103,4 @@ Catalogs and collections are rendered using the
[`Catalog`](src/components/Catalog.vue) component in
[`src/components/`](src/components/). Items are rendered using the
[`Item`](src/components/Item.vue) component. Common functionality across both
components exists in [`src/components/common.js`](src/components/common.js).
Mappings between property keys (e.g. `eo:platform`) are defined in
[`src/properties.js`](src/properties.js).
components exists in [`src/components/common.js`](src/components/common.js).
5 changes: 5 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
31 changes: 0 additions & 31 deletions bin/crawl.js

This file was deleted.

201 changes: 0 additions & 201 deletions bin/prerender.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/_redirects

This file was deleted.

Loading

0 comments on commit ca80331

Please sign in to comment.