1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-08 06:06:45 +02:00

Flextype 0.4.3

This commit is contained in:
Awilum
2018-05-28 11:33:48 +03:00
parent 3e514cad62
commit 6a473ecc92
38 changed files with 0 additions and 734 deletions

View File

@@ -1,5 +0,0 @@
# v1.1.0, 2018-05-08
* Updates for Flextype 0.3.0
# v1.0.0, 2018-03-26
* Initial release

View File

@@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2018 Flextype
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,27 +0,0 @@
# Sitemap Plugin for [Flextype](http://flextype.org/)
![version](https://img.shields.io/badge/version-1.1.0-brightgreen.svg?style=flat-square "Version")
![Flextype](https://img.shields.io/badge/Flextype-0.x-green.svg?style=flat-square "Flextype Version")
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/flextype-plugins/tiny-url/blob/master/LICENSE.txt)
Sitemap plugin provide automatically generated XML sitemap for Flextype.
## Installation
1. Unzip plugin to the folder `/site/plugins/`
2. Go to `/site/config/site.yaml` and add plugin name to plugins section.
3. Save your changes.
Example:
```
...
plugins:
- sitemap
```
## Settings
```yaml
enabled: true # or `false` to disable the plugin
```
## License
See [LICENSE](https://github.com/flextype-plugins/sitemap/blob/master/LICENSE)

View File

@@ -1,40 +0,0 @@
<?php
/**
*
* Flextype Sitemap Plugin
*
* @author Romanenko Sergey / Awilum <awilum@yandex.ru>
* @link http://flextype.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flextype;
use Flextype\Component\{Event\Event, Http\Http, Arr\Arr, Registry\Registry};
$segments = Http::getUriSegments();
//$uri_string = str_replace("/rss", "", Http::getUriString());
$rss_uri = array_pop($segments);
//$page_uri = array_pop($segments);
if ($rss_uri == 'rss') {
Event::addListener('onShortcodesInitialized', function () {
Http::setResponseStatus(200);
Http::setRequestHeaders('Content-Type: text/xml; charset=utf-8');
$_pages = Content::getPages(str_replace("/rss", "", Http::getUriString()), false, 'date');
foreach ($_pages as $page) {
if ($page['slug'] !== '404') {
$pages[] = $page;
}
}
Themes::view('feed/views/templates/rss')->display();
Http::requestShutdown();
});
}

View File

@@ -1,13 +0,0 @@
name: Sitemap
version: 1.0.0
description: "Provide automatically generated XML sitemap."
author:
name: Sergey Romanenko
email: awilum@yandex.ru
url: http://flextype.org
homepage: https://github.com/flextype-plugins/sitemap
bugs: https://github.com/flextype-plugins/sitemap/issues
license: MIT
# Plugin settings
enabled: true

View File

@@ -1,2 +0,0 @@
sitemap: "Sitemap"
sitemap_description: "Sitemap plugin provide automatically generated XML sitemap for Flextype."

View File

@@ -1,2 +0,0 @@
sitemap: "Sitemap"
sitemap_description: "Sitemap plugin provide automatically generated XML sitemap for Flextype."

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
</rss>

View File

@@ -1,2 +0,0 @@
# v1.0.0, 2018-05-25
* Initial release

View File

@@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2018 Flextype
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,89 +0,0 @@
# Imgholder Plugin for [Flextype](http://flextype.org/)
![version](https://img.shields.io/badge/version-1.0.0-brightgreen.svg?style=flat-square "Version")
![Flextype](https://img.shields.io/badge/Flextype-0.x-green.svg?style=flat-square "Flextype Version")
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/flextype-plugins/imgholder/blob/master/LICENSE.txt)
Imgholder plugin to create placeholder images for Flextype
## Installation
1. Unzip plugin to the folder `/site/plugins/`
2. Go to `/site/config/site.yaml` and add plugin name to plugins section.
3. Save your changes.
Example:
```
plugins:
- imgholder
```
## Usage in page content
Simple usage
```
![Image]([imgholder])
```
Set width and height
```
![Image]([imgholder width=200 height=200])
```
Set text color
```
![Image]([imgholder width=200 height=200 text_color=white])
```
Set background color
```
![Image]([imgholder width=200 height=200 text_color=white bg_color=black])
```
Set text
```
![Image]([imgholder width=200 height=200 text_color=white bg_color=black text_color=white text='Pixel'])
```
Set font name
```
![Image]([imgholder width=200 height=200 text_color=white bg_color=black text_color=white text='Pixel' font_name=roboto])
```
Set font size
```
![Image]([imgholder width=200 height=200 text_color=white bg_color=black text_color=white text='Pixel' font_name=roboto font_size=12])
```
Set image extension
```
![Image]([imgholder width=200 height=200 text_color=white bg_color=black text_color=white text='Pixel' font_name=roboto font_size=12 ext="png"])
```
## Usage in template
```
<img src="<?php echo imgholder(['width' => 200, 'height' => 200, 'text_color' => 'white', 'bg_color' => 'black' 'text_color' => 'white', 'text' => 'Imgholder', 'font_name' => 'roboto', 'font_size' => 12, ext => 'png']); ?>" alt="">
```
## Options
| name | value | description |
|---|---|---|
| enabled | true | or `false` to disable the plugin |
| width | 300 | Image width |
| height | 200 | Image height |
| text_color | white | Image text color |
| bg_color | white | Image bg color |
| text | Imgholder | Image text |
| font_name | Imgholder | Image font name (roboto, arial, bebas, bitter, corki, debby, fashon fetish, gtw, kelson, matias, ptsans, ptsans italic, ptserif, robotoslab, tahoma) |
| font_size | 12 | Image font size |
| ext | png | Image extension |
## License
See [LICENSE](https://github.com/flextype-plugins/imgholder/blob/master/LICENSE)

View File

@@ -1,57 +0,0 @@
<?php
/**
*
* Flextype Imgholder Plugin
*
* @author Romanenko Sergey / Awilum <awilum@yandex.ru>
* @link http://flextype.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flextype;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
use Flextype\Component\{Event\Event, Registry\Registry};
//
// Shortcode: [imgholder text="test"]
//
Event::addListener('onShortcodesInitialized', function () {
Content::shortcode()->addHandler('imgholder', function(ShortcodeInterface $s) {
return imgholder($s->getParameter('text'),
$s->getParameter('width'),
$s->getParameter('height'),
$s->getParameter('bg_color'),
$s->getParameter('text_color'),
$s->getParameter('ext'),
$s->getParameter('font_name'),
$s->getParameter('font_size')
);
});
});
/**
* Return Pixel Image
*
* @param string $text Image text
* @param int $width Image width
* @param int $height Image height
* @param string $category Image category
* @param bool $gray Image category
* @return string
*/
function imgholder(string $text = null, int $width = null, int $height = null, string $bg_color = null, string $text_color = null, string $ext = null, string $font_name = null, string $font_size = null) : string
{
(isset($width)) and $width = $width.'x' or $width = Registry::get('plugins.imgholder.width').'x';
(isset($height)) and $height = $height.'/' or $height = Registry::get('plugins.imgholder.height').'/';
(isset($bg_color)) and $bg_color = $bg_color.'/' or $bg_color = Registry::get('plugins.imgholder.bg_color').'/';
(isset($text_color)) and $text_color = $text_color or $text_color = Registry::get('plugins.imgholder.text_color');
(isset($ext)) and $ext = '.'.$ext or $ext = '.'.Registry::get('plugins.imgholder.ext');
(isset($text)) and $text = '&text='.$text or $text = '&text='.Registry::get('plugins.imgholder.text');
(isset($font_name)) and $font_name = '&font='.$font_name or $font_name = '&font='.Registry::get('plugins.imgholder.font_name');
(isset($font_size)) and $font_size = '&fz='.$font_size or $font_size = '&fz='.Registry::get('plugins.imgholder.font_size');
return rtrim('https://imgholder.ru/'.$width.$height.$bg_color.$text_color.$ext.$text.$font_name.$font_size, '/\\');
}

View File

@@ -1,21 +0,0 @@
name: Imgholder
version: 1.0.0
description: "Imgholder plugin to create placeholder images for Flextype"
author:
name: Sergey Romanenko
email: awilum@yandex.ru
url: http://flextype.org
homepage: https://github.com/flextype-plugins/imgholder
bugs: https://github.com/flextype-plugins/imgholder/issues
license: MIT
# Plugin settings
enabled: true
width: 400
height: 200
text: 'Imgholder'
bg_color: black
text_color: white
ext: png
font_name: roboto
font_size: 50

View File

@@ -1,2 +0,0 @@
imgholder: "Imgholder"
imgholder_description: "Imgholder plugin to create placeholder images for Flextype"

View File

@@ -1,2 +0,0 @@
imgholder: "Imgholder"
imgholder_description: "Imgholder plugin to create placeholder images for Flextype"

View File

@@ -1,2 +0,0 @@
# v1.0.0, 2018-05-24
* Initial release

View File

@@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2018 Flextype
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,32 +0,0 @@
# Maintenance Plugin for [Flextype](http://flextype.org/)
![version](https://img.shields.io/badge/version-1.0.0-brightgreen.svg?style=flat-square "Version")
![Flextype](https://img.shields.io/badge/Flextype-0.x-green.svg?style=flat-square "Flextype Version")
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/flextype-plugins/maintenance/blob/master/LICENSE.txt)
Maintenance plugin allow you to close the website for maintenance.
## Installation
1. Unzip plugin to the folder `/site/plugins/`
2. Go to `/site/config/site.yaml` and add plugin name to plugins section.
3. Save your changes.
Example:
```
...
plugins:
- maintenance
```
## Settings
```yaml
enabled: true # or `false` to disable the plugin
activated: true # or `false` to deactivate the maintenance mode
msg_title: "" # Title
msg_description: "" # Description
bg_img: "" # Background image
```
## License
See [LICENSE](https://github.com/flextype-plugins/maintenance/blob/master/LICENSE)

View File

@@ -1,2 +0,0 @@
maintenance: "Maintenance"
maintenance_description: "Maintenance plugin allow you to close the website for maintenance."

View File

@@ -1,2 +0,0 @@
maintenance: "Maintenance"
maintenance_description: "Maintenance plugin allow you to close the website for maintenance."

View File

@@ -1,25 +0,0 @@
<?php
/**
*
* Flextype Maintenance Plugin
*
* @author Romanenko Sergey / Awilum <awilum@yandex.ru>
* @link http://flextype.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flextype;
use Flextype\Component\{Event\Event, Http\Http, Registry\Registry};
if (Registry::get('plugins.maintenance.activated')) {
Event::addListener('onPageBeforeRender', function () {
Http::setResponseStatus(503);
Http::setRequestHeaders('Content-Type: text/html; charset=utf-8');
Themes::view('maintenance/views/templates/maintenance')->display();
Http::requestShutdown();
});
}

View File

@@ -1,17 +0,0 @@
name: Maintenance
version: 1.0.0
description: "Maintenance plugin allow you to close the website for maintenance."
author:
name: Sergey Romanenko
email: awilum@yandex.ru
url: http://flextype.org
homepage: https://github.com/flextype-plugins/maintenance
bugs: https://github.com/flextype-plugins/maintenance/issues
license: MIT
# Plugin settings
enabled: true
activated: true
msg_title: "Maintenance mode is on"
msg_description: "Website will be available soon"
bg_img: "https://drscdn.500px.org/photo/224178849/m%3D900/v2?user_id=688458&webp=true&sig=eb8fb384b2a66f8febbaf8d5b57a1e14e652f8a70e879df14e1b3369974d3332"

View File

@@ -1,68 +0,0 @@
<?php
namespace Flextype;
use Flextype\Component\{Event\Event, Http\Http, Registry\Registry};
?>
<!doctype html>
<html lang="<?php echo Registry::get('site.locale'); ?>">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="<?php echo Registry::get('plugins.maintenance.msg_description'); ?>">
<meta name="author" content="">
<?php Event::dispatch('onThemeMeta'); ?>
<title><?php echo Registry::get('plugins.maintenance.msg_title'); ?> | <?php echo Registry::get('site.title'); ?></title>
<?php Event::dispatch('onThemeHeader'); ?>
<style>
body {
margin: 0;
}
html {
font-family: sans-serif;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
background: url(<?php echo Registry::get('plugins.maintenance.bg_img'); ?>) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.promo-block {
font-size: 42px;
text-shadow: 1px 1px 1px rgba(0,0,0,.4);
color: #fff;
display: block;
margin-top: 160px;
padding: 50px;
text-align: center;
}
h1 {
font-size: 66px;
padding: 0;
margin: 0;
}
p {
padding: 0;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="promo-block">
<h1><?php echo Registry::get('plugins.maintenance.msg_title'); ?></h1>
<p><?php echo Registry::get('plugins.maintenance.msg_description'); ?></p>
</div>
</body>
</html>

View File

@@ -1,2 +0,0 @@
# v1.0.0, 2018-05-24
* Initial release

View File

@@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2018 Flextype
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,67 +0,0 @@
# Pixel Plugin for [Flextype](http://flextype.org/)
![version](https://img.shields.io/badge/version-1.0.0-brightgreen.svg?style=flat-square "Version")
![Flextype](https://img.shields.io/badge/Flextype-0.x-green.svg?style=flat-square "Flextype Version")
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/flextype-plugins/pixel/blob/master/LICENSE.txt)
Pixel plugin to create placeholder images for Flextype
## Installation
1. Unzip plugin to the folder `/site/plugins/`
2. Go to `/site/config/site.yaml` and add plugin name to plugins section.
3. Save your changes.
Example:
```
plugins:
- pixel
```
## Usage in page content
Simple usage
```
![Image]([pixel])
```
Set width and height
```
![Image]([pixel width=200 height=200])
```
Set category name
```
![Image]([pixel width=200 height=200 category=city])
```
Set gray filter
```
![Image]([pixel width=200 height=200 category=city gray=true])
```
Set text
```
![Image]([pixel width=200 height=200 category=city gray=true text='Pixel'])
```
## Usage in template
```
<img src="<?php echo pixel(['width' => 200, 'height' => 200, 'category' => 'city', 'gray' => 'true', 'text' => "Pixel"]); ?>" alt="">
```
## Options
| name | value | description |
|---|---|---|
| enabled | true | or `false` to disable the plugin |
| width | 300 | Image width |
| height | 200 | Image height |
| category | sports | Image category (abstract, animals, business, cats, city, food, night, life, fashion, people, nature, sports, technics, transport) |
| text | '' | Image text |
## License
See [LICENSE](https://github.com/flextype-plugins/pixel/blob/master/LICENSE)

View File

@@ -1,2 +0,0 @@
pixel: "Pixel"
pixel_description: "Maintenance plugin allow you to close the website for maintenance."

View File

@@ -1,2 +0,0 @@
pixel: "Pixel"
pixel_description: "Pixel plugin to create placeholder images for Flextype"

View File

@@ -1,50 +0,0 @@
<?php
/**
*
* Flextype Pixel Plugin
*
* @author Romanenko Sergey / Awilum <awilum@yandex.ru>
* @link http://flextype.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flextype;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
use Flextype\Component\{Event\Event, Registry\Registry};
//
// Shortcode: [pixel text="test"]
//
Event::addListener('onShortcodesInitialized', function () {
Content::shortcode()->addHandler('pixel', function(ShortcodeInterface $s) {
return pixel($s->getParameter('text'),
$s->getParameter('width'),
$s->getParameter('category'),
$s->getParameter('gray')
);
});
});
/**
* Return Pixel Image
*
* @param string $text Image text
* @param int $width Image width
* @param int $height Image height
* @param string $category Image category
* @param bool $gray Image category
* @return string
*/
function pixel(string $text, $width = null, $height = null, $category = null, bool $gray = true) : string
{
(isset($gray) && $gray == true) and $gray = 'g/' or $gray = '';
(isset($width)) and $width = $width.'/' or $width = Registry::get('plugins.pixel.width').'/';
(isset($height)) and $height = $height.'/' or $height = Registry::get('plugins.pixel.height').'/';
(isset($category)) and $category = $category.'/' or $category = Registry::get('plugins.pixel.category').'/';
(isset($text)) and $text = $text.'/' or $text = '';
return rtrim('http://lorempixel.com/'.$gray.$width.$height.$category.$text, '/\\');
}

View File

@@ -1,17 +0,0 @@
name: Pixel
version: 1.0.0
description: "Pixel plugin to create placeholder images for Flextype"
author:
name: Sergey Romanenko
email: awilum@yandex.ru
url: http://flextype.org
homepage: https://github.com/flextype-plugins/pixel
bugs: https://github.com/flextype-plugins/pixel/issues
license: MIT
# Plugin settings
enabled: true
width: 400
height: 200
category: sports
text: ''

View File

@@ -1,2 +0,0 @@
# v1.0.0, 2018-05-27
* Initial release

View File

@@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2018 Flextype
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,28 +0,0 @@
# Robots Plugin for [Flextype](http://flextype.org/)
![version](https://img.shields.io/badge/version-1.0.0-brightgreen.svg?style=flat-square "Version")
![Flextype](https://img.shields.io/badge/Flextype-0.x-green.svg?style=flat-square "Flextype Version")
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/flextype-plugins/robots/blob/master/LICENSE.txt)
Robots plugin to generate a robots.txt file for your site.
## Installation
1. Unzip plugin to the folder `/site/plugins/`
2. Go to `/site/config/site.yaml` and add plugin name to plugins section.
3. Save your changes.
Example:
```
...
plugins:
- robots
```
## Settings
```yaml
enabled: true # or `false` to disable the plugin
```
## License
See [LICENSE](https://github.com/flextype-plugins/robots/blob/master/LICENSE)

View File

@@ -1,2 +0,0 @@
robots: "Robots"
robots_description: "Robots plugin to generate a robots.txt file for your site."

View File

@@ -1,2 +0,0 @@
robots: "Robots"
robots_description: "Robots plugin to generate a robots.txt file for your site."

View File

@@ -1,25 +0,0 @@
<?php
/**
*
* Flextype Robots Plugin
*
* @author Romanenko Sergey / Awilum <awilum@yandex.ru>
* @link http://flextype.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flextype;
use Flextype\Component\{Event\Event, Http\Http};
if (Http::getUriSegment(0) == 'robots.txt') {
Event::addListener('onPageBeforeRender', function () {
Http::setResponseStatus(200);
Http::setRequestHeaders('Content-Type: text/plain; charset=utf-8');
Themes::view('robots/views/templates/robots')->display();
Http::requestShutdown();
});
}

View File

@@ -1,13 +0,0 @@
name: Robots
version: 1.0.0
description: "Robots plugin to generate a robots.txt file for your site."
author:
name: Sergey Romanenko
email: awilum@yandex.ru
url: http://flextype.org
homepage: https://github.com/flextype-plugins/robots
bugs: https://github.com/flextype-plugins/robots/issues
license: MIT
# Plugin settings
enabled: true

View File

@@ -1,4 +0,0 @@
User-agent: *
Disallow: /flextype/
Disallow: /site/
Disallow: /vendor/