Skip to content

Commit 0d1959f

Browse files
committed
Refactor online CV links in HTML and localization files; update href attributes for improved accessibility and consistency, and remove unnecessary inline elements in CSS for cleaner styling.
1 parent e5692a5 commit 0d1959f

File tree

4 files changed

+30
-11
lines changed

4 files changed

+30
-11
lines changed

index-template.html

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ <h2 data-i18n="contact-title">Contact</h2>
5555
<li data-i18n="contact-email">Email: etiennelescot@gmail.com</li>
5656
<li data-i18n="contact-linkedin">LinkedIn: https://...</li>
5757
<li data-contact-github>GitHub: https://github.com/EtienneLescot</li>
58-
<li data-contact-cv>CV en ligne: https://etiennelescot.github.io/cv/main</li>
58+
<li><span data-i18n="contact-cv">CV en ligne :</span> <a id="online-cv-link" href="#" target="_blank" rel="noopener">https://etiennelescot.github.io/cv/</a></li>
5959
</ul>
6060
</div>
6161
</section>
@@ -236,6 +236,30 @@ <h2 data-i18n="interests-title">Centres d'intérêt</h2>
236236
pdfButton.setAttribute('href', href);
237237
}
238238

239+
function updateOnlineCvLink() {
240+
const onlineLink = document.getElementById('online-cv-link');
241+
if (!onlineLink) return;
242+
243+
const locale = htmlElement.lang || 'fr';
244+
const basePath = htmlElement.getAttribute('data-base-path') || '';
245+
const normalizedBase = basePath ? basePath.replace(/\/$/, '') : '.';
246+
const indexFile = locale === 'fr' ? '/index.html' : `/index-${locale}.html`;
247+
248+
let href;
249+
if (normalizedBase === '.') {
250+
href = `.${indexFile}`;
251+
} else if (/^https?:\/\//.test(normalizedBase)) {
252+
href = `${normalizedBase}${indexFile}`;
253+
} else if (normalizedBase.startsWith('/')) {
254+
href = `${window.location.origin}${normalizedBase}${indexFile}`;
255+
} else {
256+
href = `${normalizedBase}${indexFile}`;
257+
}
258+
259+
onlineLink.setAttribute('href', href);
260+
onlineLink.textContent = href;
261+
}
262+
239263
if (langButton && langMenu) {
240264
// Toggle dropdown visibility
241265
langButton.addEventListener('click', function(e) {
@@ -288,6 +312,7 @@ <h2 data-i18n="interests-title">Centres d'intérêt</h2>
288312
// Set initial print theme style
289313
updatePrintThemeStyle(themeToApply);
290314
updatePdfLink();
315+
updateOnlineCvLink();
291316

292317
themeToggle.addEventListener('click', function() {
293318
const currentTheme = htmlElement.getAttribute('data-theme');
@@ -303,6 +328,7 @@ <h2 data-i18n="interests-title">Centres d'intérêt</h2>
303328
// Update print theme style
304329
updatePrintThemeStyle(newTheme);
305330
updatePdfLink();
331+
updateOnlineCvLink();
306332
});
307333
}
308334
});

locales/en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ contact-linkedin: |
2323
contact-github: |
2424
- GitHub: <a href="https://github.com/EtienneLescot" target="_blank">https://github.com/EtienneLescot</a>
2525
contact-cv: |
26-
- Online CV : <a href="https://etiennelescot.github.io/cv/short/index-en.html" target="_blank">https://etiennelescot.github.io/cv/short/index-en.html</a>
26+
- Online CV :
2727
profile-title: |
2828
Profile
2929
profile-desc: |

locales/fr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ contact-linkedin: |
2323
contact-github: |
2424
- GitHub: <a href="https://github.com/EtienneLescot" target="_blank">https://github.com/EtienneLescot</a>
2525
contact-cv: |
26-
- CV en ligne : <a href="https://etiennelescot.github.io/cv/short/index.html" target="_blank">https://etiennelescot.github.io/cv/short/index.html</a>
26+
- CV en ligne :
2727
profile-title: |
2828
Profil
2929
profile-desc: |

style.css

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -384,14 +384,7 @@ ul li {
384384
padding-left: 1rem;
385385
}
386386

387-
ul li::before {
388-
content: '>';
389-
position: absolute;
390-
left: 0;
391-
color: var(--accent);
392-
font-weight: 900;
393-
font-family: var(--font-mono);
394-
}
387+
395388

396389
[data-theme="light"] .contact-section ul li::before {
397390
color: var(--accent);

0 commit comments

Comments
 (0)