GithubHelp home page GithubHelp logo

fabianmichael / kirby-meta Goto Github PK

View Code? Open in Web Editor NEW
65.0 8.0 7.0 583 KB

All-in-one solution to all of your SEO/OpenGraph/JSON-LD needs. 👀

License: MIT License

PHP 83.44% CSS 0.20% JavaScript 1.07% Vue 15.29%
seo metadata kirby-cms kirby-plugin

kirby-meta's Introduction

Kirby Meta

⚠️ Warning: This plugin is in beta state. Documentation and implementation are still incomplete.

This piece of code handles the generation of meta tags for search engines, social networks, browsers and beyond.

Screenshot 2022-01-14 at 09-57-24 Mirin Avo’s Kitchen

Key features:

  • 🔎 All-in-one solution for SEO and social media optimization
  • 📱 Support for OpenGraph and Schema.org (JSON-LD) markup
  • 🚀 Customizable metadata for auto-generated metadata from page contents
  • 💻 Extensive panel UI including social media previews
  • 🦊 Easy-to-understand language in the panel, providing a good middle ground between simplicity and extensive control options.
  • 🧙‍♂️ Most features can be enabled/disabled in config, panel UI only shows enabled features (thanks to dynamic blueprints)
  • 🪝 Hooks for altering the plugin's behavior
  • 🌍 All blueprints are fully translatable (English, German, French and Swedish translations are included)

Future plans:

  • ✅ Live-check of metadata with hints in the panel

This plugin is completely free and published under the MIT license. However, if you are using it in a commercial project and want to help me keep up with maintenance, please consider to ❤️ sponsor me for securing the continued development of the plugin.

Requirements

  • PHP 8.0+
  • Kirby 3.6.0+

How it works

The plugin looks for metadata from a page's content file (e.g. article.txt) by the corresponding key. If the page does not contain the specific field, it looks for a metadata method on the current page model, which can return an array of metadata for the current page. If that also fails, it will fall back to default metadata, as stored in the site.txt file at the top-level of the content directory.

That way, every page will always be able to serve default values, even if the specific page or its model does not contain information like e.g. a thumbnail or a dedicated description.

Installation & Setup

Install using composer (recommended):

composer require fabianmichael/kirby-meta

Alternative download methods:

You can also download this repository as ZIP or add the whole repo as a submodule. To run from source, you need to install the dependencies : composer install.

Available configuration options

The options below have to be set in your config.php. Please note that every option has to be prefixed with the plugin namespace, e.g. sitemap => fabianmichael.meta.sitemap.

Key Type Default Description
sitemap bool true When true, will generate an XML sitemap for search engines. The sitemap includes all listed pages by default. ⚠️ If you disable the robots setting, no robots.txt will be served to tell search engines where your sitemap is located.
sitemap.detailSettings bool false When true, the <changefreq> and <priority> tags are included in the sitemap and their corresponding fields are displayed in the panel.
sitemap.pages.exclude array [] An array of page IDs to exlude from the sitemap. Values are treated as regular expressions, so they can include wildcards like e.g. about/.*. The error page is always excluded.
sitemap.pages.includeUnlisted array [] An array of page IDs to include in the sitemap, even if their status is unlisted. Values are treated as regular expressions, so they can include wildcards like e.g. about/.*.
sitemap.templates.exclude array [] An array of template names to exlude from the sitemap. Values are treated as regular expressions, so they can include wildcards like e.g. `article-(internal
sitemap.templates.includeUnlisted array [] An array of templates to include in the sitemap, even if their status is unlisted. Values are treated as regular expressions.
schema bool true Generates Schema.org markup as JSON-LD.
social bool true Generates OpenGraph markup.
twitter bool true Generates Twitter Cards markup. Only has an effect, if social is also enabled. Since 0.2.0-beta (⚠️ deprecated).
robots bool true Generates the robots metatag and serve robots.txt at http(s)://yourdomain.com/robots.txt.
robots.canonical bool true Generates canonical url meta tag. Requires robots option to be true.
robots.index bool true Allows crawlers to index pages. Can be overriden in global or page-specific settings from the panel. Requires robots option to be true for having an effect. If a page is excluded from the sitemap or unlisted, the robots meta tag will always contain noindex.
robots.follow bool true Allows crawlers to follow links on pages. Can be overriden in global or page-specific settings from the panel. Requires robots option to be true for having an effect.
robots.archive bool true Allows crawlers to serve a cached version of pages. Can be overriden in global or page-specific settings from the panel. Requires robots option to be true for having an effect.
robots.imageindex bool true Allows crawlers to include images to appear in search results. Can be overriden in global or page-specific settings from the panel. Requires robots option to be true for having an effect.
robots.snippet bool true Allows crawlers to generate snippets from page content. Can be overriden in global or page-specific settings from the panel. Requires robots option to be true for having an effect.
robots.translate bool true Allows crawlers offer automated translation of your content. Can be overriden in global or page-specific settings from the panel. Requires robots option to be true for having an effect.
title.separators array ["~" , "-" , "–" , "—" , ":" , "/", …] List of available separator options for the <title> tag. The separator can be selected in the panel and is placed between page title and site title. 
theme.color string|null null If not empty, will generate a corresponding meta tag used by some browsers for coloring the UI.
panel.view.filter Provides a filter function for hiding certain pages from the metadata debug view in the panel. See the Kirby docs on $pages->filter() for details.

Blueprint setup

Your site and page blueprints need to use tabs, as the plugin's input fields all come in a tab. Meta comes with tab blueprints that need to be added to your site and page blueprints accordingly:

# site/blueprints/site.yml
[…]
tabs:
  structure:
    label: Structure
    columns:
      […]
  meta: tabs/meta/site

# site/blueprints/pages/default.yml
[…]
tabs:
  content:
    label: Content
    columns:
      […]
  meta: tabs/meta/page

Template setup

Include the meta snippet within your <head> element, preferably before loading any scripts or stylesheets:

<!doctype html>
<html>
<head>
  <?php snippet('meta') ?>
  […]
</head>
[…]

Now you are ready to add/edit metadata from the panel.

Advanced usage

Providing metadata from page models

Sometimes, you want special behavior for certain templates. The easiest way to achieve this is by creating a page model and implementing a $page->metadata() method, that returns an array some or even all of the following keys:

Key Type Description
meta_description string Provide a default description that is used, when the user had not entered a dedicated description for this page. This could e.g. be a truncated version of the page's text content.
og_title_prefix string Will be put in front of the page's OpenGraph title, e.g. 'ℹ️ ' or '[Recipe ]
og_image File Kirby\Cms\File A File object, that sets the default OpenGraph image for this page. You can even generate custom images programatically and Wrap them in a File object, e.g. for the docs of your product (getkirby.com does this for the reference pages).
@graph array Things to add to the JSON-LD metadata in the page's head. If you need to reference the organization or person behind the website, use url('/#owner'). If you need to reference the website itself, use url('/#website').
@social array Extend the social meta tags generated by the plugin.

Using hooks

the meta plugin provides a set of handy hooks, allowing you to further add/remove/modify metadata without overriding the built-in snippets or having to set up a page model for every template.

⚠️ Hooks are a powerful tool that can break the plugin's expected behavior for editors working on the panel. Use with care!

meta.load:after

After metadata has been loaded by calling the $page->metadata() method on a model. This allows you to inject additional data.

return [
  'meta.load:after' => function (
    array $metadata,
    Kirby\Cms\Page $page,
    ?string $languageCode
  ) {
    // set `thumbnail.png` as default share image for all pages,
    // if not other image was already set by a page model
    if (empty($metadata['og_image']) === true) {
      $metadata['og_image'] = $page->image('thumbnail.png');
    }
    return $metadata;
  },
];

meta.jsonld:after hook

After the Schema.org graph has been generated. This allows you to pass additional data to the array.

return [
  'meta.jsonld:after' => function (
    array $json,
    FabianMichael\Meta\PageMeta $meta,
    Kirby\Cms\Page $page
  ) {
    // add breadcrumb to JSON-LD graph
    $items = [];

    $parents = $page->parents();

    if ($parents->count() === 0) {
      return $json;
    }

    $i = 0;

    foreach ($parents->flip() as $parent) {
      $items[] = [
        '@type' => 'ListItem',
        'position' => ++$i,
        'item' => [
          '@id' => $parent->url(),
          'name' => $parent->title()->toString(),
        ],
      ];
    }

    $json['@graph'][] = [
      '@type' => 'BreadcrumbList',
      'itemListElement' => $items,
    ];

    return $json;
  },
];

meta.social:after

Allows you to alter the OpenGraph/Twitter card data.

return [
  'meta.social:after' => function (
    array $social,
    FabianMichael\Meta\PageMeta $meta,
    Kirby\Cms\Page $page
  ) {
    // add first video file of page to OpenGraph markup
    if ($page->hasVideos()) {
      $social[] = [
        'property' => 'og:video',
        'content'  => $page->videos()->first()->url(),
      ];
    }
    return $social;
  },
];

'meta.sitemap… hooks

These hooks allow you to completely alter the way how the sitemap is being generated. These functions are meant to manipulate the provided DOM document and elements directly and should not return anything.

return [
  'hooks' => [
    'meta.sitemap:before' => function (
      Kirby $kirby,
      DOMDocument $doc,
      DOMElement $root
    ) {
      // add namespace for image sitemap
      $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:image', 'http://www.google.com/schemas/sitemap-image/1.1');
    },

    'meta.sitemap.url' => function (
      Kirby $kirby,
      Page $page,
      PageMeta $meta,
      DOMDocument $doc,
      DOMElement $url) {

      if ($page->images()->count() === 0) {
        // dynamically exclude page from the sitemap
        return false;
      }

      foreach ($page->images() as $image) {
        // add all images from page to image sitemap.
        $imageEl = $doc->createElement('image:image');
        $imageEl->appendChild($doc->createElement('image:loc', $image->url()));

        if ($image->alt()->isNotEmpty()) {
          $imageEl->appendChild($doc->createElement('image:caption', $image->alt()));
        }

        $url->appendChild($imageEl);
      }
    },

    'meta.sitemap:after' => function (
      Kirby $kirby,
      DOMDocument $doc,
      DOMElement $root
    ) {
      foreach ($root->getElementsByTagName('url') as $url) {
        if ($lastmod = $url->getElementsByTagName('lastmod')[0] ?? null) {
          // remove lastmod date from sitemap entries for some reason …
          $url->removeChild($lastmod);
        }
      }
    },

    'meta.theme.color' => function (
      ?string $color
    ) {
      return '#ff0000';
    }
  ],
];

Manipulating indexed pages

A few helpers are available for manipulating pages:

Page Method

If you'd like to know if a page is indexed in the sitemap, you can use $page->isIndexible() (returns a bool).

Site Method

To get all indexed pages according to your settings, you can use : $site->indexedPages() (returns a Kirby\Cms\Collection of pages).

Credits

This is partly based on an older version of the meta plugin, that I had initially developed for getkirby.com. I liked the idea so much, that I wanted to adapt it for general use on other websites.

It took a lot of inspiration (and some code) from other existing Kirby plugins, like MetaKnight by diesdas ⚡️ digital and Meta Tags by Pedro Borges.

kirby-meta's People

Contributors

che1ron avatar daandelange avatar fabianmichael avatar grommas avatar olivertedwards avatar owzim avatar smncd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kirby-meta's Issues

Use thumb presets for easier thumbnail customisation

Hello (again),
[sorry for posting quite some issues, I'm implementing your plugin and thinkering at the same time :) ]

Context:
I'm using a custom thumb driver to customise how thumbs are generated generally and would like to use it to customise the OG image thumb too. Long story short, this is way more easy and robust using thumb presets when calling $file->thumb() (otherwise requiring to check the thumb settings argument against known preset values).

Motivation:
Be it with or without custom thumb driver, I think there are situations where one wishes customise the thumb function used by this plugin, and it would be possible if it registers and uses a thumb preset rather then hardcoded thumb parameters. (example: change the thumb quality for the og-image).
This will also make it easier to generate an og-image-thumb manually from usercode by providing a specific preset.

Sure, this is already possible with the hooks by removing the corresponding thumb tags and generating a thumb again to put it back as a html tag, but that feels heavy.

Proposal:
So I'm asking to make the OG image thumb easier to customise/hook-up by switching from hardcoded thumb parameters to a thumb preset.

  1. Register a thumb preset
  2. Modify all calls to thumb()

Coexist with kirby-wellknown

I try to get my new page up and running with various plugins and I really like this one. Many thanks for the good work.

Currently I struggle with the options for robot.txt generation.
For several wellknown files (humans, dnt, ...) I installed omz/kirby3-wellknown.
Now, robots.txt is always served from this plugin instead of kirby-meta.

Is there any way to tell kriby to prefer kirby-meta for the robots.txt route?
Or are there any plans to interact with other robots-plugins and e.g. "feed" them the required content?

For now I'll disable kirby3-wellknown and hope for a solution to get the content generated by this plugin to my robots.txt in coexistence ;)

Console warning about icon sizes

Nothing too devastating,
but I get this console warning about the size of the following icons:
meta-true, meta-false and meta-robot.

Deprecated: Custom icon "meta-true" seems to use a 16x16 viewbox which has been deprecated.
In an upcoming version, Kirby will only support custom icons with a 24x24 viewbox by default.
If you want to continue using icons with a different viewport, please wrap them in an <svg> element with the corresponding viewBox attribute.

Overwrite page titel via model

Hey,
really great plugin!

Is it possible to overwrite the page's <title> via its model? If I read the docs correctly, I can only add additional metadata but not overwrite anything, is that correct?

"change frequency" help text incorrect

hey @fabianmichael 🐣
first of all thank you so much for this beautiful plugin!

i just started playing around with it and it looks like the "change frequency" help text in the site blueprint is not set-up correctly (see screenshot). looks like its the help text from "sitemap priority"? i know it's a very minor problem, but I wanted to make a quick note of it anyway.

🙏🏻 ✨

meta

Website issue related to GD library

Right after installing this module I noticed problem on pages I used it on.

At first load site crashed. Examining debug I noticed the following error:
"Required extension GD is not loaded."

Capture d’écran 2023-07-31 à 16 46 19

Context

kirby-meta : 0.4.0-beta (up to date at the time this issue was created)
Kirby 3.9.6
PHP : 8.1.18
Server: Apache

Share preview is cut off when there are many files in files section above

First of all: Thanks for your great plugins, @fabianmichael.

When there are many files in the files section above the share preview, it gets cut off because of "sticky" set on the column.
Quick solution could be to add pagination to files at maybe 10 - or an option to be able to set pagination in the config.

(Unfortunately I am not yet capable of adding the code and contributing a PR).
Bildschirmfoto 2022-02-27 um 09 53 47
.

Tab content not showing on `3.5`

We're stuck on 3.5 for various reasons. On 3.6 the tab content meta: tabs/meta/site is showing everything as expected but not on 3.5. It's blank. No console warning, no errors. What special 3.6. features in the blueprints are used, that are not compatible with 3.5?

Glancing over the code, I haven't seen anything.

Visually nice header indentation

Hey,
I was bothered by the randomly indented header tags produced by the plugin, they didn't look nice in the source code.
Here's a proposal for rendering it cleanly indented: main...Daandelange:kirby-meta:header-indentation
Note that the snippets code become a little less readable, but I didn't manage to do better with the original code style.
Also, the default indentation is two spaces ' ', level=2 (for <html> and <header>).

Before After
image image

Handle indexing status in page model method

This is currently handled by FabianMichael\Meta\Sitemap. It would be easier and more dynamic to have a dedicated page method, that can easily be overridden. This would also make it easier to avoid problems when generating the XML sitemap, since determination of indexing status could be unified with the robots meta tag.

Showing custom fields alongside meta tab

I've struggled quite a bit to add this plugin to my existing site.

Whenever I added custom fields, the "Metadata (SEO)" tab would disappear.

Neither the Kirby docs nor the plugin docs explain the tabs option very well (or I just missed it completely!). Regardless, I'm leaving this as a tip for others if they come across the same "issue".

The way to show other fields alongside the plugin's, you need to add another tab. E.g.,

# site/blueprints/site.yml
tabs:
  default:
    # Your columns / sections, etc
    columns:
      - width: 1/3
        sections:
         # ...
  meta: tabs/meta/site

# site/blueprints/pages/default.yml
tabs:
  default:
    fields:
      some_field:
        label: Some field
        type: text
  meta: tabs/meta/page

Thanks for the awesome work!

how to implement hooks?

Hello there,
sorry if this is not a real issue but more a kind ask for help. :)

I understand I can use hooks to prefill metadata with description already of my page but I'm not sure where to put the code you show on the readme.

I'm pretty new with kirby, thanks for your understanding. (I've tried a few ways by modifying config.php as it's said on kirby doc but nothing seems to happen).

cheers and thanks for this great plugin.

Plugin can only be installed using composer

Hello, I,ve installed kirby-meta on the "Starterkit" in plugin folder like described here on github. The panel-fields are shown in red with error, and the same error I get on an overlayscreen "Class "FabianMichael\Meta\PageMeta" not found".

Any help please.
Achim

Sitemap cache not working with getkirby/staticache plugin

CleanShot 2023-03-08 at 19 48 38

1.) key should not contain a dot since the staticache uses that instead of /
https://github.com/getkirby/staticache/blob/9ef2d7195b5c8212fcf53194407cc28aec0e3901/src/StatiCache.php#L144

2.) i think the data set should not be a string but an array.
https://github.com/getkirby/kirby/blob/9ecd11cd5b7d4875d4212f767a2b3ad3e52b3528/src/Cms/Page.php#L1030

BUT the staticache plugin expects a real page object (cache key => page id) so it will all fail anyway
https://github.com/getkirby/staticache/blob/9ef2d7195b5c8212fcf53194407cc28aec0e3901/src/StatiCache.php#L106

how to fix this? add a plugin cache and check for staticache plugin but match array for pages cache just to be safe

App::plugin('fabianmichael/meta', [
    'options' => [
       //...
        'cache' => true,
    ],
$routes[] = [
        'pattern' => 'sitemap.xml',
        'action' => function () use ($kirby) {
            if ($kirby->option('fabianmichael.meta.sitemap') === false && SiteMeta::robots('index') === false) {
                $this->next();
            }

            $sitemap = [];
            $cache = $kirby->cache(
+                option('cache.pages.type') !== 'static' ? 'pages' : 'fabianmichael.meta'
            );
            $cacheKey = 'sitemap.xml';

            if (option('debug') === true || ! ($sitemap = $cache->get($cacheKey))) {
                $sitemap = Sitemap::factory()->generate();
+              $cache->set($cacheKey, [
+                    'html' => $sitemap,
+               ]);
            }

            return new Response($sitemap, 'application/xml');
        },
    ];

Sitemap: Wrong XHTML namespace declaration? (Multilang Setup)

I am testing this plugin in a multilang setup and got a complaint from the Google Search Console about a wrong namespace declaration in the Sitemap.

I think the issue is the XHTML namespace declaration in line 34 of src/Sitemap.php:

Currently:

$root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xhtml', 'http://www.w3.org/1999/xlink');

Should be

$root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xhtml', 'http://www.w3.org/1999/xhtml');

After I corrected this, the map was accepted as correct.

Reference: developers.google.com/search/docs/specialty/international/localized-versions#sitemap.

Additional meta tags

Hello,
Do you have any plans on adding some extra meta tags ?
If so, would you like some help ?

Here's a list of some suggestions I could think of. Some could be optional (like Twitter), others on by default.

  1. Tags needing extra data fields :

    1. <meta content="Copyright 2012-2023 My Organisation" name="copyright">
      A content copyright indicator. Use a startyear, current year and owner name ? Or just a free field.
    2. <meta content="keyword1, keyword2" name="keywords" lang="en_GB">
      Keywords, similar to the meta description.
    3. <meta content="general" name="rating"> & <meta content="global" name="distribution">
      Content rating & distribution tags.
    4. <meta content="XXX" http-equiv="Last-Modified">
      Last modified date.
  2. Alternatives of existing data fields :

    1. <meta content="" name="owner"> & <meta content="" name="author">
      Site owner and content author as meta tags.
    2. og:image:secure_url
      Alternative og:image for HTTPS protocols.
    3. og:description
      OG content description (similar to the og:title).
    4. og:locale, og:locale:alternate
      Available translation indications.
    5. <link href="XXX" hreflang="en_GB" rel="alternate"> & <link href="XXX" hreflang="x-default" rel="alternate">
      Available translation indications + default language.
    6. <meta content="en_GB" http-equiv="content-language">
      Current locale indicator
    7. <meta content="Site Title" name="application-name"> & <meta content="XXX" name="apple-mobile-web-app-title">
      Some smartphone integration hints. Similar to the theme color for browsers.
    8. <link href="://url/" rel="start" title="Home Title"> & <link href="://url" rel="prev" title="PrevSiblingTitle"> & `
      Siblings navigation hints.
    9. <meta name="twitter:dnt" content="on">
      Twitter DNT protection for your visitors. more info.
  3. Improvements of existing tags :

    1. <meta content="image/png" property="og:image:type">
      Indicates the filetype of the OG image.
    2. <meta content="Index,Follow,notranslate" name="robots">
      Crawl settings in the meta tags.
    3. <meta content="no-cache" name="cache-control"> & <meta content="14 days" name="revisit-after">
      Sitemap priority & cache control settings as meta tags.
    4. <meta content="#000" media="(prefers-color-scheme: dark)" name="theme-color">
      Additionally indicate the light/dark setting for some browsers.
    5. <link href="http://xxxx/sitemap.xml" rel="sitemap" title="sitemap" type="application/xml">
      The sitemap linked in the meta tags.

Can't install via composer

I would love to use your plugin, unfortunately I can't install it via composer. See error message below:

Could not find a version of package fabianmichael/kirby-meta matching your minimum-stability (stable). Require it with an explicit version constraint allowing its desired stability.

Robots Visibility needs page reload

Hello,
I just ran into a tiny UI glitch : When changing the search engine indexing status of a page, the robots preview on the right needs a page reload to reflect the new value.

Unlisted pages: Meta-Robots always set to „noindex“

No matter what the page settings are, the HTML tag created is always:
<meta name="robots" content="noindex" />

This also seems to affect all children of unlisted pages.
I use unlisted for internal reasons, but the page is still public and should be found by robots.

Version: 0.4.0-beta
Kirby: 3.9.4

Page model function 'metadata' not working

Hey there,

this line will always return false even if such method exists, since custom page methods don't exist on the $page object. Problem is line 32:

// Get metadata from page, if possible
if (method_exists($this->page, 'metadata') === true) {  # << will always be false
    $this->metadata = $this->page->metadata($languageCode);
}

Because of this, $page->metadata is not populated, hence our check on line 86 never succeeds, rendering custom page method 'metadata' useless 😭 If a page method does not exist, Kirby assumes it's a Field with value null 😕

Solution:

hasMethod to the rescue:

// Get metadata from page, if possible
if ($this->page->hasMethod('metadata') === true) {  # << njom njom
    $this->metadata = $this->page->metadata($languageCode);
}

Voila! PR welcome, I guess? 🤣

Check all calls to helpers functions

Since Kirby’s helpers can be deactivated as of 3.7, the plugin should no longer rely on them to avoid conflicts in environments, where these are not available or do something completely different.

Kirby 4 compatibility?

More a question than an issue.
Currently testing Kirby 4 (release candidate 2) and the plugin is working fine.
The only thing that's not working is in the control panel, if you try to access the settings window for the plugin the following error shows:

FabianMichael\Meta\PageMeta::get(): Return value must be of type Kirby\Cms\Field, Kirby\Content\Field returned

Just wanted to report, thanks for putting out such a quality plugin.

Install error

Hey.
Got an error when tring to install via composer your plugin:
Could not find a version of package fabianmichael/kirby-meta matching your minimum-stability (stable). Require it with an explicit version constraint allowing its desired stability.

It sayes in PackageDiscoveryTrait.php line 331

Using kirby 3.9.3
PHP 8.0.28

Can you reproduce that?
Do I need any other dependencies?

Make Twitter-related features opt-in

Twitter did not particularly well over the last months and has lost a lost of its popularity. In future versions, Twitter-related fields and tags will become an opt-in feature for people who are still actively using the platform. This helps to keep the admin panel clean.

Abbility to format title and meta description with smartypants

Kirby has the ability to format markdown text typographically correctly with smartypants (Kirby Doku). These include correct spacing, convertion from -- to etc.

It should be possible to format Meta-Descriptions and Title via the smartypants configuration. It should automatically added when the Kirby option is set or could be overwritten via a own plugin option.

Not that text that is formatted via smartypants should run through html_entity_decode() so that the html_entities are not printed.

Priority can not be erased

Once saved, the sitemap priority setting cannot be reset/erased so that it reverts to the default value, it has to keep a forced value. Of course we can manually set it to 0.5 as the default, but I like the "greyed-out-default-value" GUI that you made and this breaks it.

It's is a native limitation of the range field in Kirby, which I requested and upgrade for on nolt.

I've locally implemented a very basic extended range field (named threshold), if you wish I'm motivated in adding/contributing it into this addon by adapting it a little. (see screenshots on the link)

Hide parent page in sitemap but display children

I wonder if it is possible to hide a parent page in the sitemap but to list its children.

Either unlisting the parent page and adding to config:

    "fabianmichael.meta.sitemap.pages.includeUnlisted" => [
        "parent/*"
    ],
    --> parent is included

or listing the parent and hiding by template or page id with does not help.

    "fabianmichael.meta.sitemap.pages.exclude" => [
        "parent"
    ],
    --> parent and children are excluded

Installation Problem with Meta 0.2.0 using the "manual" way

Hello,

I tried to install the Kirby Meta Plugin using the manual way by dropping the plugin in the "plugins" folder.
Unfortunately there is an error while calling the Panel Site. It seems like there is another Issue with the same problem (13). This issue is already closed.

My version I'm using is Meta 0.2.0. My Systemdata are the following:

The error is the same like in issue 13 but with my "newer" release.
There was an Release appended to the solution (0.1.2) this package works fine for manual installation. So it seems that I make no mistakes here :).
I tried to solve the problem but I've started today with Kirby and can't see through all the stuff yet :)

This is the error I get:

Kirby_Panel_error

Unlike in the other issue it seems that I am not able to visit the panel site at all, if I use the current version.

There are no Log Files mentioning this error (Apache or Kirby (DebugMode = true))
System Information:
Kirby Version: Starter-Kit 3.8.2
PHP: 8.1.13
Server: Apache

Excluding a page from the sitemap also excludes its children

Hello @fabianmichael, not sure if this is intended or not.

If you are trying to exclude a template/s or a page/s from sitemap in config it also excludes its children by default.

Now in my use case, I have a page template and that page acts as a redirect to it's first children. And I need to exclude the parent template to solve some google console issues.

To do so I've manually removed the following from isPageIndexible function:

if (! is_null($page->parent())) {
    // test indexability of parent pages as well
    return static::isPageIndexible($page->parent());
}

Add hint to panel about crawling status

The panel should give user a hint on whether a page is crawlable or not. This would be especially helpful, since other plugins, page status or include/exclude lists can override the selected options in the metadata tab, resulting in a rather intransparent situation for the user.

exclude pages from metadata overview

dear @fabianmichael,
i would like to exclude all unlisted pages from the metadata overview. the one thats directly accessible through the hamburger menu in the panel. is there some kind of setting for this? if not, do you have a suggestion on where to add this? would also be super cool if it was possible to exclude custom pages with an array like for the sitemap config.

thank you so much for your help.
such a great plugin!
🤍 ✨

Add information on (file) blueprint overrides

Hey there,

as always: great plugin, I like it very much so far! One thing bothers me though: it's kind of hard to determine how to override blueprints that deal with files - this is interesting to me since I'm using custom upload folders, using query, parent and upload keys in my files fields / sections. How would I override the plugin's image fields (logo, og-image etc) and section (= file upload)? Looking at the (PHP) blueprints, I guess this isn't exactly straight-forward 😅

Thanks for considering this!

Sitemap with route

Thanks for the great plugin!
On my website I have all projects inside a projects folder to have them organzied, but with a custom route they are available as If they were direct children of site (my-site.de/projects/test will be used as my-site.de/test). What would be the best way to reflect these short paths in the sitemap?

custom title separators

dear @fabianmichael,
still love your plugin so much. using it with every project.

this is not a bug but more of a feature request / question.. is it somehow possible to add custom title separators and extend the existing select field? would be super cool to have an option for the config, where you could add custom separator strings in an array.

thank you so much for your continuous hard work on this plugin!
best wishes,
jaro
🌻

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.