在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):agragregra/OptimizedHTML-5开源软件地址(OpenSource Url):https://github.com/agragregra/OptimizedHTML-5开源编程语言(OpenSource Language):JavaScript 42.7%开源软件介绍(OpenSource Introduction):OptimizedHTML 5Lightweight production-ready Gulp starter. OptimizedHTML 5 - lightweight startup environment with Gulp 4, Preprocessors (Sass, Scss, Less, Stylus), cssnano, Browsersync, PostCSS, Autoprefixer, webpack-stream, Babel, Rsync, CSS Reboot (Bootstrap reboot), Server-side HTML imports (SSI), build, gulp-imagemin. It uses best practices of images compression, JavaScript, CSS optimizing and contains a .htaccess code for resources caching (images, fonts, HTML, CSS, JS and other content types). How to use OptimizedHTML 5Clone into the current folder and remove all unnecessary (one command): git clone https://github.com/agragregra/oh5 .; rm -rf trunk .gitignore readme.md .git dist .editorconfig
Main Gulpfile.js options:
Main Gulp tasks:
Basic rulessrc's & dist's:
Include parts of HTML code:Include parts of html code is implemented using SSI Browsersync server side. You can import any part of the code using construction in any of html files: <!--#include virtual="/parts/header.html" --> Variables? No problem: <!--#set var="title" value="OptimizedHTML 5" --> <!--#include virtual="/parts/header.html" --> In "/parts/header.html": <title><!--#echo var="title" --></title> Include parts of Preprocessor code:All included parts of preprocessor files placed in the folder "styles/{preprocessor}/blocks/". Any number of preprocessor files can be placed here and in any order. They will be automatically included in the "styles/{preprocessor}/main.*" file and processed by the selected preprocessor. Included features
HelpersFontsThe woff2 fonts are currently recommended. Converter recommended: https://www.fontsquirrel.com/tools/webfont-generator font-weight helper
CachingCreate or open .htaccess file in root folder of website (Apache). Place this code for resources caching: <ifModule mod_expires.c> # Add correct content-type for fonts & SVG AddType application/font-woff2 .woff2 AddType image/svg+xml .svg ExpiresActive On ExpiresDefault "access plus 5 seconds" # Cache Images ExpiresByType image/x-icon "access plus 2592000 seconds" ExpiresByType image/jpeg "access plus 2592000 seconds" ExpiresByType image/png "access plus 2592000 seconds" ExpiresByType image/gif "access plus 2592000 seconds" ExpiresByType image/svg+xml "access plus 2592000 seconds" # Cache Fonts ExpiresByType application/font-woff2 "access plus 2592000 seconds" ExpiresByType image/svg+xml "access plus 2592000 seconds" # Cache other content types (CSS, JS, HTML, XML) ExpiresByType text/css "access plus 604800 seconds" ExpiresByType text/javascript "access plus 2592000 seconds" ExpiresByType application/javascript "access plus 2592000 seconds" ExpiresByType application/x-javascript "access plus 2592000 seconds" ExpiresByType text/html "access plus 600 seconds" ExpiresByType application/xhtml+xml "access plus 600 seconds" </ifModule> <ifModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript application/font-woff2 image/svg+xml </ifModule> Issues
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论