当前位置:网站首页>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 .
边栏推荐
- JS scroll div scroll bar to bottom
- 2021-03-09 comp9021 class 7 Notes
- Which is the first poem of Tang Dynasty?
- 5 minutes, excellent customer service chat handling skills
- ZUCC_ Principles of compiling language and compilation_ Experiment 03 getting started with compiler
- 51 single chip microcomputer_ External interrupt and timer / Counter interrupt
- longhorn安装与使用
- io模型初探
- pyQt 中 QMenu 响应
- Tool functions – get all files in the project folder
猜你喜欢

2021-03-04 COMP9021第六节课笔记

2021-03-04 comp9021 class 6 notes

ZUCC_编译语言原理与编译_实验03 编译器入门

李白最经典的20首诗排行榜

Markdown 实现文内链接跳转

Small sample fault diagnosis - attention mechanism code - Implementation of bigru code parsing

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

Permission model DAC ACL RBAC ABAC

独立站运营中如何提升客户留存率?客户细分很重要!

Pat 1157: school anniversary
随机推荐
Getting started with ffmpeg
Blue Bridge Cup_ Queen n problem
(PKCS1) RSA 公私钥 pem 文件解析
487. number of maximum consecutive 1 II ●●
Introduction to RCNN, fast RCNN and fast RCNN
Understanding of the concept of "quality"
All you know is the test pyramid?
Industrial computer anti cracking
ZUCC_ Principles of compiling language and compilation_ Experiment 03 getting started with compiler
App Startup
[graduation season] Hello stranger, this is a pink letter
Three categories of financial assets under the new standards: AMC, fvoci and FVTPL
【关于运维和网工的差别,一文说透】
New technology practice, encapsulating the permission application library step by step with the activity results API
2021-03-11 comp9021 class 8 notes
[ACNOI2022]不是构造,胜似构造
A preliminary study of IO model
OpenCV to realize the basic transformation of image
QPS, TPS, concurrent users, throughput relationship
More appropriate development mode under epidemic situation