All Projects → frontenso → frontenso-11ty-starter

frontenso / frontenso-11ty-starter

Licence: MIT license
Production-ready 11ty+Gulp+Webpack Starter that features Nunjucks, SASS, TailwindCSS (with JIT complier), and ESNext.

Programming Languages

javascript
184084 projects - #8 most used programming language
SCSS
7915 projects
Nunjucks
165 projects
CSS
56736 projects

Projects that are alternatives of or similar to frontenso-11ty-starter

nuxt-starter-netlify-cms
Example nuxt + netlify cms project. Nuxt port of Gatsby starter app.
Stars: ✭ 13 (-45.83%)
Mutual labels:  starter-template, starter, jamstack, tailwind
eleventy solo starter njk
Further development suspended as of 2021-09-11. Please refer instead to https://www.11ty.dev/docs/starter/ for a wide selection of other Eleventy starter sets.
Stars: ✭ 22 (-8.33%)
Mutual labels:  starter-template, tailwind, eleventy, 11ty
Bootstrap 4 Sass Gulp 4 Boilerplate
A Bootstrap 4.5.2 boilerplate with font-awesome, sass, gulp 4 tasks
Stars: ✭ 103 (+329.17%)
Mutual labels:  gulp, starter-template, starter
11tyby
Simple 11ty setup using TypeScript, SASS, Preact with partial hydration, and other useful things. Aims to provide the DX of Gatsby, but using 11ty!
Stars: ✭ 38 (+58.33%)
Mutual labels:  starter, eleventy, 11ty
fernfolio-11ty-template
The super simple portfolio template built with Eleventy and Netlify CMS
Stars: ✭ 64 (+166.67%)
Mutual labels:  jamstack, eleventy, 11ty
Wordpress Starter
📦 A starter template for WordPress websites
Stars: ✭ 26 (+8.33%)
Mutual labels:  gulp, starter-template, starter
11ty-tailwind-jit
Try editing some Tailwind in this repo while running in dev. It's SO FAST!
Stars: ✭ 17 (-29.17%)
Mutual labels:  jamstack, eleventy, 11ty
smix-eleventy-starter
A standards-respecting starter kit for Eleventy. Go Indie.
Stars: ✭ 108 (+350%)
Mutual labels:  jamstack, eleventy, 11ty
Next Js Blog Boilerplate
🚀 Nextjs Blog Boilerplate is starter code for your blog based on Next framework. ⚡️ Made with Nextjs, TypeScript, ESLint, Prettier, PostCSS, Tailwind CSS.
Stars: ✭ 134 (+458.33%)
Mutual labels:  starter-template, starter, jamstack
Gatsby Starter Netlify Cms
Example gatsby + netlify cms project
Stars: ✭ 1,932 (+7950%)
Mutual labels:  starter-template, starter, jamstack
angular-material-starter-template
🍄 Angular 14 boilerplate that comes with Material-UI, Tailwind3, Purgecss, Jest & Cypress Support, Optimal project structure & Interceptor inspired from popular blogs, source map analyzer tools, husky, all pre-configured and much more...
Stars: ✭ 104 (+333.33%)
Mutual labels:  boilerplate-template, boilerplate-front-end, tailwind
11ta-template
Deeply customizable, full-featured, ready to publish blog template built with 11ty, TailwindCSS, & Alpine.js
Stars: ✭ 98 (+308.33%)
Mutual labels:  jamstack, 11ty, 11ty-template
Eleventy High Performance Blog
A high performance blog template for the 11ty static site generator.
Stars: ✭ 3,492 (+14450%)
Mutual labels:  eleventy, 11ty, 11ty-template
agilitycms-eleventy-starter-2020
A sample Eleventy starter that uses Agility CMS and aims to be a foundation for building fully static sites using 11ty and Agility CMS.
Stars: ✭ 18 (-25%)
Mutual labels:  jamstack, 11ty, 11ty-template
smol-11ty-starter
Extremely minimal Eleventy starter to kickstart a simple multi-page site / a nearly opinionless foundation to continue building on.
Stars: ✭ 61 (+154.17%)
Mutual labels:  eleventy, 11ty, 11ty-template
11ty-sass-skeleton
Featuring absolutely nothing beyond a base HTML5 template and the essential setup to watch and compile your Sass alongside 11ty.
Stars: ✭ 174 (+625%)
Mutual labels:  eleventy, 11ty, 11ty-template
bymattlee-11ty-starter
A starter boilerplate powered by 11ty, Sanity, Gulp, Tailwind CSS, rollup.js, Alpine.js and Highway.
Stars: ✭ 27 (+12.5%)
Mutual labels:  gulp, eleventy, 11ty
sass-starter-pack
Sass starter files using Gulp v4.0.0 🔥
Stars: ✭ 34 (+41.67%)
Mutual labels:  gulp, starter-template, starter
11up
A utility to create an 11ty site scaffold from one of a number of site templates. Mostly just Phil Hawksworth's regular starting points
Stars: ✭ 25 (+4.17%)
Mutual labels:  jamstack, eleventy, 11ty
Angular Starter
⭐️ Gulp Angular Starter using TypeScript (Updated to 4.4.3)
Stars: ✭ 538 (+2141.67%)
Mutual labels:  gulp, starter

frontenso-eleventy-starter
by frontenso.com

Nunjucks + SCSS + TailwindCSS(JIT) + ESNext starter based on 11ty and Gulp 💪

This starter kit is ready for production and is built on a component-based structure, utilizing the power of Nunjucks, SCSS, and TailwindCSS (with a Just-in-Time compiler), Webpack, ESNext, and live reloading.

It uses 11ty to handle HTML generation and Gulp for the rest of the build process.

It is flexible and can be used in conjunction with any data source, whether it be a headless CMS, JSON, Markdown or any other data source that can be fetched via JavaScript. For more information on how to work with data sources, please refer to the 11ty documentation.

Getting started

Using this repository as a template

This repository is the perfect starting point for your next project. By simply clicking on the green "Use this template" button on this GitHub page, you can easily create a new repository tailored to your needs. From there, you can customize and configure the repository to your liking and begin your development journey with ease.

Running for development

1. Install dependencies:

npm install

2. Run the project for development:

npm start

3. Open development URL - http://localhost:9000/.

Scripts

Running the project for development:

npm start

Build the project for production:

npm run build

Creating a production-ready zip-archive build.zip:

npm run zip

Component-based Approach

Decomposing the UI into separate, less coupled components is highly recommended for many reasons.

It is a best practice to create components for parts of the UI that appear in multiple places in your project, such as buttons, common page sections, widgets, and sliders.

To keep your components organized, it is a good idea to keep them inside the src/components/ folder. This starter kit allows you to keep the markup, styles, and JavaScript code for a component all in one place, making it easy to use them in multiple locations throughout your project. Take a look at the src/components/ folder for examples of how different types of components are arranged. It's important to note that it is not always necessary to include Nunjucks or JavaScript code for a component if it does not make sense to do so, for example, when the markup is quite simple or when a component does not have any JavaScript logic.

Image Quality Settings

You can change image compression settings for avif, webp, jpeg, png files in .eleventy.js config.

TypeScript

This boilerplate has built-in support for TypeScript, but it is completely optional to use it during development. We have chosen to use JSDoc notation (which is officially supported by TypeScript team) to provide TypeScript support. This means that you don't have to write your code using TypeScript syntax, and can instead continue to write your code using JavaScript syntax with JSDoc notation for TypeScript support. This approach also allows you to easily disable TypeScript if you do not need it at some point during your development process, for example, to speed up development or if you have new developers working on the project who are not familiar with TypeScript.

If you don't need TypeScript, simply remove tsconfig.json file from your project.

Nunjucks HTML template engine

Nunjucks is a powerful HTML template engine with a syntax very similar to jinja2. Nunjucks makes easier writing highly-maintainable HTML code.

Nunjucks templates seat in src/_layouts/, src/components/ folders.

To make the most out of Nunjucks, it is recommended to read through its documentation. This will give you a good understanding of its features and how to use them effectively in your project.

You can also read 11ty documentation on templating and data sources.

Another tip for working with Nunjucks is to ensure that your code editor has syntax highlighting for Nunjucks. If your editor does not have native support for Nunjucks, you can set up the syntax highlighting for the Twig template engine instead. This can be done by configuring your editor to use the Twig syntax highlighting when opening .njk files.

Using a different template engine

You have the flexibility to use any HTML template engine of your preference, such as Pug, Handlebars, or even plain HTML. To do this, you need to replace Nunjucks with your desired template engine in the .eleventy.js file. For instructions on how to configure a different template engine, refer to the 11ty documentation on the topic. You can find the link on how to configure a different template engine in the 11ty documentation.

Webpack v5

This starter kit uses Webpack v5 to build the JavaScript bundle. However, it does not have hot reloading feature enabled, as it is not necessary for static websites.

Customize static path

This template provides the ability to customize the static path for project resources such as images, scripts, styles, etc. For example, you can use a custom CDN URL. Add an .env file to the root directory of the project with the following content STATIC_PATH=http://localhost:9000 then you can reference the STATIC_PATH variable in your code like this <link rel="stylesheet" href="{{ STATIC_PATH }}/css/tailwind.css">

Note: When using STATIC_PATH in Nunjucks macros, it must be passed as props.

The SVG sprite

This starter features a convenient way to include SVG files through the use of SVG sprites. By utilizing the gulp-svgstore plugin, it generates a single sprite containing all of your SVG files.

The SVG sprite markup is inlined in base.njk template using {% svg_prite %} shortcode function (there is no need to modify this code).

To show an SVG image on the webpage, first place it in the src/svg folder. For example, if the file is named some-vector.svg.

Then add it to the page in the following way:

<svg><use xlink:></use></svg>

Note: some-vector.svg file should be located in the src/svg directory so that gulp-svgstore could add it to the SVG sprite.

You can also use CSS selectors to set properties such as the fill or stroke for this element on the page, without having to edit the SVG file. Additionally, you can even animate specific parts of the SVG element, such as a <path> or <circle>.

You can also take a look at the <svg> examples in the index.njk.

{% image %} Nunjucks tag

This feature allows you to easily create AVIF and WebP images. It automatically generates multiple sizes for the srcset attribute based on the maximum width specified (the third argument) and the widths defined in the .eleventy.js configuration file.

If you need to add CSS class to <picture> tag then pass it as pictureClass among the options (second argument). To add CSS class to <img> pass class to options argument.

See examples in index.njk to get familiar with {% image %} tag.

Inlining images as base64 strings inside Nunjucks templates using inline filter

This may become a useful approach if you need to display an image instantly on the page without making a request to the server.

<img src="{{ 'src/images/some-image.png' | inline }}" alt="" />

Warning! Please use this feature with caution as it may bloat the final HTML file. Inlining images could be a good approach if the file is quite small, in other cases prefer {% image %} tag.

Inlining raster or svg images in CSS

The postcss-assets plugin allows to inline images into CSS code in Base64 encoding or as is for SVG files:

background: inline('some-image.png')

The plugin also can insert an image sizes:

width: width('some-image.png')
height: height('some-image.png')
background-size: size('some-image.png')

Warning! Use this feature with caution as it may cause the final CSS file to become large. Inlining images is a good option if the file is relatively small, otherwise, it is recommended to use the {% image %} tag instead.

Examples

For code examples, please refer to src/index.njk.

To see them live, open the index page in the browser by running npm start and going to http://localhost:9000

You can also check them on the live demo page

Useful links

Nunjucks syntax.

TailwindCSS

TailwindCSS Cheatsheet

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].