HAML
模板语言:
- Ant Design
*.tsx - Astro
*.astro - Bootstrap
*.html - Chakra UI
*.tsx - Docsify
*.md - Docusaurus
*.mdx - ESBuild
*.js - Eleventy
*.11ty.js - Gatsby
*.js - GitBook
*.md - Gridsome
*.vue - Hexo
*.ejs - Hugo
*.html - Jekyll
*.html - Mantine
*.tsx - Material-UI
*.js - MkDocs
*.md - Next.js
*.js - Nuxt.js
*.vue - Parcel
*.html - Remix
*.tsx - Rollup
*.js - Storybook
*.stories.js - Sphinx
*.rst - SvelteKit
*.svelte - SWC
*.ts - Tailwind CSS
*.css - Turbopack
*.ts - Vite
*.ts - VitePress
*.md - VuePress
*.vue - Webpack
*.js - 自定义框架
*.*
| Eleventy 简称 | 文件扩展名 | npm 包 |
|---|---|---|
haml |
.haml |
hamljs |
| Eleventy 或插件版本 | hamljs 版本 |
|---|---|
@11ty/eleventy@0.x |
hamljs@0.6.x |
@11ty/eleventy@1.x |
hamljs@0.6.x |
@11ty/eleventy@2.x |
hamljs@0.6.x |
@11ty/eleventy@3.x 及更新版本 |
N/A |
@11ty/eleventy-plugin-haml@1.x |
hamljs@0.6.x |
您可以覆盖 .haml 文件的模板引擎。更多信息请阅读更改模板的渲染引擎。
安装
haml 模板语言在 v3 中已从 Eleventy 核心中移出,现在需要插件安装。
npm install @11ty/eleventy-plugin-haml
添加到您的配置文件:
eleventy.config.js
import hamlPlugin from "@11ty/eleventy-plugin-haml";
export default function (eleventyConfig) {
eleventyConfig.addPlugin(hamlPlugin);
}
const hamlPlugin = require("@11ty/eleventy-plugin-haml");
module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(hamlPlugin);
}
使用更多选项:
eleventy.config.js
import haml from "hamljs";
import hamlPlugin from "@11ty/eleventy-plugin-haml";
export default function (eleventyConfig) {
eleventyConfig.addPlugin(hamlPlugin, {
// 覆盖 `haml` 库实例
eleventyLibraryOverride: haml,
});
}
const haml = require("hamljs");
const hamlPlugin = require("@11ty/eleventy-plugin-haml");
module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(hamlPlugin, {
// 覆盖 `haml` 库实例
eleventyLibraryOverride: haml,
});
}
支持的功能
| 功能 | 语法 |
|---|---|
| 🚫 通用过滤器 | 尚不支持 :filterName some text 更多信息请阅读过滤器。 |