What I’m missing is the menu on top, because I don’t know how to import other html files.
Could anyone help me with this?
Here’s my code:
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="import" href="base.html">
</head>
<body>
<link rel="import" href="navbar.html">
<div class="container">
<h1>Introduction</h1>
<p>
Esperango is a fun attempt to make a European language for the EU.
It is yet another Esperandito which I'm making up as I go.
</p>
</div>
</body>
</html>
I like that you are thinking about your site in modules.
Something worth looking into for generating a static site, with modules as you are thinking, is Jekyll: https://jekyllrb.com
One fun thing you could do with Jekyll is translate your site from Esperango to as many languages as you like, using data config files with just one html template, instead of having a separate html document for each language.
You can’t include/import html in a static website so you would have to copy the HTML into index. HTML using a text editor rather than import it.
Scripts can be referenced in external files, but again not imported/included. This means you can call functions defined in another JS file.
I suggest you examine how other static websites are constructed to see what works. Or find a tutorial on the web and work through that to build a simple website with a menu. Just beware that you don’t try to adapt code from a dynamic website (ie something that uses a scripting language like PHP, or one which uses server side includes, because these won’t work. You may already know that, but I mention it because you have got the impression that you can include html from other files, and server side code is the only way you can do so).
I haven’t used Jekyll myself, as Hunter suggests, but have heard it is very good for this kind of thing.
I suspected as much, but wasn’t sure. Thanks for clearing that up for me.
Thank you for your suggestion. I was vaguely aware of it and forgot it’s name and the term static site generator in general.
As Rust is the future, I’m going to dive into Cobalt instead.
I finally figured out why atom is so loved in this community.
It has atom-live-server and platform-ide-terminal and thus everything that’s necessary to build and test a static site, while Eclipse is a very Java-oriented IDE.
It took me a long time also because I had an accident damaging my inner ear and brain .