View on GitHub


Golang Template Engine. Build websites like JSP

GTE - Golang Template Engine 中文


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 -->
<!-- footer.html -->

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

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

Then use the GTE command to run the project:

gte serve

You will see the running result in the browser: