View on GitHub

gte

Golang Template Engine. Build websites like JSP

GTE - Golang Template Engine 中文

logo

Write native HTML/JS/CSS websites in a JSP-like way

We support the following features of native HTML websites:

Get to know GTE quickly

In order to build a componentized website, we treat the .html file as a component. Components and components can refer to each other.

For example, we create a header.html file and a footer.html file in the project directory:

<!-- header.html -->
<header>Header</header>
<!-- footer.html -->
<footer>Footer</footer>

Then you can reference the above two components in the index.html file:

<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Home</title>
</head>
<body>
    
    <div>Content</div>
    
</body>
</html>

Then use the GTE command to run the project:

gte serve

You will see the running result in the browser:

Header
Content
Footer

Next