Giter Site home page Giter Site logo

perlkonig / grav-plugin-webmention Goto Github PK

View Code? Open in Web Editor NEW
10.0 4.0 6.0 91 KB

Implements the Webmention protocol (with the Vouch extension) for the Grav CMS

License: MIT License

PHP 99.74% Twig 0.26%
grav grav-cms gpm plugin webmention vouch-extension microformat grav-cli

grav-plugin-webmention's Issues

Wrong /route when developing locally 404 from endpoint

Hello. Me again, still trying to make this work so I can actually then work on displaying webmentions I receive.

I'm trying to develop locally, and there's a problem with the /route to the webmention endpoint.

The target specified in the source is <link href="http://localhost:8888/mentions" rel="webmention" />

I think it ought to be <link href="http://localhost:8888/grav-admin/mentions" rel="webmention" />

This may be something to do with the various flavours of Grav base URL. I'm checking further.

Data display

I'm returning to this, to try and get webmentions to display. My big problem is how to get access to data_recieved.yaml in a twig partial.

I'm sure I'm just being silly, but I cannot for the life of me see how to get the contents of the file into and array that I can then step through to see whether there are webmentions to display.

Any hints very gratefully received. Thanks.

Plugin breaks RSS and Atom feeds

The placement of the webmention endpoint seems to break the Atom and RSS feeds. With the plugin active, those pages show

<link href="http://localhost:8888/mentions" rel="webmention" /><?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Jeremy Cherfas: Posts</title>

And as a result (some?) feedreaders cannot access the feed. If the rel="webmention" line is not there (with the plugin disabled, all is well.

Looking at webmention php this (line 181) seems to be the place where the link is added

        $base = $this->grav['uri']->base();
        $rcvr_route = $config->get('plugins.webmention.receiver.route');
        $rcvr_url = $base.$rcvr_route;
        $tag = '<link href="'.$rcvr_url.'" rel="webmention" />'; 

        // inject before closing </head> tag
        $output = $this->grav->output;
        $output = substr_replace($output, $tag, strpos($output, '</head>'), 0); //inserts before closing HEAD tag

        // replace output
        $this->grav->output = $output;

I think the problem could be avoided by testing whether the page URI contains either "atom" or "RSS" but I can't seem to figure out how to get that.

OK, I think it available in page.route but no time to test now. More later.

Notify giving me trouble

I installed the plugin on my site and ran notify and verify.

Verify had nothing to do, because I had not received any webmentions.

Notify sent out a bunch of links, but none of those was able to receive webmentions.

Then I created a post at another site of mine which I hoped would send a web mention to my Grav site.

I also created a post on my Grav site linking to that post, hoping to have a web mention to send.

I ran notify and verify again, and both of them reported nothing to send and nothing to receive.

So I'm stumped. I need at least something in receiver.file_data to begin to start figuring out a template partial to display.

Would it matter that the site sending the web mention to the Grav site is in a subdomain of that site?

Parser update

The mf2 parser has been updated since you copied it. You should merge the changes into your repo, I think.

Does not work with 1.6.26

Headers are missing and cli commands are throwing errors:

$ bin/plugin webmention notify
PHP Fatal error:  Uncaught Error: Call to undefined method Grav\Plugin\Console\NotifyCommand::getgrav() in /var/customers/webs/kromonos/example.com/user/plugins/webmention/cli/NotifyCommand.php:68
Stack trace:
#0 /var/customers/webs/kromonos/example.com/system/src/Grav/Console/ConsoleCommand.php(41): Grav\Plugin\Console\NotifyCommand->serve()
#1 /var/customers/webs/kromonos/example.com/vendor/symfony/console/Command/Command.php(255): Grav\Console\ConsoleCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/customers/webs/kromonos/example.com/vendor/symfony/console/Application.php(917): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/customers/webs/kromonos/example.com/vendor/symfony/console/Application.php(269): Symfony\Component\Console\Application->doRunCommand(Object(Grav\Plugin\Console\NotifyCommand), Object(Symfony\Component\Con in /var/customers/webs/kromonos/example.com/user/plugins/webmention/cli/NotifyCommand.php on line 68

Looks like data_sent.yaml is filled as normal

Notify hanging

When I run bin/plugin webmention notify in Terminal, it just hangs at the end. As it happens, the final target is returning HTTP/1.1 400 Bad Request but that shouldn't stop the processing, should it?

Should the webmention endpoint give a 404?

Other sites that implement webmention seem to have a visible webmention page, rather than a 404, like this.

I suppose Grav would have to have a target page for that. Would it affect the workings of the plug-in?

Unused config parameters

Both the yaml and readme refer to

url_name_map

and

file_url_name_map

(README line 84)

but I can't find anything elsewhere in the plugin code that uses those.

Am I missing something or are these deprecated and/or replaced within the sender/receiver parts?

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.