Git Product home page Git Product logo

cga's Introduction

Slinkity starter project banner

Welcome to Slinkity starter project ๐Ÿ‘‹

Version Documentation Maintenance License: MIT Twitter: slinkitydotdev

The all-in-one template for building your first Slinkity project

Slinkity is a framework that uses Vite to bring dynamic, client side interactions to your static 11ty sites. Slinkity lets you swap out existing templates like .html or .liquid for component templates like .jsx. What's more, it allows you to insert components into pages using shortcodes, like this one: {% react './path/to/Component.jsx' %}. And since you can opt-in to hydrating components clientside, dynamic state variables can work in both development and production.

With these capabilities, we aim to unify two competing camps in the web development community:

  • Lean, JavaScript-free static site generators driven by data and templating languages like Jekyll and Hugo.
  • Dynamic, JavaScript-heavy web apps powered by data and component frameworks like NextJS and NuxtJS.

Install dependencies and start development server

yarn start runs slinkity --serve to start a Vite server pointed at your 11ty build. The --incremental flag can be used for faster builds during development.

yarn
yarn start

Open localhost:8080 to view your site. Vite's development server enables processing a range of resources including SASS and React.

Build for production

Run the slinkity to process your files in a 2 step process:

  • Use 11ty to build your routes and copy over static assets
  • Use Vite to bundle, minify, and optimize your styles and JS resources
yarn build

Your new site will appear in the _site folder, or wherever you tell 11ty to build your site.

.eleventy.js

Slinkity relies on 11ty's latest 1.0 beta build to work properly. Our .eleventy.js file includes a few niceties we'd recommend for any Slinkity project, including:

  • Setting an input directory
  • Copying static assets to the build from a /public directory
  • Using Nunjucks for shortcode processing in markdown

To see the full "what" and "why," head to the .eleventy.js file.

How does the slinkity command differ from eleventy?

You can view slinkity as the "glue" between 11ty and Vite. When using the slinkity command, all arguments are passed directly to the eleventy CLI, except serve and port:

  • serve starts the 11ty dev server in --watch mode to listen for file changes.
  • port is passed to Slinkity's independent Vite server instead of 11ty's Browsersync server.

The CLI checks for Eleventy configs and will look for any custom directories returned, such as input or output. If found, those are passed off to the Vite server so it can look in the right place.

Here's a the full step-by-step for those curious!

01-slinkity-architecture

Authors

๐Ÿ‘ค Ben Holmes

๐Ÿ‘ค Anthony Campolo

๐Ÿค Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a โญ๏ธ if this project helped you!

๐Ÿ“ License

Copyright ยฉ 2021 Ben Holmes. This project is MIT licensed.


This README was generated with โค๏ธ by Ben with readme-md-generator and then heavily edited by Anthony.

cga's People

Contributors

neilgilmour avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.