Skip to content

Commit

Permalink
Updates for Flextype 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Awilum committed May 8, 2018
1 parent 3a20e12 commit 5d0f3a2
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# v1.1.0, 2018-05-08
* Updates for Flextype 0.3.0

# v1.0.0, 2018-03-26
* Initial release
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Sitemap Plugin for [Flextype](http://flextype.org/)
![version](https://img.shields.io/badge/version-1.0.0-brightgreen.svg?style=flat-square "Version")
![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.yml` and add plugin name to plugins section.
2. Go to `/site/config/site.yaml` and add plugin name to plugins section.
3. Save your changes.

Example:
Expand Down
File renamed without changes.
File renamed without changes.
19 changes: 8 additions & 11 deletions sitemap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Flextype;

/**
*
* Flextype Sitemap Plugin
Expand All @@ -11,17 +13,12 @@
* file that was distributed with this source code.
*/

namespace Flextype;

use Url;
use Arr;
use Response;
use Request;
use Flextype\Component\{Event\Event, Http\Http, Arr\Arr};

if (Url::getUriSegment(0) == 'sitemap.xml') {
Events::addListener('onPageBeforeRender', function () {
Response::status(200);
Request::setHeaders('Content-Type: text/xml; charset=utf-8');
if (Http::getUriSegment(0) == 'sitemap.xml') {
Event::addListener('onPageBeforeRender', function () {
Http::setResponseStatus(200);
Http::setRequestHeaders('Content-Type: text/xml; charset=utf-8');

$_pages = Pages::getPages('', false, 'date');

Expand All @@ -33,6 +30,6 @@

include 'views/sitemap.php';

Request::shutdown();
Http::requestShutdown();
});
}
2 changes: 1 addition & 1 deletion sitemap.yml → sitemap.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Sitemap
version: 1.0.0
version: 1.1.0
description: "Provide automatically generated XML sitemap."
author:
name: Sergey Romanenko
Expand Down

0 comments on commit 5d0f3a2

Please sign in to comment.