当前位置:网站首页>Building a static website with eleventy
Building a static website with eleventy
2022-06-24 08:33:00 【User 1091747】
Eleventy It's based on JavaScript Of Jekyll and Hugo substitute , Used to build static websites .
Static web site builder is a kind of static web site builder that generates complete web sites based on raw data and a set of templates HTML The tools of the website . It can automatically complete a single HTML Page coding task , And make these pages ready to serve users . because HTML The page is pre built , They load very quickly in the user's browser .
Static websites are also document friendly , Because static websites are easy to expand , And they are generated 、 An easy way to maintain and deploy project documents . For these reasons , Enterprises often use them to document application programming interfaces (API)、 Database schema and other information . Documentation is software development 、 Design and other aspects are an important part of technology . All code bases require some form of documentation , The choices range from simple README To complete document .
Eleventy: A static website generator
Eleventy(11ty) Is a simple static website builder , yes Jekyll and Hugo substitute . It is to use JavaScript Compiling , It will be one ( Different types of ) The template directory is converted to HTML. It's also open source , stay MIT Release under license .
Eleventy It can be done with HTML、Markdown、Liquid、Nunjucks、Handlebars、Mustache、EJS、Haml、Pug and JavaScript Template Literals Working together .
Its features include :
- Easy to set up
- Support multiple template languages ( Such as Nunjucks、HTML、JavaScript、Markdown、Liquid)
- Customizable
- be based on JavaScript, This is familiar to many web developers , New users are also easy to learn
install Eleventy
Eleventy need Node.js. stay Linux On , You can use your package manager to install Node.js:
$ sudo dnf install nodejs
If your package manager does not Node.js, Or you're not here Linux On , You can start your Node.js Website install it .
Node.js After installation , Just use it to install Eleventy:
$ npm install -g @11ty/eleventy
That's done !
Create a static web site for your documents
Now you can start using Eleventy To build your static document website . Here are the steps to follow .
1、 Create a package.json file
To put Eleventy Install into your project , You need one package.json file :
$ npm init -y
2、 take Eleventy The installation to package.json in
install Eleventy And save to your project package.json in . function :
$ npm install-save-dev @11ty/eleventy
3、 function Eleventy
Use npx Command to run your local project Eleventy edition . After you confirm that the installation is complete , Try to run Eleventy:
$ npx @11ty/eleventy
4、 Create some templates
Now run two commands to create two new template files ( One HTML And a Markdown file ):
$ cat << EOF >> index.html<!doctype html><html><head><title>Page title</title></head><body><p>Hello world</p></body></html>EOF$ echo '# Page header' > index.md
This compiles any content templates in the current directory or subdirectory into the output folder ( The default is _site).
function eleventy --serve To start a development web server .
$ npx @11ty/eleventy-serve
Open... In your web browser http://localhost:8080/README/, Look at you Eleventy Output .
And then put _site Upload the files in to your Web The server , Publish your website to the world .
Try Eleventy
Eleventy Is a static website builder , It's easy to use , There are templates and themes . If you have used in your development process Node.js,Eleventy Maybe it's better than Jekyll or Hugo A more natural . It can provide good results quickly , And keep you free from complex website design and maintenance . To learn more about using Eleventy Information about , Please read its documentation carefully .
边栏推荐
- Fundamentals of 3D mathematics [17] inverse square theorem
- Paper notes: multi label learning dm2l
- os. path. Pits encountered during the use of join()
- ZUCC_ Principles of compiling language and compilation_ Experiment 05 regular expression, finite automata, lexical analysis
- 2021-03-09 COMP9021第七节课笔记
- ZUCC_ Principles of compiling language and compilation_ Experiment 02 fsharp Ocaml language
- [acnoi2022] I have done it, but I can't
- Question bank and simulation examination for operation certificate of refrigeration and air conditioning equipment in 2022
- Question 3 - MessageBox pop-up box, modify the default background color
- Qt导出PDF文件的两种方法
猜你喜欢
随机推荐
Permission model DAC ACL RBAC ABAC
ZUCC_编译语言原理与编译_实验04 语言与文法
pyQt 中 QMenu 响应
dhcp、tftp基础
Promise的使用场景
WCF TCP protocol transmission
New technology practice, encapsulating the permission application library step by step with the activity results API
13 -- 移除无效的括号
Question 4 - datepicker date selector, disabling two date selectors (start and end dates)
Five level classification of loans
ZUCC_ Principles of compiling language and compilation_ Experiment 05 regular expression, finite automata, lexical analysis
Take my brother to do the project. It's cold
LINQ query (2)
C language_ Love and hate between string and pointer
Opencv get (propid) common values
All you know is the test pyramid?
2022年制冷与空调设备运行操作上岗证题库及模拟考试
Markdown 实现文内链接跳转
普通token
Industrial computer anti cracking








