Skip to content

Commit

Permalink
Extract OpenLayers mapping JS & CSS into separate bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Sep 29, 2024
1 parent 293786e commit 4a6a9e1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
},
"bundles": {
"vendor": {
"ol": "ol.css | dist/ol.js",
"fonts://display=swap": "Barlow",
".": "src/main/js/*.js"
},
"mapping": {
"ol": "ol.css | dist/ol.js"
}
}
}
2 changes: 2 additions & 0 deletions src/main/handlebars/content.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: feed
{{#> layout}}
{{#*inline "title"}}{{item.title}}{{/inline}}
{{#*inline "meta"}}
<link rel="stylesheet" type="text/css" href="/assets/{{asset 'mapping.css'}}">
<meta property="og:url" content="{{request.uri}}">
<meta property="og:type" content="article">
<meta property="og:title" content="{{item.title}} - Dialog">
Expand Down Expand Up @@ -38,6 +39,7 @@ parent: feed
</section>
{{/inline}}
{{#*inline "scripts"}}
<script src="/assets/{{asset 'mapping.js'}}" defer></script>
<script type="module">
{{&use 'mapping'}}
const mapping = new Mapping('/static/marker.png');
Expand Down
2 changes: 2 additions & 0 deletions src/main/handlebars/journey.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parent: feed
{{#> layout}}
{{#*inline "title"}}{{journey.title}}{{/inline}}
{{#*inline "meta"}}
<link rel="stylesheet" type="text/css" href="/assets/{{asset 'mapping.css'}}">
<meta property="og:url" content="{{request.uri}}">
<meta property="og:type" content="article">
<meta property="og:title" content="{{journey.title}} - Dialog">
Expand Down Expand Up @@ -78,6 +79,7 @@ parent: feed
{{/with}}
{{/inline}}
{{#*inline "scripts"}}
<script src="/assets/{{asset 'mapping.js'}}" defer></script>
<script type="module">
{{&use 'mapping'}}
const mapping = new Mapping('/static/marker.png');
Expand Down
2 changes: 2 additions & 0 deletions src/main/handlebars/journeys.handlebars
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{#> layout}}
{{#*inline "title"}}Reisen{{/inline}}
{{#*inline "meta"}}
<link rel="stylesheet" type="text/css" href="/assets/{{asset 'mapping.css'}}">
<meta property="og:url" content="{{request.uri}}">
<meta property="og:type" content="website">
<meta property="og:title" content="Reisen - Dialog">
Expand Down Expand Up @@ -28,6 +29,7 @@
</div>
{{/inline}}
{{#*inline "scripts"}}
<script src="/assets/{{asset 'mapping.js'}}" defer></script>
<script type="module">
{{&use 'mapping'}}
const mapping = new Mapping('/static/marker.png');
Expand Down

0 comments on commit 4a6a9e1

Please sign in to comment.