Skip to content

Commit

Permalink
Ajustement au base url
Browse files Browse the repository at this point in the history
  • Loading branch information
MareveD committed Jul 10, 2024
1 parent 47a200c commit 34ad096
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ document.addEventListener('DOMContentLoaded', () => {
document.addEventListener('DOMContentLoaded', () => {
// const baseUrl = window.location.origin; // Get the base URL when I am local
const baseUrl = 'https://mareved.github.io/portfolio';
const links = document.querySelectorAll('.home-portfolio a[data-path]');

links.forEach(link => {
const path = link.getAttribute('data-path');
link.setAttribute('href', `${baseUrl}/${path}`);
const sections = ['.home-portfolio', '.home-intro', '.cta-contact'];
sections.forEach(section => {
const links = document.querySelectorAll(`${section} a[data-path]`);
links.forEach(link => {
const path = link.getAttribute('data-path');
link.setAttribute('href', `${baseUrl}/${path}`);
});
});
});
});
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h2 class="section-title coul-accent">salut! moi, <br> c’est Marie-Eve!</h2>
<h4 class="text-emphase coul-accent">Explorons ensemble!</h4>


<a href="/a-propos" target="" class="bouton btn-dark">Savoir <span>+</span></a>
<a href="#" data-path="/a-propos.html" target="" class="bouton btn-dark">Savoir <span>+</span></a>
</div>
</div>

Expand Down Expand Up @@ -166,7 +166,7 @@ <h2 class="section-title coul-accent">vous avez un projet en tête <br> ou des q
<p class="coul-white">N'hésitez pas à me contacter! Ensemble, nous pouvons créer quelque chose de
formidable. </p>
<p class="coul-white">Cliquez sur le bouton ci-dessous pour démarrer la conversation.</p>
<a href="#" target="" class="bouton btn-light">Contactez <span>Moi</span></a>
<a href="#" data-path="contact.html" target="" class="bouton btn-light">Contactez <span>Moi</span></a>
</div>
</div>
</section>
Expand Down

0 comments on commit 34ad096

Please sign in to comment.