A specialized utility to generate ultra-horizontal, minimalist vector locator maps tailored for substack publications and articles. It uses local GeoJSON boundaries of Italy and compiles high-resolution inline graphics with smooth edge-fading and regional inset keymaps.
-
Substack-Ready Palette: Tailored to sit beautifully on standard cream substack backplates (Background:
#FDFCF1, vector outline color:#5D5A37). -
Aspect Ratio: Designed for an ultra-horizontal single cropped layout (
$24:9$ ratio, rendering at high-res$4800 \times 1800$ pixels). -
Edge Fading: Linear gradients at the top and bottom edges (
$150\text{px}$ fade zones) to blend the map seamlessly into the surrounding article body. - Floating Inset Keymap: A borderless, clean keymap of Italy placed in the top-left corner that automatically highlights the target region.
- GeoJSON Caching: Automatically downloads and caches click-that-hood's Italy regions GeoJSON locally for offline, zero-network generation.
- Headless Chrome Rendering: Compiles HTML/SVG templates and leverages your system's headless Google Chrome to snap crisp PNG outputs.
- Python 3.x
- Google Chrome (default location
/Applications/Google Chrome.app/Contents/MacOS/Google Chromeon macOS, or customizable via CLI)
No external Python dependencies are required (uses standard libraries).
The tool contains preconfigured coordinates for three location locators:
monti_prenestini_locator(Lazio)pettorano_sul_gizio_locator(Abruzzo)fontainemore_locator(Valle d'Aosta)
Generate them using the --preset argument:
./generate.py --preset monti_prenestini_locator
./generate.py --preset pettorano_sul_gizio_locator
./generate.py --preset fontainemore_locatorYou can specify custom coordinates, highlight region, and layout settings using CLI options:
./generate.py \
--lat 45.6467 \
--lon 7.8594 \
--region "Valle d'Aosta/Vallée d'Aoste" \
--name custom_map \
--fade-height 150 \
--keymap-y 95 \
--keymap-height 170| Option | Description |
|---|---|
--preset |
Load predefined map configurations from presets.json |
--lat |
Latitude of target location marker |
--lon |
Longitude of target location marker |
--region |
Italy region name to highlight in keymap/main map (e.g., Lazio) |
--name |
Base file name of generated outputs |
--ref-lat |
Latitude of a secondary reference point (e.g. Rome coordinates) |
--ref-lon |
Longitude of a secondary reference point |
--fade-height |
Height in pixels of top/bottom gradients (default: 150) |
--keymap-y |
Inset keymap Y placement on viewBox canvas (default: 95) |
--keymap-height |
Inset keymap vertical scale height (default: 170) |
--output-dir |
Folder to save the output files (default: .) |
--chrome |
Path to Google Chrome binary (default: macOS default path) |
You can view and modify presets in the presets.json file:
{
"monti_prenestini_locator": {
"lat": 41.87,
"lon": 12.90,
"region": "Lazio",
"ref_lat": 41.902783,
"ref_lon": 12.496366
}
}For each execution, the script generates:
- A target SVG-embedded HTML web-view template (
[name].html). - A high-resolution PNG render screenshot (
[name].png).