https://github.com/jonathandey/oc-jd-seo
Very simple SEO plugin for OctoberCMS
https://github.com/jonathandey/oc-jd-seo
meta octobercms octobercms-plugin php seo
Last synced: about 1 year ago
JSON representation
Very simple SEO plugin for OctoberCMS
- Host: GitHub
- URL: https://github.com/jonathandey/oc-jd-seo
- Owner: jonathandey
- License: mit
- Created: 2017-06-06T10:45:15.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-04-12T20:43:40.000Z (over 7 years ago)
- Last Synced: 2025-04-06T03:06:23.402Z (over 1 year ago)
- Topics: meta, octobercms, octobercms-plugin, php, seo
- Language: PHP
- Size: 6.84 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Super Simple SEO for OctoberCMS
#### How to use
##### Installation
1. Install the plugin to your plugins folder under `plugins/jd/seo`
2. In the `head` tag of your website insert the component `{% component 'seoTags' %}`
##### Controlling the output
There are 1 of 2 ways you can control the output of each tag.
1. By using the default CMS Page meta title or description field
2. Programatically defining the tags in your own plugin or CMS page
##### Programmatically controlling the SEO tags
Programmatically controlling your output will override a pages meta title and description fields.
use JD\SEO\SEO;
...
public function onRun()
{
SEO::meta()->title($title)
->description($description)
// Google / Schema.org tags
->schema([
'name' => $title,
'description' => $description,
'image' => $image,
])
// Twitter tags
->twitter([
'title' => $title,
'description' => $description,
'image' => $image,
'url' => 'https://my-awesome-site.com',
])
// OpenGraph tags
->og([
'site_name' => 'My Awesome site',
'url' => 'https://my-awesome-site.com',
'title' => $title,
'description' => $description,
'image' => $image,
])
->keywords(['awesome', 'page'])
;
}
This will output...
My awesome page