hannesmannerheim / qvitter

mirror. moved to https://git.gnu.io/h2p/Qvitter, send merge requests and issues there
https://git.gnu.io/h2p/Qvitter
GNU Affero General Public License v3.0
86 stars 26 forks source link

Show notice content to search engines and scrapers #295

Closed singpolyma closed 8 years ago

singpolyma commented 8 years ago

This is needed for pingback and webmention to work properly and should improve search engine results, etc.

Re-use the mainline notice show code to get all the microformats goodness, etc.

hannesmannerheim commented 8 years ago

i don't want to add stuff to the feed-body element. instead i created an event in https://github.com/hannesmannerheim/qvitter/commit/885ca8b80125362f8233d6af480e61e4184a5851 that you can use to insert html from your plugin.

e.g.:

    function onQvitterHiddenHtml($action) {
        if($action->arg('notice')) {
            echo '<ol class="notices xoxo">';
            $notice = Notice::getKV('id', $action->arg('notice'));
            if($notice instanceof Notice) {
                $widget = new NoticeListItem($notice, $action);
                $widget->show();
                $action->flush();
            }
            echo '</ol>';
        }
    }
singpolyma commented 8 years ago

This particular change isn't for any one plugin, but to enable scraping/microformats/search engines generally. Could this markup be added to the hidden html event as a default?

hannesmannerheim commented 8 years ago

hm, i don't feel this is a solution i want to build upon. in the future i might make a proper effort to make qvitter output all html directly, but that's a much bigger issue. if qvitter is going to support microformats, it should be in a proper way, with metadata tied to the visible elements.

singpolyma commented 8 years ago

I agree that doing the markup directly would be better, but that's a much longer-term change. I can add the snippet you suggest to a plugin or something, it just seems like the content being present in the shownotice page is applicable generally (even if no additional plugins are enabled) and not too much of a code burden. It certainly is necessary for pingback/webmention to work at all, but is useful in many other cases.

singpolyma commented 8 years ago

Since this is pretty Qvitter-specific, maybe I should produce a plugin, like "searchable qvitter" or something that just adds minimal bits of markup like this? The only problem with maintaining it outside qvitter is that slows adoption by qvitter-using sites.

hannesmannerheim commented 8 years ago

okay okay i'll add it to qvitter...... but i don't like it! :)

singpolyma commented 8 years ago

Sorry for being such a nag. And thank you :)