This commit is contained in:
Marc Beninca 2023-06-27 14:49:57 +02:00
parent 6a74eb8729
commit a30516f846

View file

@ -8,7 +8,7 @@ def run(*args):
subprocess.call(args)
def link(active: str, id: str, text: str) -> str:
def link(active:str, id:str, text:str)->str:
items = ['<a']
if (active == id):
items.append(' class="active"')
@ -16,7 +16,7 @@ def link(active: str, id: str, text: str) -> str:
return str().join(items)
def nav(active: str) -> str:
def nav(active:str=None)->str:
return f'''\
<nav>
{link(active, 'home', 'Home')}
@ -45,7 +45,15 @@ def main():
<title>Marc Beninca</title>
<!----------------------------------------------------------------------------->
</head><body><header>
</head><script>
<!----------------------------------------------------------------------------->
function main() {{
if (! window.location.href.includes('#')) {{
window.location.href+='#home';
}}
}}
<!----------------------------------------------------------------------------->
</script><body onload="main();"><header>
<!----------------------------------------------------------------------------->
<h1><a href="#home">Marc Beninca</a></h1>
@ -54,15 +62,19 @@ def main():
</header><main>
<!----------------------------------------------------------------------------->
{nav('home')}
<!----------------------------------------------------------------------------->
<section id="home">
{nav('home')}
Home
<ul>
<li><a href="https://linkedin.com/in/marc-beninca">LinkedIn</a></li>
</ul>
<h2>Curriculum Vitæ</h2>
<ul>
<li><a href="cv.en.pdf">English</a></li>
<li><a href="cv.fr.pdf">Français</a></li>
</ul>
</section>