当前位置:网站首页>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 .
边栏推荐
- Pyqt common system events
- 软件过程与项目管理期末复习与重点
- ZUCC_编译语言原理与编译_实验04 语言与文法
- Paper notes: multi label learning dm2l
- Redis的Cluster集群数据倾斜
- 独立站运营中如何提升客户留存率?客户细分很重要!
- Question 3 - MessageBox pop-up box, modify the default background color
- 问题3 — messageBox弹框,修改默认背景色
- 2021-03-16 comp9021 class 9 notes
- The JS macro of WPS implements the separation method of picture text in the same paragraph
猜你喜欢

问题4 — DatePicker日期选择器,2个日期选择器(开始、结束日期)的禁用

LabVIEW finds prime numbers in an array of n elements

LabVIEW查找n个元素数组中的质数

Introduction to RCNN, fast RCNN and fast RCNN

Live broadcast review | detailed explanation of koordinator architecture of cloud native hybrid system (complete ppt attached)

Pat 1157: school anniversary

C language_ Love and hate between string and pointer

WCF TCP protocol transmission

Redis的Cluster集群数据倾斜

Understanding of the concept of "quality"
随机推荐
Promise usage scenarios
Promise的使用场景
How to replace the web player easyplayerproactivex Key in OCX?
ZUCC_编译语言原理与编译_实验05 正则表达式、有限自动机、词法分析
pyQt 常用系统的事件
Future trends in automated testing
QT writing security video monitoring system 36 onvif continuous movement
Question 3 - MessageBox pop-up box, modify the default background color
[graduation season] Hello stranger, this is a pink letter
软件过程与项目管理期末复习与重点
Two methods of QT exporting PDF files
jwt(json web token)
[introduction to point cloud dataset]
到底哪一首才是唐诗第一?
5分钟,客服聊天处理技巧,炉火纯青
io模型初探
Micro build low code online "quick registration applet" capability
小样本故障诊断 - 注意力机制代码 - BiGRU代码解析实现
[xinliu-s6 new model +sa 3-star Xinghai] the new two-way server of the third generation chip was launched and the product was updated~
ZUCC_ Principles of compiling language and compilation_ Experiment 04 language and grammar