Using Barba.js with Sage 9
How to to integrate Barba with the Sage starter theme to load pages asynchronously while maintaining a sensible and useful browser history.
# Create a new Sage project
$ composer create-project roots/sage
# Development theme build with live reloading and injection
$ yarn start
# Production theme build
$ yarn build:production
Read the docs
Write stylesheets with Sass, automatically check your JavaScript for errors, optimize images, enable synchronized browser testing, and more with our Webpack based setup.
Sage comes with the latest version of Bootstrap. Replace Bootstrap with Bulma, Foundation, Tachyons, Tailwind, or a blank slate upon installation.
Sage uses Laravel's Blade templating engine:
@extends('layouts.base')
@section('content')
@while(have_posts())
{!! the_post() !!}
@include('partials/content-single')
@endwhile
@endsection
It’s been a year since I learned about Sage and used it exclusively in WordPress development. Over that time, I’ve grown the most in my career and Roots has certainly played a huge part in it.
Sage is great for a number of reasons. For me, it strikes a nice balance between a “too much stuff” that a framework brings and “not enough stuff” a theme like Underscores brings. It’s also robust and as object oriented as a theme can be.
Sage has brought WordPress development into the modern age. It’s absolutely excellent and we’d have probably moved away from WordPress by now without it. Can’t recommend it highly enough.
You’ll get differing opinions, but for me Roots/Sage was the best choice I ever made after playing with plenty of options. I think it’s a much better workflow, and actually teaches you good practices for wider development rather than very WP specific stuff.
Sage makes you a better developer and is a 10,000 hour head start.
Help support our open-source development efforts
Join over 7,000 subscribers on our newsletter to get the latest Roots updates, along with occasional tips on building better WordPress sites.
Looking for WordPress plugin recommendations, the newest modern WordPress projects, and general web development tips and articles?
“Easily the best WordPress email I get.” Colin OBrien