perlkonig / grav-plugin-webmention Goto Github PK
View Code? Open in Web Editor NEWImplements the Webmention protocol (with the Vouch extension) for the Grav CMS
License: MIT License
Implements the Webmention protocol (with the Vouch extension) for the Grav CMS
License: MIT License
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.
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.
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.
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?
The mf2 parser has been updated since you copied it. You should merge the changes into your repo, I think.
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
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?
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?
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.