Skip to content
Public template

About

✅ A multilingual, clean, green 11ty starter theme.

Resources

Stars

104 stars

Watchers

2 watching

Forks

Repository files navigation

elva logo

elva

About

A multilingual, clean, green, 11ty starter theme. elva provides solid foundations for your next web project and a built in CMS (Front Matter CMS) for managing content. Try the demo!

Features include:

Performance things

  • Optimised CSS, JS and HTML
  • Responsive images that support lazy loading and modern formats (avif, webp)
  • Critical CSS using 11ty bundle
  • Support for the Photon CDN (can be turned on via settings)

Accessibility things

Standards things

Other things

Still to come:

Getting Started

Make a directory and navigate to it:

mkdir my-site-name
cd my-site-name

Clone this repository:

git clone https://github.com/scottsweb/elva.git .

Install dependencies:

npm install

Run Eleventy for site development. View the site at http://localhost:8080:

npm run dev

Generate a production-ready build to the dist folder (you will need to set the URL environment variable too e.g URL=https://example.com):

export URL=https://example.com && npm run build:prod

You can also set the environment variables NODE_ENV=production and URL=https://example.com in your hosting control panel and use npm run build as with previous versions of elva.

To use Front Matter CMS, install VSCodium or Visual Studio Code and enable the extension (if it doesn't enable automatically). It will open each time you launch your project.

For next steps, see the documentation.

Personalisation Checklist

  • In .eleventy.js you'll see some dynamic settings for url, isProduction and isStaging (under Global Settings). Make sure these environment variables are set in staging and production and tweak as necessary. You must set at URL environment variable for production builds to work properly as certain meta tags and the CDN require a full domain.
  • Configure your site settings
  • Configure site languages via the CLI npx elva, under the Languages sub-menu
  • Set your own default images, icons and favicon by replacing the images in /content/assets/img/
  • Add your content — it's easiest to do this with Front Matter CMS which exposes all front matter in the UI
  • Add additional translations using the CLI
  • Design your site by customising the CSS (/themes/default/css/), layouts (/themes/default/_layouts/) and includes (/theme/default/_includes/)... or duplicate the default theme using npx elva setup new-theme. You can also manually set the theme in /content/_data/settings.json to the name of your theme folder. We also have support changing this in the cli npx elva setup theme.
  • Setup a custom template for your open graph images (/themes/{theme}/_layouts/opengraph-preview.njk)

Optional

CLI

You can use the CLI to manage languages and content directly from the command line. Start with npx elva. The CLI defaults to an interactive menu, but you can also use shortcuts for common tasks.

Command Shortcuts

Setup Commands

  • npx elva setup site - Setup the basic site settings for a new project
  • npx elva setup theme - Choose the theme you wish to use
  • npx elva setup new-theme - Create a new theme by duplicating the default theme
  • npx elva setup delete-default-content - Delete all the default content that ships with elva

Language Commands

  • npx elva language add - Add a new language
  • npx elva language remove - Remove an existing language
  • npx elva language list - List all languages
  • npx elva language default - Change the default language

Content Commands

  • npx elva content add - Add new content
  • npx elva content remove - Remove existing content
  • npx elva content import - Import content from WordPress etc
  • npx elva content regenerate - Regenerate all open graph images

Blogroll Commands

  • npx elva blogroll list - List all blogroll entries
  • npx elva blogroll add - Add a new blogroll entry
  • npx elva blogroll remove - Remove blogroll entries

Collections Commands

  • npx elva collections list - List all collections
  • npx elva collections add - Add a new collection
  • npx elva collections remove - Remove a collection
  • npx elva collections edit - Edit a collection
  • npx elva sync-collections - Sync the collection.11tydata.js template to all collections

Translation Commands

  • npx elva translations add - Add a new translation
  • npx elva translations remove - Remove a translation
  • npx elva translations sync - Sync missing keys from the default language to other locales

Updates

4.0.0

With 4, you'll find a a new command line interface (documented above). This should make getting started and managing languages much easier. There is also a new search index you can use to build a custom search component, an example can be seen on the 404 page.

3.0.0

As of version 3.0 of elva, there are now separate folders for /themes, your sites /content and elva related stuff /elva. The idea is to make upgrades of elva simpler by seperating frequently changed things (the theme and content) from the guts of the project. Hopefully this is helpful, but please open an issue if you would like to see further improvements made.

About

✅ A multilingual, clean, green 11ty starter theme.

Resources

Stars

104 stars

Watchers

2 watching

Forks

Releases

Used by

Contributors

Languages