Giter Club home page Giter Club logo

kirby-serp-preview's Introduction

Kirby Search Engine Result Page Preview

Kirby SERP Preview

A standalone search engine result page preview to include in any Kirby project. It allows you to preview how your page will look in the search results of Google and other search engines.

Requirements

  • Kirby 4+

Kirby is not free software. However, you can try Kirby and the Starterkit on your local machine or on a test server as long as you need to make sure it is the right tool for your next project. … and when you’re convinced, buy your license.

Installation

Composer

composer require johannschopplich/kirby-serp-preview

Download

Download and copy this repository to /site/plugins/kirby-serp-preview.

Getting Started

Create a new section in one of your blueprints:

sections:
  serp-preview:
    type: serp-preview
    siteTitle: "{{ site.title.value }}"
    siteUrl: "{{ site.url }}"
    # Optional field to override the computed title
    titleContentKey: metaTitle
    # Optional default title as fallback if the field above is empty
    defaultTitle: "{{ page.getMetaTitle.value }}"
    descriptionContentKey: metaDescription
    # Optional default description as fallback if the field above is empty
    defaultDescription: "{{ site.metaDescription.value }}"

Usage

Page Title

By default, the SERP preview will render the title of the search engine result page preview by joining the following values with a space:

1️⃣ Page Title 2️⃣ Title Separator (defaults to –) 3️⃣ Site Title

When defaultTitle is defined

The titleContentKey section property allows you to define a custom content key for the page's title. If it is set and the field contains a value, it will override the computed title.

Configuration

Each configuration option is of type string. Some of them support Kirby queries. For example, you can use {{ site.title.value }} for the siteTitle option.

The following table lists all available options:

Option Default Queryable Description
faviconUrl null – The URL to the favicon.
siteTitle "{{ site.title.value }}" βœ… The site title.
siteUrl "{{ site.url }}" βœ… The site URL.
titleSeparator "-" βœ… The title separator between the current page title and the site title. Only applies if no titleContentKey is set and the target field value is empty.
titleContentKey null – The content key for a custom title.
defaultTitle null βœ… Plain text or Kirby query to use as a fallback instead of 1️⃣2️⃣3️⃣ if the titleContentKey is empty.
descriptionContentKey null – The content key for the page's custom description.
defaultDescription null βœ… Plain text or Kirby query to use as a fallback if the descriptionContentKey is empty.
searchConsoleUrl null – If provided, the section will display a link to the Google Search Console.

License

MIT License Β© 2023-PRESENT Johann Schopplich

MIT License Β© 2023-PRESENT Dennis Baum

kirby-serp-preview's People

Contributors

grommasdietz avatar johannschopplich 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.