
jekyll-streetview
A Jekyll plugin that adds a streetview Liquid tag for embedding Google Street View static images, with no JavaScript.
jekyll-streetview is a Jekyll plugin that puts a Google Street View static image anywhere on your Jekyll site with a single tag. It outputs a plain <img> element from the Google Street View Static API. There’s no JavaScript, iframe, or SDK involved.
Demo
The image below shows 100 S Hill Street in downtown Griffin, Georgia:
{% streetview "100 S Hill Street, Griffin, GA" heading=270 fov=80 width=640 height=400 %}
Why This Exists
A map tells you where something is. Street View shows you what it looks like when you’re standing in front of it. When I’m writing about a downtown revitalization project, a business, or a neighborhood, a Street View image gives readers a sense of the place that a map can’t.
Source Code
- GitHub: github.com/jchance/jekyll-streetview
- RubyGems: rubygems.org/gems/jekyll-streetview
Installation
Add to your Gemfile:
gem "jekyll-streetview", "~> 0.1"
Add to _config.yml:
plugins:
- jekyll-streetview
streetview:
key: AIzaSy...
Your Google API key needs the Street View Static API turned on. If you use address strings, turn on the Geocoding API too.
Then run bundle install.
Usage
By address string (geocoded at build time, cached in _streetview_cache.json):
{% streetview "100 S Hill Street, Griffin, GA" %}
By latitude and longitude:
{% streetview lat=33.248329 lng=-84.263336 %}
With camera controls:
{% streetview "100 S Hill Street, Griffin, GA" heading=270 fov=60 pitch=10 %}
Supported Parameters
| Parameter | Default | Description |
|---|---|---|
lat / lng |
none | Coordinates (required if no address string) |
width |
800 |
Image width in pixels |
height |
400 |
Image height in pixels |
heading |
auto | Camera compass heading (0-360). Omit to let Google point toward the location. |
fov |
90 |
Horizontal field of view (10-120). Lower values zoom in. |
pitch |
0 |
Up/down angle (-90 to 90). Positive = up, negative = down. |
radius |
50 |
Search radius in meters for nearest panorama |
source |
none | Set to outdoor to exclude indoor panoramas |
alt |
"Street View" |
Alt text for the image |
Note on image size
On the free tier, the Google Street View Static API caps images at 640x640. The plugin enforces that for you, so if you pass width=800, it gets clamped to 640. Accounts with billing turned on can go up to 1280x1280.
Styling
The plugin outputs an <img> with the class jekyll-streetview:
.jekyll-streetview {
width: 100%;
height: auto;
border-radius: 4px;
}

