Meta

Adds document meta: open graph, twitter, schema.org & other seo information

Meta

Compatible with Flarum v1.4.1

Latest release 0.1.0-beta.1

0 subscribers

0 downloads

released on Jul 20, 2022

Tags

This Flarum extension superpowers your Flarum forum with meta tags for:

  • Twitter
  • Open Graph
  • Schema.org

The meta data for this extension is generated not on request of the page, but whenever content changes. The processing is pushed to the queue (if you've set that up) and simply loaded from one database table for performance and scalability reasons.

Requirements

  • PHP 8.0+.
  • libfontconfig1 and libxrender1, these two packages need to be installed on your Operating System. These are required to generate OG images from html templates.

Premium

This extension requires an active subscription from extiverse. Once your subscription is active you can follow the instructions on the Extiverse subscriptions page to configure composer. Once completed you can run the following command for installation:

composer require blomstra/meta:"*"

For updates:

composer require blomstra/meta:"*"
php flarum migrate
php flarum cache:clear

Managed Flarum communities that we host on our hosting platform (Blomstra) have access to all premium extensions by Blomstra without additional cost.

Enable the extension inside the admin area.

Extend

Meta types

You can add new types of meta objects into the extension. For instance for your own extension.

return [
    (new \Blomstra\Meta\Extend\Meta)
        ->addType(YourTypeClass::class),
];

Image generation

You can override the Theme and Template for the images generated for open graph.

  • A Theme defines image size, colors and other variables that, by default, rely on the theme of your forum.
  • The Template defines where what is placed. It defines the layout of the generated image.

You can add your own by using the Extender:

return [
    (new \Blomstra\Meta\Extend\Meta)
        ->addTheme(YourThemeClass::class)
        ->addTemplate(YourTemplateClass::class),
];

You can provide an optional second argument to conditionally load the theme or template:

return [
    (new \Blomstra\Meta\Extend\Meta)
        ->addTheme(YourThemeClass::class, function (\Blomstra\Meta\Types\Type $type, \Flarum\Database\AbstractModel $model) {
            return $type instanceof \Blomstra\Meta\Types\Discussion 
                && \Illuminate\Support\Str::endsWith($model->user->email, '@blomstra.net');
        }),
];

All premium extensions by Blomstra are also available for free with any of our managed Flarum communities.


FAQ

Where can I get this thing of beauty? Head over to extiverse.com/extension/blomstra/meta, create an account, verify your mail address and choose a plan.

How is the image generated? This extension uses wkhtmltoimage behind the scenes to create an image from html generated through Flarum.

wkhtmltoimage seems to fail? Download the correct wkhtmltoimage binary for your operating system from the wkhtmltopdf site and the use the extender in your extend.php to enforce using it:

<?php

return [
  (new \Blomstra\Meta\Extend\WkHtmlToImage)->path("/whatever/path/towkhtmlimage")
];

Where are the images stored? The og images are stores in the Flarum public assets directory.

I have another question. Reach out to us via https://helpdesk.blomstra.net. We will get back to you as soon as we can. If you have a running subscription please mention when you started your plan and/or which plan you are on. Always add sufficient information when reporting errors. We prefer errors being reported here, but understand that sometimes you can't.


  • Blomstra provides managed Flarum hosting.
  • https://blomstra.net

Attribution Icon made by Smashicons from Flaticon.

© 2022 Hyn by DaniĆ«l "Luceos" Klabbers. All rights reserved. · Extensions and extension information is provided by the respective (copyright holding) authors. · Extiverse is not affiliated to the Flarum project or Flarum foundation. · Images on Extiverse pages are from Unsplash.