Skip to content

Commit

Permalink
feat: adapt index to gh page
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurBeaulieu committed Nov 9, 2023
1 parent b5146c4 commit 05f108c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions assets/dist/MonDourdannais.bundle.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions assets/html/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
<link rel="icon" href="https://raw.githubusercontent.com/ArthurBeaulieu/ArthurBeaulieu/master/assets/img/ab-logo.png" type="image/png" sizes="32x32">
<!-- Leaflet stylesheet -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin="" />
<link rel="stylesheet" type="text/css" href="/assets/lib/leaflet-measure.css">
<link rel="stylesheet" type="text/css" href="/assets/dist/MonDourdannais.bundle.css">
<link rel="stylesheet" type="text/css" href="./assets/lib/leaflet-measure.css">
<link rel="stylesheet" type="text/css" href="./assets/dist/MonDourdannais.bundle.css">
</head>
<body>
<div style="position: absolute; top: 10px; left: 10px; background: white; z-index:99999; padding: 10px;">Attention <b>version alpha</b> ; le contenu du site reste incomplet. <a href="mailto:[email protected]">[email protected]</a> pour toute demande.</div>
<div id="sarmates-land" class="map-container"></div>
<div id="modal-overlay" class="modal-overlay"></div>
<!-- Leaflet script -->
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" crossorigin=""></script>
<script type="text/javascript" src="/assets/lib/leaflet-measure.js"></script>
<script type="text/javascript" src="/assets/lib/leaflet-geometry-util.js"></script>
<script type="text/javascript" src="./assets/lib/leaflet-measure.js"></script>
<script type="text/javascript" src="./assets/lib/leaflet-geometry-util.js"></script>
<!-- Then load MonDourdannais Js bundle -->
<script type="text/javascript" src="/assets/dist/MonDourdannais.bundle.js"></script>
<script type="text/javascript" src="./assets/dist/MonDourdannais.bundle.js"></script>
<!-- Finally, start MonDourdannais instance -->
<script type="text/javascript">
window.md = new window.MonDourdannais();
Expand Down
10 changes: 5 additions & 5 deletions src/js/MonDourdannais.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MonDourdannais {

_fetchMarkers() {
return new Promise(resolve => {
fetch(`/assets/json/MapData.json`).then(data => {
fetch(`./assets/json/MapData.json`).then(data => {
data.json().then(jsonData => {
this._data = jsonData;
resolve();
Expand Down Expand Up @@ -126,14 +126,14 @@ class MonDourdannais {
address.innerHTML = opts.address;
town.innerHTML = opts.town;
phone.href = `tel:${opts.phone}`;
phone.innerHTML = `<img src="/assets/img/icon/phone.svg">${opts.phone}`;
phone.innerHTML = `<img src="./assets/img/icon/phone.svg">${opts.phone}`;
website.href = opts.website;
website.innerHTML = '<img src="/assets/img/icon/web.svg">Consulter le site';
website.innerHTML = '<img src="./assets/img/icon/web.svg">Consulter le site';
website.setAttribute('rel', 'noopener noreferrer');
website.setAttribute('target', '_blank');
info.innerHTML = opts.info;
openWith.href = `geo:${opts.lat},${opts.lng}`;
openWith.innerHTML = '<img src="/assets/img/icon/pin.svg">Ouvrir dans le GPS';
openWith.innerHTML = '<img src="./assets/img/icon/pin.svg">Ouvrir dans le GPS';

dom.appendChild(title);
dom.appendChild(address);
Expand Down Expand Up @@ -318,7 +318,7 @@ class MonDourdannais {

fetchModal(url) {
return new Promise(resolve => {
fetch(`/assets/html/${url}.html`).then(data => {
fetch(`./assets/html/${url}.html`).then(data => {
data.text().then(html => {
resolve(document.createRange().createContextualFragment(html));
});
Expand Down
2 changes: 1 addition & 1 deletion src/js/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ app.use('/assets', express.static(path.join(__dirname, '../../assets'), { // Ser
// Serve main html at /
app.get('/', (req, res) => {
console.log(`${(new Date()).toISOString()} | HomeMap v${version} | index.html page requested`);
res.sendFile(path.join(__dirname, '../../assets/html/index.html'));
res.sendFile(path.join(__dirname, '../../index.html'));
});

// Start server console
Expand Down

0 comments on commit 05f108c

Please sign in to comment.