fix: add key_query to static assets 🎉 (#730)

* fix: add `key_query` to static assets

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* style: fix lint issues in css

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* fix: issue with static images in `leaflet.css`

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
This commit is contained in:
Vinayak Kulkarni 2023-01-25 19:53:02 +05:30 committed by GitHub
parent a97139693c
commit 0519ee7535
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 523 additions and 488 deletions

View file

@ -17,38 +17,38 @@
font-style: normal;
}
body{
body {
background-color: #fff;
color: #212121;
font-family:'OpenSans', sans-serif, Arial;
font-family: 'OpenSans', sans-serif, Arial;
font-size: 14px;
margin:0;
background-repeat:no-repeat !important;
margin: 0;
background-repeat: no-repeat !important;
background-size: contain !important;
background-image: url(/images/header-map-1280px.png);
}
a{
color: #499DCE;
transition: color .2s;
a {
color: #499dce;
transition: color 0.2s;
}
a:hover {
color: #395D73;
color: #395d73;
}
.title {
font-weight: bold;
font-size: 32px;
text-align:center;
margin:90px 0 0 0;
position:relative;
text-align: center;
margin: 90px 0 0 0;
position: relative;
}
.title.light:after {
content: "light";
content: 'light';
display: block;
position: absolute;
left: 50%;
bottom: -5px;
color: #499DCE;
font-size:.8em;
color: #499dce;
font-size: 0.8em;
}
section {
margin: 15px auto;
@ -60,27 +60,27 @@ section {
}
.subtitle {
font-size: 26px;
font-weight:normal;
text-align:center;
margin:10px 0 95px 0;
font-weight: normal;
text-align: center;
margin: 10px 0 95px 0;
}
.box-header {
text-align:left;
text-transform:uppercase;
border:1px solid #ededed;
margin:25px 0 0 0;
padding:12px 30px;
font-size:20px;
background:#fff;
text-align: left;
text-transform: uppercase;
border: 1px solid #ededed;
margin: 25px 0 0 0;
padding: 12px 30px;
font-size: 20px;
background: #fff;
}
.item {
background:#fff;
background: #fff;
height: 191px;
border: 1px solid #ededed;
border-top:none;
border-top: none;
}
.item:nth-child(odd) {
background-color:#fbfbfb;
background-color: #fbfbfb;
}
.item img {
position: absolute;
@ -91,27 +91,27 @@ section {
border: 1px solid #ccc;
}
.details {
float:left;
float: left;
height: 128px;
padding: 20px 30px 20px 188px;
}
.details h3 {
font-size:18px;
font-size: 18px;
margin-top: 25px;
}
.details p {
padding:0;
margin:18px 0;
padding: 0;
margin: 18px 0;
}
.viewers {
float:right;
text-align:center;
float: right;
text-align: center;
width: 120px;
margin-top: 25px;
padding-right: 30px;
}
.btn {
display:block;
display: block;
margin: 0;
line-height: 36px;
}
@ -119,57 +119,58 @@ section {
position: relative;
padding: 0;
overflow: hidden;
border-radius:4px;
background-color: #499DCE;
border-radius: 4px;
background-color: #499dce;
background: linear-gradient(90deg, #5aaad8, #4a9ecf);
color: #fff;
text-decoration: none;
font-weight: bold;
}
.btn:first-child:hover {
background: #395D73;
background: #395d73;
}
footer {
width:100%;
border-top:1px solid #ededed;
text-align:center;
color:#d3d3d3;
padding-top:10px;
font-size:12px;
width: 100%;
border-top: 1px solid #ededed;
text-align: center;
color: #d3d3d3;
padding-top: 10px;
font-size: 12px;
}
footer img {
width: 113px;
height: 31px;
}
footer .t {
display:none;
display: none;
}
footer p {
margin-top:0;
margin-top: 0;
}
footer a {
color: #787878;
text-decoration: none;
}
.details h3, .identifier {
.details h3,
.identifier {
max-width: 550px;
word-break: break-all;
}
/* Responsive */
@media (max-width: 950px) {
section{
section {
margin: 0;
width: 96%;
padding: 2%;
}
}
@media (max-width: 600px) {
.title{
.title {
margin: 25px 0 0 0;
}
.title.light:after {
font-size:.6em;
font-size: 0.6em;
}
.title img {
width: 200px;

File diff suppressed because it is too large Load diff

View file

@ -5,10 +5,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{name}} - TileServer GL</title>
{{#is_vector}}
<link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl.css" />
<link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl-inspect.css" />
<script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl.js"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-compat.js"><\/script>'); }</script>
<script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl-inspect.min.js"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-inspect-compat.min.js"><\/script>'); }</script>
<link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl.css{{&key_query}}" />
<link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl-inspect.css{{&key_query}}" />
<script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl.js{{&key_query}}"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-compat.js{{&key_query}}"><\/script>'); }</script>
<script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl-inspect.min.js{{&key_query}}"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-inspect-compat.min.js{{&key_query}}"><\/script>'); }</script>
<style>
body {background:#fff;color:#333;font-family:Arial, sans-serif;}
#map {position:absolute;top:0;left:0;right:250px;bottom:0;}
@ -18,13 +18,25 @@
</style>
{{/is_vector}}
{{^is_vector}}
<link rel="stylesheet" type="text/css" href="{{public_url}}leaflet.css" />
<script src="{{public_url}}leaflet.js"></script>
<script src="{{public_url}}leaflet-hash.js"></script>
<script src="{{public_url}}L.TileLayer.NoGap.js"></script>
<link rel="stylesheet" type="text/css" href="{{public_url}}leaflet.css{{&key_query}}" />
<script src="{{public_url}}leaflet.js{{&key_query}}"></script>
<script src="{{public_url}}leaflet-hash.js{{&key_query}}"></script>
<script src="{{public_url}}L.TileLayer.NoGap.js{{&key_query}}"></script>
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.leaflet-control-layers-toggle {
background-image: url({{public_url}}images/layers.png{{&key_query}});
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url({{public_url}}images/layers-2x.png{{&key_query}});
background-size: 26px 26px;
}
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
background-image: url({{public_url}}images/marker-icon.png{{&key_query}});
}
</style>
{{/is_vector}}
</head>

View file

@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TileServer GL - Server for vector and raster maps with GL styles</title>
<link rel="stylesheet" type="text/css" href="{{public_url}}index.css" />
<link rel="stylesheet" type="text/css" href="{{public_url}}index.css{{&key_query}}" />
<script>
function toggle_xyz(id) {
var el = document.getElementById(id);
@ -17,7 +17,7 @@
</head>
<body>
<section>
<h1 class="title {{#if is_light}}light{{/if}}"><img src="{{public_url}}images/logo.png" alt="TileServer GL" /></h1>
<h1 class="title {{#if is_light}}light{{/if}}"><img src="{{public_url}}images/logo.png{{&key_query}}" alt="TileServer GL" /></h1>
<h2 class="subtitle">Vector {{#if is_light}}<s>and raster</s>{{else}}and raster{{/if}} maps with GL styles</h2>
{{#if styles}}
<h2 class="box-header">Styles</h2>
@ -27,7 +27,7 @@
{{#if thumbnail}}
<img src="{{public_url}}styles/{{@key}}/{{thumbnail}}{{&../key_query}}" alt="{{name}} preview" />
{{else}}
<img src="{{public_url}}images/placeholder.png" alt="{{name}} preview" />
<img src="{{public_url}}images/placeholder.png{{&key_query}}" alt="{{name}} preview" />
{{/if}}
<div class="details">
<h3>{{name}}</h3>
@ -74,7 +74,7 @@
{{#if thumbnail}}
<img src="{{public_url}}data/{{@key}}/{{thumbnail}}{{&../key_query}}" alt="{{name}} preview" />
{{else}}
<img src="{{public_url}}images/placeholder.png" alt="{{name}} preview" />
<img src="{{public_url}}images/placeholder.png{{&key_query}}" alt="{{name}} preview" />
{{/if}}
<div class="details">
<h3>{{name}}</h3>
@ -104,7 +104,7 @@
{{/if}}
</section>
<footer>
<a href="https://www.maptiler.com/" target="_blank"><img src="{{public_url}}images/maptiler-logo.svg" /></a>
<a href="https://www.maptiler.com/" target="_blank"><img src="{{public_url}}images/maptiler-logo.svg{{&key_query}}" /></a>
<p>
<a href="https://github.com/maptiler/tileserver-gl" target="_blank">Powered by TileServer GL ({{server_version}})</a> <a href="https://www.maptiler.com/" target="_blank">an open-source project from MapTiler.</a>
</p>

View file

@ -4,17 +4,29 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{name}} - TileServer GL</title>
<link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl.css" />
<link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl-inspect.css" />
<link rel="stylesheet" type="text/css" href="{{public_url}}leaflet.css" />
<script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl.js"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-compat.js"><\/script>'); }</script>
<script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl-inspect.min.js"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-inspect-compat.min.js"><\/script>'); }</script>
<script src="{{public_url}}leaflet.js"></script>
<script src="{{public_url}}leaflet-hash.js"></script>
<script src="{{public_url}}L.TileLayer.NoGap.js"></script>
<link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl.css{{&key_query}}" />
<link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl-inspect.css{{&key_query}}" />
<link rel="stylesheet" type="text/css" href="{{public_url}}leaflet.css{{&key_query}}" />
<script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl.js{{&key_query}}"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-compat.js{{&key_query}}"><\/script>'); }</script>
<script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl-inspect.min.js{{&key_query}}"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-inspect-compat.min.js{{&key_query}}"><\/script>'); }</script>
<script src="{{public_url}}leaflet.js{{&key_query}}"></script>
<script src="{{public_url}}leaflet-hash.js{{&key_query}}"></script>
<script src="{{public_url}}L.TileLayer.NoGap.js{{&key_query}}"></script>
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.leaflet-control-layers-toggle {
background-image: url({{public_url}}images/layers.png{{&key_query}});
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url({{public_url}}images/layers-2x.png{{&key_query}});
background-size: 26px 26px;
}
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
background-image: url({{public_url}}images/marker-icon.png{{&key_query}});
}
</style>
</head>
<body>