2017 © Pedro Peláez
 

library meta

A collection of classes to generate module meta information for the MonkCMS API

image

monkcms/meta

A collection of classes to generate module meta information for the MonkCMS API

  • Thursday, April 26, 2018
  • by skylerkatz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 17 % Grown

The README.md

MonkCMS-Meta

Latest Stable Version Codecov StyleCI, (*1)

A collection of classes to generate module meta information for the MonkCMS API, (*2)

Overview

Install

  • [ ] Download the site you are working on to your local environment
  • [ ] If composer is not installed on your machine globall install it by following the directions here Composer - https://getcomposer.org/download
  • [ ] In your terminal go to the directoy where the site was downloaded
  • [ ] If there is not a composer.json file in the directory follow the indented steps below. If the file exists, head to the next step
    • [ ] Run composer init and select the defaults for all of the main questions. You can select N for defining dependencies and dev dependencies
  • [ ] After a composer.json file exists, run the following in the terminal composer require monkcms/meta
  • [ ] You will then upload the newly created vendor directory as well as the composer.json and composer.lock files.
  • [ ] Follow the How to use section below to implement it on the templates of your choosing.

How to use

Within a template you would initialize the class for the module you are working with. In this example we will assume the pages module., (*3)

//Load these in a config.php file
require_once($_SERVER['DOCUMENT_ROOT'] . '/monkcms.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/vendor/autoload.php');
$currentUrl = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

//This would go in the page template after config.php is included
$meta = new \Meta\Module\PageMeta(
    $_GET['nav'],
    getSiteName(),
    'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']
);

Then, in head.php (or anywhere you wish) you can do the following, (*4)

<title><?= $meta->title() ?></title>
<?= $meta->createMetaTag('description', $meta->description()) ?>
<?= $meta->createMetaTag('keywords', $meta->keywords()) ?>
<?= $meta->socialTags() ?>

The following would be generated, (*5)

<title>Example Page Title | Test Site Name</title>
<meta name="description" content="Example Page Description" >
<meta name="keywords" content="Example, Page, Keywords" >
<meta property="og:site_name" content="Test Site Name" >
<meta property="og:type" content="article" >
<meta property="og:title" content="Example Page Title | Test Site Name" >
<meta property="og:url" content="http://example.com" >
<meta property="og:image" content="http://www.placecage.com/1200/630" >
<meta property="og:image:width" content="1200" >
<meta property="og:image:height" content="630" >
<meta name="twitter:card" content="summary_large_image" >

Included modules

  • Pages
  • Sermons
  • Articles
  • Blogs
  • Events

Further documentation can be found by looking at the tests., (*6)

Contributing

Thank you for considering contributing to the the MonkCMS Meta Package! Please open an issue or a PR with your request! For any new functionality, be sure to write a test., (*7)

Security Vulnerabilities

If you discover a security vulnerability within this package, please send an e-mail to Skyler Katz at skylerkatz@hey.com. All security vulnerabilities will be promptly addressed., (*8)

License

This package is open-sourced software licensed under the MIT license., (*9)

The Versions

26/04 2018

dev-master

9999999-dev http://liftoff.ekklesia360.com

A collection of classes to generate module meta information for the MonkCMS API

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

cms monk monkdev monkcms ekklesia ekklesia360

05/09 2017

v0.1.0

0.1.0.0 http://liftoff.ekklesia360.com

A collection of classes to generate module meta information for the MonkCMS API

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

cms monk monkdev monkcms ekklesia ekklesia360