<commit_before># Silverstripe SEO
A Silverstripe module to optimise the Meta, crawling, indexing, and sharing of your website content

Author: [<NAME>](https://github.com/Andrew-Mc-Cormack)

## Installation

Add the following to your composer.json file

```json
{  
    "require": {  
        "Andrew-Mc-Cormack/Silverstripe-SEO": "dev-master"
    },  
    "repositories": [  
        {  
            "type": "vcs",  
            "url": "https://github.com/Andrew-Mc-Cormack/Silverstripe-SEO"  
        }  
    ]  
}
```

After you composer update / install the module the extra meta fields will be available in the CMS within a page under the SEO tab.

Next add the SEO::init() function to your Page Controller init function.
And also add the MetaTags method to the Page Controller.

```php
class Page_Controller extends ContentController {

    public function init()
    {
        parent::init();

        SEO::init();
    }

    public function MetaTags()
    {
        return SEO::HeadTags();
    }
}
```

This will complete the setup of the SEO module and make the module functionality available throughout your site.

## Features

### CMS features
  - SERP Preview
  - Meta Title, Description, Canonical, Robots, Open Graph, Twitter fields
  - Page social sharing image
  - Sitemap priority and change frequency fields
  - Extra Meta Grid Field (Create link, property, or Meta head tags)
  - Dynamic placeholder meta

## Usage

### Setting the current page Meta

By default the page Meta will be generated off the current Page object. If you wish to have an object as a Page and render out its Meta attach the SEO extension to it.

In your config.yml file add an entry for an object you wish to have as a page.

```yml
MyObject:
  extensions:
    - SEOExtension
```

Within the current controller get your object and pass it into the setPage function;

```php
$page = MyObject::get()->First();

SEO::setPage($page);
```<commit_msg>update read<commit_after># Silverstripe SEO
A Silverstripe module to optimise the Meta, crawling, indexing, and sharing of your website content

Author: [<NAME>](https://github.com/Andrew-Mc-Cormack)

## Installation

Add the following to your composer.json file

```json
{  
    "require": {  
        "Andrew-Mc-Cormack/Silverstripe-SEO": "dev-master"
    },  
    "repositories": [  
        {  
            "type": "vcs",  
            "url": "https://github.com/Andrew-Mc-Cormack/Silverstripe-SEO"  
        }  
    ]  
}
```

After you composer update / install the module the extra meta fields will be available in the CMS within a page under the SEO tab.

Next add the SEO::init() function to your Page Controller init function.
And also add the MetaTags method to the Page Controller.

```php
class Page_Controller extends ContentController {

    public function init()
    {
        parent::init();

        SEO::init();
    }

    public function MetaTags()
    {
        return SEO::HeadTags();
    }
}
```

This will complete the setup of the SEO module and make the module functionality available throughout your site.

## Features

### CMS features
  - SERP Preview
  - Meta Title, Description, Canonical, Robots, Open Graph, Twitter fields
  - Page social sharing image
  - Sitemap priority and change frequency fields
  - Extra Meta Grid Field (Create link, property, or Meta head tags)
  - Dynamic placeholder meta

## Usage

### Setting the current page Meta

By default the page Meta will be generated off the current Page object. If you wish to have an object as a Page and render out its Meta attach the SEO extension to it.

In your config.yml file add an entry for an object you wish to have as a page. To add the SEO extension to every page add a Page entry.

```yml
Page:
  extensions:
    - SEOExtension
```

Within the current controller get your object and pass it into the setPage function;

```php
$page = MyObject::get()->First();

SEO::setPage($page);
```
{'fraction_non_alphanumeric': 0.09039979628214923, 'fraction_numerical': 0.0, 'mean_word_length': 3.1217208814270725, 'pattern_counts': {'":': 10, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6451725', 'n_tokens_mistral': 1128, 'n_tokens_neox': 1075, 'n_words': 477}