Total Pageviews

Sunday 13 October 2024

静态博客/网站程序Eleventy

 

Quick Start

Jump to section titled: Quick Start

Eleventy requires Node.js 18. You can check whether or not you have Node installed by running node --version in a Terminal. (Well, wait—what is a Terminal?) If node is not found or it reports a version number below 18, you will need to install Node.js before moving on.

Now we’ll create an index.md Markdown file. You can do this in the text editor of your choice or by running one of these commands in your terminal:

echo '# Heading' > index.md

Run Eleventy using npx, an npm-provided command that is bundled with Node.js.

npx @11ty/eleventy --serve

Eleventy compiles any files in the current directory matching valid file extensions (md is one of many) to the _site output folder. It might look like this:

[11ty] Writing _site/index.html from ./index.md (liquid)
[11ty] Wrote 1 file in 0.03 seconds (v3.0.0)
[11ty] Watching…
[11ty] Server at http://localhost:8080/

The --serve option also starts a local development server. Open up http://localhost:8080/ in your favorite web browser to view your web site.

No comments:

Post a Comment