Question: I have worked on several ASP.NET applications recentely, and I was simply fascinated by the simplicity of it's HTML layouting. 

Basiccaly there is one layout file, in which you write all the static HTML, CSS, JS, or really anything that will stay the same on all pages. Then, there are content pages, in which you only write the content of the pages. 

So, for example you have an about.cshtml file that looks like this:

```
<h1>My name</h1>
<p>I am a junior web developer... etc</p>
<p>Contact me at example@gmail.com</p>

```

That's all the information needed for the about content page, when requested it will be inserted in the layout page.

**So, my question:**

Are there any ready-to-use tools to make this happen via html, javascript or php? I found myself implementing it via ajax calls, but that really is just a waste of resources, having to async load all the html files I have.

Answer: 
For pure HTML, you could go down the route of using a `static site generator`. For example:

* [**Jekyll**](http://jekyllrb.com/)
* [**Pelican**](http://docs.getpelican.com/en/3.2/)

In Pelican you have a `base.html` template, which contains everything that you want to appear on all pages, so the header and footer etc (These can also be called `.header.html` and then referenced in the `main.html` template.

Page content is written in Markdown, and put into folders called `posts` or `pages`, and then you run a `generate` command, and it will output all the `html` for you.

And pages can be written like this:

```
{% extends "base.html" %}
{% block title %}{{ page.title }}{%endblock%}
{% block content %}
    <h1>{{ page.title }}</h1>
    {% import 'translations.html' as translations with context %}
    {{ translations.translations_for(page) }}

    {{ page.content }}
{% endblock %}

```

So it extends the `base.html` template. 

**Further reading:**

* [Pelican: a static blog generator for
Pythonistas](http://fjavieralba.com/pelican-a-static-blog-generator-for-pythonistas.html)
* [Pelican - Getting
started](http://docs.getpelican.com/en/3.1.1/getting_started.html)
Check out [Model–view–controller](http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller)s