script
This commit is contained in:
parent
6a74eb8729
commit
a30516f846
1 changed files with 20 additions and 8 deletions
28
build.py
28
build.py
|
@ -8,7 +8,7 @@ def run(*args):
|
||||||
subprocess.call(args)
|
subprocess.call(args)
|
||||||
|
|
||||||
|
|
||||||
def link(active: str, id: str, text: str) -> str:
|
def link(active:str, id:str, text:str)->str:
|
||||||
items = ['<a']
|
items = ['<a']
|
||||||
if (active == id):
|
if (active == id):
|
||||||
items.append(' class="active"')
|
items.append(' class="active"')
|
||||||
|
@ -16,7 +16,7 @@ def link(active: str, id: str, text: str) -> str:
|
||||||
return str().join(items)
|
return str().join(items)
|
||||||
|
|
||||||
|
|
||||||
def nav(active: str) -> str:
|
def nav(active:str=None)->str:
|
||||||
return f'''\
|
return f'''\
|
||||||
<nav>
|
<nav>
|
||||||
{link(active, 'home', 'Home')}
|
{link(active, 'home', 'Home')}
|
||||||
|
@ -45,7 +45,15 @@ def main():
|
||||||
<title>Marc Beninca</title>
|
<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>
|
<h1><a href="#home">Marc Beninca</a></h1>
|
||||||
|
@ -54,15 +62,19 @@ def main():
|
||||||
</header><main>
|
</header><main>
|
||||||
<!----------------------------------------------------------------------------->
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
{nav('home')}
|
|
||||||
|
|
||||||
<!----------------------------------------------------------------------------->
|
|
||||||
|
|
||||||
<section id="home">
|
<section id="home">
|
||||||
|
|
||||||
{nav('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>
|
</section>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue