Skip to content

INSPIRATIONlabs/stencil-seo-starter

Repository files navigation

Stencil SEO Starter

Sonarcloud Status

This projects sets up basic stencil based projects with a basic set of SEO relevant stuff. It's also a boilerplate to create a website with a headless CMS backend and defines a basic JSON based structure on how a page should be rendered and which attributes are needed to ensure the SEO basics like title and meta tags without creating duplications of them while crawling the website. It also defines the needed hreflang headers for multi language websites etc.

What is stencil?

Stencil is a compiler for building fast web apps using Web Components.

Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.

Stencil components are just Web Components, so they work in any major framework or with no framework at all. In many cases, Stencil can be used as a drop in replacement for traditional frontend frameworks given the capabilities now available in the browser, though using it as such is certainly not required.

Stencil also enables a number of key capabilities on top of Web Components, in particular Server Side Rendering (SSR) without the need to run a headless browser, pre-rendering, and objects-as-properties (instead of just strings).

Getting Started

To start a new project using Stencil SEO starter, clone this repo to a new directory:

npm init <initializer> <type> <project_name>
npm init stencilseo seo seostarter

and run:

npm start

To build the app for production, run:

npm run build

To run the unit tests once, run:

npm test

To run the unit tests and watch for file changes during development, run:

npm run test.watch

Edit and add pages to your website

In src/assets/docs is a structure of json files which defines some basic pages for germand and english and a json structure to render them. These files will be loaded and rendered by the site-loader component.

Todo

  1. Automatically write the redirects to firebase.json
  2. Add more tests for site-loader