Catalyst::Plugin::SocialMeta - Generate social media meta tags for your catalyst application.
Version 0.03
Quick summary of what the module does.
Perhaps a little code snippet.
... MyApp.pm ... package MyApp; use Moose; use namespace::autoclean; use Catalyst::Runtime 5.80; use Catalyst qw/ SocialMeta /; extends 'Catalyst'; our $VERSION = '0.01'; __PACKAGE__->config( name => 'MyApp', 'Plugin::SocialMeta' => { meta_provider => 'all', card_type => 'featured_image', site => 'Lnation.org', site_name => 'Lnation', title => 'Social Meta Tag Generator', description => 'Demo UI for HTML::SocialMeta', image => 'https://lnation.org/static/images/social.png', fb_app_id => 'lnationorgnofb', url => 'https://lnation.org/socialmeta/demo' } ); # Start the application __PACKAGE__->setup(); .... Controller ... package MyApp::Controller::Foo; use Moose; use namespace::autoclean; BEGIN { extends 'Catalyst::Controller'; } sub foo :Chained('/') :PathPart('foo') :Args(0) { my ($self, $c) = @_; ... # uses default social meta tags from config } sub base :Chained('/') :PathPart('') :CaptureArgs(0) { my ($self, $c) = @_; $c->socialmeta( title => 'Changed Title', description => 'Demo UI for Changed::Title', ); } sub bar :Chained('base') :PathPart('bar') :Args(0) { my ($self, $c) = @_; ... # social meta tags from the config + the keys set in the base action }
` ... wrapper.tt ...
<html> <head> [% socialmeta %] </head> <body> ... </body> </html>
Set the social meta tags for the current action, you can pass the following keys, see HTML::SocialMeta for more information.
The meta provider you would like to generate the social meta tags for, this defaults to 'all'. twitter and opengraph are the other valid options.
The type of social meta card see HTML::SocialMeta documention for options.
OPTIONAL - if you always want the same card type you can set it
The Twitter @username the card should be attributed to. Required for Twitter Card analytics.
This is Used by Facebook, you can just set it as your organisations name.
The title of your content as it should appear in the card
A description of the content in a maximum of 200 characters
A URL to a unique image representing the content of the page
OPTIONAL - A text description of the image, for use by vision-impaired users
Required for OpenGraph. Allows you to specify an alternative url link you want the reader to be redirected
HTTPS URL to iframe player. This must be a HTTPS URL which does not generate active mixed content warnings in a web browser
Width of IFRAME specified in twitter:player in pixels
Height of IFRAME specified in twitter:player in pixels
IOS or Android
UK/US ect
The applications name
String value, and should be the numeric representation of your app ID in the App Store (.i.e. 307234931)
Application store url - direct link to App store page
This field is required to use social meta with facebook, you must register your website/app/company with facebook. They will then provide you with a unique app_id.
LNATION, <email at lnation.org>
<email at lnation.org>
Please report any bugs or feature requests to bug-catalyst-plugin-socialmeta at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Catalyst-Plugin-SocialMeta. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-catalyst-plugin-socialmeta at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Catalyst::Plugin::SocialMeta
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=Catalyst-Plugin-SocialMeta
CPAN Ratings
https://cpanratings.perl.org/d/Catalyst-Plugin-SocialMeta
Search CPAN
https://metacpan.org/release/Catalyst-Plugin-SocialMeta
This software is Copyright (c) 2022 by LNATION.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Catalyst::Plugin::SocialMeta, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Plugin::SocialMeta
CPAN shell
perl -MCPAN -e shell install Catalyst::Plugin::SocialMeta
For more information on module installation, please visit the detailed CPAN module installation guide.