許虎虎 開發者工具集
PUG 轉 HTML

Pug(原名 Jade)是一種簡潔的 HTML 模板引擎,通常用來生成動態的 HTML 頁面。Pug 使得 HTML 代碼更加簡潔、易讀,並且支持更多的動態功能,例如插入變數、條件語句、循環等。

將 Pug 轉換為 HTML 是將 Pug 模板語法轉換為標準的 HTML 代碼。

Pug 示例:
pug

html
head
title My Pug Page
body
h1 Welcome to Pug!
p This is a simple paragraph with a link to
a(href='https://example.com') Example.com
轉換後的 HTML:
html

<html>
<head>
<title>My Pug Page</title>
</head>
<body>
<h1>Welcome to Pug!</h1>
<p>This is a simple paragraph with a link to
<a href="https://example.com">Example.com</a>
</p>
</body>
</html>