Skip to content

Commit 714d304

Browse files
authored
Merge pull request #285 from geoblacklight/asset-pipelines
Add info about importmap usage to quickstart
2 parents fb878b1 + 69415ab commit 714d304

1 file changed

Lines changed: 24 additions & 11 deletions

File tree

docs/docs/geoblacklight_quick_start.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,43 @@ This guide covers the quickest way to get up and running with GeoBlacklight, inc
1414

1515
## Creating a new GeoBlacklight application
1616

17-
Bootstrap a new GeoBlacklight application using the template script, replacing `app-name` with the name of your new application:
17+
To create a new application, you can use the `template.rb` file. The options provided at the time you invoke `rails new` depend on your asset management choices.
18+
19+
!!! warning "Choosing an asset pipeline"
20+
It's not trivial to switch your app from one asset strategy to another after creation, so choose based on your needs. For more information on using a bundler vs. importmaps, check out the [Rails docs on choosing an asset pipeline](https://guides.rubyonrails.org/working_with_javascript_in_rails.html#choosing-between-import-maps-and-a-javascript-bundler).
21+
22+
### Using Vite for assets
23+
24+
This approach uses [vite-rails](https://vite-ruby.netlify.app/guide/rails.html) to bundle all of the app's javascript and styles. Presuming you want your app to be in a directory `app-name`, you initialize a new app with:
25+
26+
```
27+
ASSET_PIPELINE=vite rails new app-name -m https://raw.githubusercontent.com/geoblacklight/geoblacklight/main/template.rb -a propshaft --css bootstrap --js rollup
28+
```
29+
30+
### Using importmaps and dartsass-rails for assets
31+
32+
This approach uses Rails's default of [import maps](https://guides.rubyonrails.org/working_with_javascript_in_rails.html#import-maps) for javascript and dart sass for compiling SCSS.
33+
34+
Presuming you want your app to be in a directory `app-name`, you initialize a new app with:
1835

1936
```bash
20-
rails new app-name -m https://raw.githubusercontent.com/geoblacklight/geoblacklight/main/template.rb -a propshaft --css bootstrap --js rollup
37+
ASSET_PIPELINE=importmap rails new app-name -m https://raw.githubusercontent.com/geoblacklight/geoblacklight/main/template.rb -a propshaft --css bootstrap --js importmap
2138
```
2239

23-
Then run the `geoblacklight:server` rake task to run the application:
40+
## Running the application
41+
42+
You can run the `geoblacklight:server` rake task to run the application:
2443

2544
```bash
2645
cd app-name # replace with your app's name
2746
bundle exec rake geoblacklight:server
2847
```
2948

49+
This will also spin up a solr instance for you via Docker and seed it with example fixture data.
50+
3051
- Visit your GeoBlacklight application at: [http://localhost:3000](http://localhost:3000)
3152
- Visit the Solr admin panel at: [http://localhost:8983/solr/#/blacklight-core](http://localhost:8983/solr/#/blacklight-core)
3253

33-
!!! info "Using importmaps for JavaScript"
34-
35-
The default GeoBlacklight template uses [Vite](https://vite-ruby.netlify.app/guide/rails.html) to bundle the application's JavaScript. If you would prefer to use Rails's default of [importmaps](https://github.com/rails/importmap-rails), you can set `--js importmap` when generating your application:
36-
37-
```bash
38-
rails new app-name -m https://raw.githubusercontent.com/geoblacklight/geoblacklight/main/template.rb -a propshaft --css bootstrap --js importmap
39-
```
40-
4154
## Index Example Data
4255

4356
With your Solr server and Rails server already running (via the `geoblacklight:server` rake task above), open a new terminal window and index the GeoBlacklight project's test fixtures via:

0 commit comments

Comments
 (0)