first commit
This commit is contained in:
16
themes/osm/.travis.yml
Normal file
16
themes/osm/.travis.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
git:
|
||||
depth: false
|
||||
|
||||
env:
|
||||
- HUGO_VERSION="0.46"
|
||||
|
||||
install:
|
||||
- wget -q https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz
|
||||
- tar xf hugo_${HUGO_VERSION}_Linux-64bit.tar.gz
|
||||
- mv hugo ~/bin/
|
||||
- gem install html-proofer
|
||||
|
||||
script:
|
||||
- cd exampleSite
|
||||
- HUGO_THEME=hugo-component-osm hugo --themesDir ../.. -v
|
||||
- htmlproofer public --check-html --disable-external
|
||||
21
themes/osm/LICENSE
Normal file
21
themes/osm/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Hanzei
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
42
themes/osm/README.md
Normal file
42
themes/osm/README.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# OpenStreetMap shortcode for hugo
|
||||
[](https://travis-ci.com/Hanzei/hugo-component-osm)
|
||||
|
||||
## Getting started
|
||||
|
||||
Run from the root of your Hugo site:
|
||||
```sh
|
||||
$ git clone https://github.com/Hanzei/hugo-component-osm.git themes/osm
|
||||
```
|
||||
|
||||
Alternatively you can include this repository as a [git submodule](https://git-scm.com/book/de/v1/Git-Tools-Submodule). This makes it easier to update this theme if you have your Hugo site in git as well. For this you need to run:
|
||||
|
||||
```sh
|
||||
$ git submodule add https://github.com/Hanzei/hugo-component-osm.git themes/osm
|
||||
```
|
||||
|
||||
Now you just have to add this theme component to your themes in `config.toml`, e.g. `theme = ["osm", "base-theme"]`. See the [Hugo documentation](https://gohugo.io/themes/theme-components/) for more infos.
|
||||
|
||||
## Creating and including a map
|
||||
|
||||
First create a map for free on https://umap.openstreetmap.fr/en/. Then include this map by using the `openstreetmap` shortcode, e.g. `{{< openstreetmap mapName="demo-map_1" >}}`
|
||||
|
||||
## Options
|
||||
|
||||
The only required parameter is `mapName`. All other parameters are completely optional.
|
||||
|
||||
Available parameter are:
|
||||
- `coordX` (default `auto`)
|
||||
- `coordY` (default `auto`)
|
||||
- `scale` (default `auto`)
|
||||
- `scaleControl` (default `true`)
|
||||
- `miniMap` (default `false`)
|
||||
- `scrollWheelZoom` (default `true`)
|
||||
- `zoomControl` (default `true`)
|
||||
- `allowEdit` (default `false`)
|
||||
- `moreControl` (default `true`)
|
||||
- `searchControl` (default `true`)
|
||||
- `tilelayersControl` (default `null`)
|
||||
- `embedControl` (default `null`)
|
||||
- `datalayersControl` (default `true`)
|
||||
- `onLoadPanel` (default `none`)
|
||||
- `captionBar` (default `true`)
|
||||
1
themes/osm/exampleSite/.gitignore
vendored
Normal file
1
themes/osm/exampleSite/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
public
|
||||
6
themes/osm/exampleSite/archetypes/default.md
Normal file
6
themes/osm/exampleSite/archetypes/default.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
title: "{{ replace .Name "-" " " | title }}"
|
||||
date: {{ .Date }}
|
||||
draft: true
|
||||
---
|
||||
|
||||
5
themes/osm/exampleSite/config.toml
Normal file
5
themes/osm/exampleSite/config.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
baseURL = "http://example.org/"
|
||||
languageCode = "en-us"
|
||||
title = "My New Hugo Site"
|
||||
theme = "osm"
|
||||
disableKinds = ["taxonomy", "taxonomyTerm"]
|
||||
8
themes/osm/exampleSite/content/_index.md
Normal file
8
themes/osm/exampleSite/content/_index.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: "OpenStreetMap"
|
||||
---
|
||||
|
||||
<code>\{\{< openstreetmap mapName="demo-map_1" scale="14" coordX="-37.7989" coordY="145.0003" >\}\}</code>
|
||||
|
||||
|
||||
{{< openstreetmap mapName="demo-map_1" >}}
|
||||
11
themes/osm/exampleSite/layouts/404.html
Normal file
11
themes/osm/exampleSite/layouts/404.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ .Site.Title }}</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>{{ .Title }}</h2>
|
||||
{{ .Content }}
|
||||
</body>
|
||||
</html>
|
||||
11
themes/osm/exampleSite/layouts/index.html
Normal file
11
themes/osm/exampleSite/layouts/index.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ .Site.Title }}</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>{{ .Title }}</h2>
|
||||
{{ .Content }}
|
||||
</body>
|
||||
</html>
|
||||
23
themes/osm/layouts/shortcodes/openstreetmap.html
Normal file
23
themes/osm/layouts/shortcodes/openstreetmap.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{{ $mapName := .Get "mapName" }}
|
||||
|
||||
{{ $mapWidth := .Get "mapWidth" | default "100%" }}
|
||||
{{ $mapHeight := .Get "mapHeight" | default "600px" }}
|
||||
|
||||
{{ $scaleControl := .Get "scaleControl" | default "true" }}
|
||||
{{ $miniMap := .Get "miniMap" | default "false" }}
|
||||
{{ $scrollWheelZoom := .Get "scrollWheelZoom" | default "true" }}
|
||||
{{ $zoomControl := .Get "zoomControl" | default "true" }}
|
||||
{{ $allowEdit := .Get "allowEdit" | default "false" }}
|
||||
{{ $moreControl := .Get "moreControl" | default "true" }}
|
||||
{{ $searchControl := .Get "searchControl" | default "true" }}
|
||||
{{ $tilelayersControl := .Get "tilelayersControl" | default "null" }}
|
||||
{{ $embedControl := .Get "embedControl" | default "null" }}
|
||||
{{ $datalayersControl := .Get "datalayersControl" | default "true" }}
|
||||
{{ $onLoadPanel := .Get "onLoadPanel" | default "none" }}
|
||||
{{ $captionBar := .Get "captionBar" | default "true" }}
|
||||
|
||||
{{ $scale := .Get "scale" }}
|
||||
{{ $coordX := .Get "coordX" }}
|
||||
{{ $coordY := .Get "coordY" }}
|
||||
|
||||
<iframe width="{{ $mapWidth }}" height="{{ $mapHeight }}" frameBorder="0" src="https://umap.openstreetmap.fr/en/map/{{- $mapName -}}?scaleControl={{ $scaleControl }}&miniMap={{ $miniMap }}&scrollWheelZoom={{ $scrollWheelZoom }}&zoomControl={{ $zoomControl }}&allowEdit={{ $allowEdit }}&moreControl={{ $moreControl }}&searchControl={{ $searchControl }}&tilelayersControl={{ $tilelayersControl }}&embedControl={{ $embedControl }}&datalayersControl={{ $datalayersControl }}&onLoadPanel={{ $onLoadPanel }}&captionBar={{ $captionBar }}{{ with $scale}}#{{ . }}{{ end }}/{{ $coordX }}/{{ $coordY }}"></iframe>
|
||||
12
themes/osm/theme.toml
Normal file
12
themes/osm/theme.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
name = "OpenStreetMap"
|
||||
license = "MIT"
|
||||
licenselink = "https://github.com/Hanzei/hugo-component-osm/blob/master/LICENSE"
|
||||
description = " OpenStreetMap shortcode for hugo"
|
||||
homepage = "https://github.com/Hanzei/hugo-component-osm/"
|
||||
tags = []
|
||||
features = []
|
||||
min_version = "0.41"
|
||||
|
||||
[author]
|
||||
name = "Hanzei"
|
||||
homepage = "http://github.com/Hanzei/"
|
||||
Reference in New Issue
Block a user