Coder Social home page Coder Social logo

bobdenotter / seo Goto Github PK

View Code? Open in Web Editor NEW
47.0 6.0 38.0 1.19 MB

Bolt SEO extension

Home Page: https://bobdenotter.github.io/seo/

License: MIT License

PHP 60.28% CSS 2.69% Twig 37.03%
bolt-extension bolt extension php seo meta-tags bolt-seo-extension seo-title og-tags

seo's Introduction

Bolt SEO extension

The Bolt SEO extension is an extension to help you improve the search engine indexing of your Bolt website in a number of ways. It does this by:

  • Allowing you to specify the SEO title and meta-description for your pages.
  • Adding meta tags to your HTML to facilitate indexing of your pages using meta tags and OG tags.
  • Override the canonical, if you really want to.
  • Set the <meta name="robots">-tag.

Setup

To use this extension, you should add a field to your contenttypes, and add the tags to the header of your HMTL templates.

In your contenttypes, you should add a single seo field. The extenion will use this to store the data for the different fields that show in the backend when editing a record. Simply add it to your fields like this;

pages:
    name: Pages
    singular_name: Page
    fields:
        [..]
        seo:
            type: seo
            group: "SEO settings"

You can assign the fields their own tab, using the group: 'SEO settings', to keep them organised in the backend.

After you've done this, it will look like this in the Bolt backend:

To add the SEO title and Meta tags to your HTML, edit your templates (the 'master' or 'header') to have the following:

    <title>{{ seo.title() }}</title>
    {{ seo.metatags() }}

When you've done this, all pages that make use of these templates will automatically have the correct <title> tag and the meta- and OG-tags.

Configure the 'meta tags' output

By default, the output of the meta-tags is defined in the file extensions/vendor/bobdenotter/seo/twig/_metatags.twig. If you'd like to configure this output, you shouldn't edit this file directly. If you do, changes will be overwritten on subsequent updates of this extension. Instead, in /app/config/extensions/seo.bobdenotter.yml uncomment the following lines:

templates:
    meta: _metatags.twig

Next, copy the file _metatags.twig to your theme folder, and the extension will pick it up from there.

Note: This is a new extension, so the functionality is still pretty bare bones. What's there works well, but there is probably a lot of functionality to add, to improve search engine indexing. If you'd like to contribute, or have a good idea, feel free to open an issue on the tracker at the SEO Extension repository on Github.

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.