diff --git a/.travis.yml b/.travis.yml index fbcc77d32..e36c4a617 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,16 +42,20 @@ env: # BB_TOKEN value => "user:pass@" - secure: "einUtSEkUWy2IrqLXyVjwUU+mwaaoiOXRRVdLBpA3Zye6bZx8cm5h/5AplkPWhM/NmCJoW/MwNZHHkFhlr3mDRov5iOxVmTTYfnXB+I5lxYTSgduOLLErS7mU8hfADpVDU8bHNU44fNGD3UEiG1PD4qQBX4DMlqIFmR20mjs81k=" # GH_API_USER [for curl] - - secure: "Xbk/V9aIys0NxccJGR3Zrm2GRxDnA0RuazBs1puIboTYDhbi0Z7JTL+mOx3xp5Kfoniad/xAuijQESTM9MMrKqq/qCzhAMaC1+vcL4pCHZH4NSG6DBxB9BPkKVFq+1llu5FTEf8bkxHzwGR0l1ARW6TVRcgTHr5B58bCEIwEOrI=" + - secure: "AQGcX1B2NrI8ajflY4AimZDNcK2kBA3F6mbtEFQ78NkDoWhMipsQHayWXiSTzRc0YJKvQl2Y16MTwQF4VHzjTAiiZFATgA8J88vQUjIPabi/kKjqSmcLFoaAOAxStQbW6e0z2GiQ6KBMcNF1y5iUuI63xVrBvtKrYX/w5y+ako8=" + # Latest Release version + - TRAVIS_TAG=$(curl --fail -s https://api.github.com/repos/getgrav/grav/releases/latest | grep tag_name | head -n 1 | cut -d '"' -f 4) before_install: - export TZ=Pacific/Honolulu + - echo $TRAVIS_PHP_VERSION + - echo $TRAVIS_BRANCH + - echo $TRAVIS_PULL_REQUEST - composer self-update - if [ $TRAVIS_BRANCH == 'develop' ] || [ $TRAVIS_PULL_REQUEST != 'false' ]; then composer install --dev --prefer-dist; fi - - if [ $TRAVIS_BRANCH != 'develop' ] && [ $TRAVIS_PHP_VERSION == '5.6' ] && [ $TRAVIS_PULL_REQUEST == "false" ]; then - TRAVIS_TAG=$(curl --fail --user ${GH_API_USER} -s https://api.github.com/repos/getgrav/grav/releases/latest | grep tag_name | head -n 1 | cut -d '"' -f 4); + - if [ $TRAVIS_BRANCH != 'develop' ] && [ $TRAVIS_PHP_VERSION == "5.6" ] && [ $TRAVIS_PULL_REQUEST == "false" ]; then go get github.com/aktau/github-release; git clone --quiet --depth=50 --branch=master https://${BB_TOKEN}bitbucket.org/rockettheme/grav-devtools.git $RT_DEVTOOLS &>/dev/null; if [ ! -z "$TRAVIS_TAG" ]; then @@ -64,10 +68,9 @@ before_script: script: - if [ $TRAVIS_BRANCH == 'develop' ] || [ $TRAVIS_PULL_REQUEST != 'false' ]; then vendor/bin/codecept run; - else - TRAVIS_TAG=$(curl --fail --user ${GH_API_USER} -s https://api.github.com/repos/getgrav/grav/releases/latest | grep tag_name | head -n 1 | cut -d '"' -f 4); fi - - if [ ! -z "$TRAVIS_TAG" ] && [ $TRAVIS_BRANCH != 'develop' ] && [ $TRAVIS_PHP_VERSION == '5.6' ] && [ $TRAVIS_PULL_REQUEST == "false" ]; then + - echo $TRAVIS_TAG + - if [ ! -z "$TRAVIS_TAG" ] && [ $TRAVIS_BRANCH != 'develop' ] && [ $TRAVIS_PHP_VERSION == "5.6" ] && [ $TRAVIS_PULL_REQUEST == "false" ]; then FILES="$RT_DEVTOOLS/grav-dist/*.zip"; for file in ${FILES[@]}; do NAME=${file##*/}; diff --git a/CHANGELOG.md b/CHANGELOG.md index 93cee99ff..02d5c1927 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +# v1.0.10 +## 02/11/2016 + +1. [](#new) + * Added new `Page::contentMeta()` mechanism to store content-level meta data alongside content + * Added Japanese language translation +1. [](#improved) + * Updated some vendor libraries +1. [](#bugfix) + * Hide `streams` blueprint from Admin plugin + * Fix translations of languages with `---` in YAML files + # v1.0.9 ## 02/05/2016 diff --git a/README.md b/README.md index 6f0cf6241..0586f6c00 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# ![](https://avatars1.githubusercontent.com/u/8237355?v=2&s=50) Grav [![Build Status](https://travis-ci.org/getgrav/grav.svg?branch=develop)](https://travis-ci.org/getgrav/grav) +# ![](https://avatars1.githubusercontent.com/u/8237355?v=2&s=50) Grav -[![SensioLabsInsight](https://insight.sensiolabs.com/projects/cfd20465-d0f8-4a0a-8444-467f5b5f16ad/mini.png)](https://insight.sensiolabs.com/projects/cfd20465-d0f8-4a0a-8444-467f5b5f16ad) [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/getgrav/grav?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![SensioLabsInsight](https://insight.sensiolabs.com/projects/cfd20465-d0f8-4a0a-8444-467f5b5f16ad/mini.png)](https://insight.sensiolabs.com/projects/cfd20465-d0f8-4a0a-8444-467f5b5f16ad) [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/getgrav/grav?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/getgrav/grav.svg?branch=develop)](https://travis-ci.org/getgrav/grav) Grav is a **Fast**, **Simple**, and **Flexible**, file-based Web-platform. There is **Zero** installation required. Just extract the ZIP archive, and you are already up and running. It follows similar principles to other flat-file CMS platforms, but has a different design philosophy than most. Grav comes with a powerful **Package Management System** to allow for simple installation and upgrading of plugins and themes, as well as simple updating of Grav itself. diff --git a/composer.lock b/composer.lock index c5c236f9f..5ff8b3311 100644 --- a/composer.lock +++ b/composer.lock @@ -675,16 +675,16 @@ }, { "name": "rockettheme/toolbox", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/rockettheme/toolbox.git", - "reference": "0c7a3b4b6e4d73be8512e89f7acde6899334b7f2" + "reference": "22273dff75748eb1f51fcfa41fa85d8eff1f9f6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rockettheme/toolbox/zipball/0c7a3b4b6e4d73be8512e89f7acde6899334b7f2", - "reference": "0c7a3b4b6e4d73be8512e89f7acde6899334b7f2", + "url": "https://api.github.com/repos/rockettheme/toolbox/zipball/22273dff75748eb1f51fcfa41fa85d8eff1f9f6c", + "reference": "22273dff75748eb1f51fcfa41fa85d8eff1f9f6c", "shasum": "" }, "require": { @@ -720,7 +720,7 @@ "php", "rockettheme" ], - "time": "2015-11-24 17:04:24" + "time": "2016-02-11 19:08:48" }, { "name": "symfony/console", @@ -1137,16 +1137,16 @@ "packages-dev": [ { "name": "codeception/codeception", - "version": "2.1.5", + "version": "2.1.6", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "4ee562f421fd404139dd7b73ae46d075396a4baf" + "reference": "b199941f5e59d1e7fd32d78296c8ab98db873d89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/4ee562f421fd404139dd7b73ae46d075396a4baf", - "reference": "4ee562f421fd404139dd7b73ae46d075396a4baf", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/b199941f5e59d1e7fd32d78296c8ab98db873d89", + "reference": "b199941f5e59d1e7fd32d78296c8ab98db873d89", "shasum": "" }, "require": { @@ -1213,7 +1213,7 @@ "functional testing", "unit testing" ], - "time": "2015-12-20 12:11:42" + "time": "2016-02-09 22:27:48" }, { "name": "doctrine/instantiator", @@ -1886,16 +1886,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.22", + "version": "4.8.23", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "dfb11aa5236376b4fc63853cf746af39fe780e72" + "reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/dfb11aa5236376b4fc63853cf746af39fe780e72", - "reference": "dfb11aa5236376b4fc63853cf746af39fe780e72", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6e351261f9cd33daf205a131a1ba61c6d33bd483", + "reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483", "shasum": "" }, "require": { @@ -1954,7 +1954,7 @@ "testing", "xunit" ], - "time": "2016-02-02 09:01:21" + "time": "2016-02-11 14:56:33" }, { "name": "phpunit/phpunit-mock-objects", diff --git a/system/blueprints/config/streams.yaml b/system/blueprints/config/streams.yaml index 636bed295..c73b80baf 100644 --- a/system/blueprints/config/streams.yaml +++ b/system/blueprints/config/streams.yaml @@ -2,6 +2,7 @@ title: PLUGIN_ADMIN.FILE_STREAMS form: validation: loose + hidden: true fields: schemes.xxx: type: array diff --git a/system/defines.php b/system/defines.php index 8efc90724..a56126901 100644 --- a/system/defines.php +++ b/system/defines.php @@ -2,7 +2,7 @@ // Some standard defines define('GRAV', true); -define('GRAV_VERSION', '1.0.9'); +define('GRAV_VERSION', '1.0.10'); define('DS', '/'); define('GRAV_PHP_MIN', '5.5.9'); diff --git a/system/languages/cs.yaml b/system/languages/cs.yaml index f019accd1..a97eb4cab 100644 --- a/system/languages/cs.yaml +++ b/system/languages/cs.yaml @@ -1,4 +1,3 @@ ---- INFLECTOR_UNCOUNTABLE: - vybavení - informace diff --git a/system/languages/de.yaml b/system/languages/de.yaml index a5285fa76..8fcf2e620 100644 --- a/system/languages/de.yaml +++ b/system/languages/de.yaml @@ -1,14 +1,13 @@ ---- FRONTMATTER_ERROR_PAGE: | --- title: %1$s --- # Fehler: Frontmatter enthält Fehler - + Pfad: `%2$s` - - **%3$s ** - + + **%3$s ** + ``` %4$s ``` diff --git a/system/languages/el.yaml b/system/languages/el.yaml index efbdb72d0..2a03c9d7e 100644 --- a/system/languages/el.yaml +++ b/system/languages/el.yaml @@ -1,4 +1,3 @@ ---- MONTHS_OF_THE_YEAR: - Ιανουάριος - Φεβρουάριος diff --git a/system/languages/es.yaml b/system/languages/es.yaml index 068b4ed57..9bfedec7f 100644 --- a/system/languages/es.yaml +++ b/system/languages/es.yaml @@ -1,4 +1,3 @@ ---- INFLECTOR_UNCOUNTABLE: 0: equipo 1: información diff --git a/system/languages/fi.yaml b/system/languages/fi.yaml deleted file mode 100644 index ed97d539c..000000000 --- a/system/languages/fi.yaml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/system/languages/fr.yaml b/system/languages/fr.yaml index d6dd9121b..c6d603885 100644 --- a/system/languages/fr.yaml +++ b/system/languages/fr.yaml @@ -1,15 +1,14 @@ ---- FRONTMATTER_ERROR_PAGE: | --- title: %1$s --- - + # Erreur : Frontmatter invalide - + Path: `%2$s` - + **%3$s** - + ``` %4$s ``` diff --git a/system/languages/hr.yaml b/system/languages/hr.yaml index adcdde56d..8d4eeb125 100644 --- a/system/languages/hr.yaml +++ b/system/languages/hr.yaml @@ -1,4 +1,3 @@ ---- INFLECTOR_UNCOUNTABLE: - oprema - informacije diff --git a/system/languages/hu.yaml b/system/languages/hu.yaml index 6b5bdcfe5..127353eec 100644 --- a/system/languages/hu.yaml +++ b/system/languages/hu.yaml @@ -1,15 +1,14 @@ ---- FRONTMATTER_ERROR_PAGE: | --- cím: %1$s --- - + # Hiba: Érvénytelen Frontmatter - + Elérési út: `%2$s` - + **%3$s** - + ``` %4$s ``` diff --git a/system/languages/it.yaml b/system/languages/it.yaml index 5ae76457a..d091e8ff3 100644 --- a/system/languages/it.yaml +++ b/system/languages/it.yaml @@ -1,4 +1,3 @@ ---- NICETIME: NO_DATE_PROVIDED: Nessuna data fornita BAD_DATE: Data errata diff --git a/system/languages/ja.yaml b/system/languages/ja.yaml new file mode 100644 index 000000000..a2ba94aea --- /dev/null +++ b/system/languages/ja.yaml @@ -0,0 +1,59 @@ +FRONTMATTER_ERROR_PAGE: "---\ntitle: %1$s\n---\n\n# Error: Invalid Frontmatter\n\nPath: `%2$s`\n\n**%3$s**\n\n```\n%4$s\n```" +INFLECTOR_PLURALS: [] + +INFLECTOR_SINGULAR: [] + +INFLECTOR_UNCOUNTABLE: [] + +INFLECTOR_IRREGULAR: + 'person': 'みんな' + 'man': '人' + 'child': '子供' + 'sex': '性別' + 'move': '移動' + +INFLECTOR_ORDINALS: [] + +NICETIME: + NO_DATE_PROVIDED: 日付が設定されていません + BAD_DATE: 不正な日付 + AGO: 前 + FROM_NOW: from now + SECOND: 秒 + MINUTE: 分 + HOUR: 時 + DAY: 日 + WEEK: 週 + MONTH: 月 + YEAR: 年 + DECADE: 10年 + SEC: 秒 + MIN: 分 + HR: 時 + DAY: 日 + WK: 週 + MO: 月 + YR: 年 + DEC: dec + SECOND_PLURAL: 秒 + MINUTE_PLURAL: 分 + HOUR_PLURAL: 時 + DAY_PLURAL: 日 + WEEK_PLURAL: 週 + MONTH_PLURAL: 月 + YEAR_PLURAL: 年 + DECADE_PLURAL: 10年 + SEC_PLURAL: 秒 + MIN_PLURAL: 分 + HR_PLURAL: 時 + DAY_PLURAL: 日 + WK_PLURAL: 週 + MO_PLURAL: 月 + YR_PLURAL: 年 + DEC_PLURAL: 10年 +FORM: + VALIDATION_FAIL: バリデーション失敗 : + INVALID_INPUT: 不正な入力: + MISSING_REQUIRED_FIELD: 必須項目が入力されていません: +MONTHS_OF_THE_YEAR: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] +DAYS_OF_THE_WEEK: ['月', '火', '水', '木', '金', '土', '日'] diff --git a/system/languages/lt.yaml b/system/languages/lt.yaml index 6b77aa176..fcd34ef13 100644 --- a/system/languages/lt.yaml +++ b/system/languages/lt.yaml @@ -1,4 +1,3 @@ ---- INFLECTOR_UNCOUNTABLE: 2: ryžiai 3: pinigai diff --git a/system/languages/nl.yaml b/system/languages/nl.yaml index 175fa7127..383f38cc3 100644 --- a/system/languages/nl.yaml +++ b/system/languages/nl.yaml @@ -1,4 +1,3 @@ ---- INFLECTOR_IRREGULAR: person: personen man: mensen diff --git a/system/languages/no.yaml b/system/languages/no.yaml index 8dc4e62db..41cd4b003 100644 --- a/system/languages/no.yaml +++ b/system/languages/no.yaml @@ -1,15 +1,14 @@ ---- FRONTMATTER_ERROR_PAGE: | --- Tittel: %1$s --- - + # Feilmelding: Ugyldig Frontmatter - + Pane: '%2$s' - + **%3$s ** - + ``` %4$s ``` diff --git a/system/languages/pl.yaml b/system/languages/pl.yaml index ba695db48..9aac0940c 100644 --- a/system/languages/pl.yaml +++ b/system/languages/pl.yaml @@ -1,15 +1,14 @@ ---- FRONTMATTER_ERROR_PAGE: | --- title: %1$s --- - + # Error: Nieprawidłowy Frontmatter - + Path: `%2$s` - + **%3$s** - + ``` %4$s ``` diff --git a/system/languages/pt.yaml b/system/languages/pt.yaml index fa24f2500..f108e992c 100644 --- a/system/languages/pt.yaml +++ b/system/languages/pt.yaml @@ -1,4 +1,3 @@ ---- INFLECTOR_UNCOUNTABLE: 1: informação 2: arroz diff --git a/system/languages/ro.yaml b/system/languages/ro.yaml index 371610590..a95fcde0b 100644 --- a/system/languages/ro.yaml +++ b/system/languages/ro.yaml @@ -1,4 +1,3 @@ ---- MONTHS_OF_THE_YEAR: 0: Ianuarie 1: Februarie diff --git a/system/languages/ru.yaml b/system/languages/ru.yaml index feac69428..6f7600c04 100644 --- a/system/languages/ru.yaml +++ b/system/languages/ru.yaml @@ -1,4 +1,3 @@ ---- INFLECTOR_IRREGULAR: person: люди man: человек diff --git a/system/languages/sk.yaml b/system/languages/sk.yaml deleted file mode 100644 index ed97d539c..000000000 --- a/system/languages/sk.yaml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/system/languages/sv.yaml b/system/languages/sv.yaml index c5410b766..648167849 100644 --- a/system/languages/sv.yaml +++ b/system/languages/sv.yaml @@ -1,3 +1,2 @@ ---- NICETIME: DAY: dag diff --git a/system/languages/tr.yaml b/system/languages/tr.yaml index 9d8c5b062..28bb5c58b 100644 --- a/system/languages/tr.yaml +++ b/system/languages/tr.yaml @@ -1,4 +1,3 @@ ---- NICETIME: NO_DATE_PROVIDED: Tarih yok BAD_DATE: Yanlış tarih diff --git a/system/src/Grav/Common/Browser.php b/system/src/Grav/Common/Browser.php index 3272901d3..bcced4899 100644 --- a/system/src/Grav/Common/Browser.php +++ b/system/src/Grav/Common/Browser.php @@ -6,8 +6,8 @@ * * Internally uses the PhpUserAgent package https://github.com/donatj/PhpUserAgent * - * @author RocketTHeme - * @licence MIT + * @author RocketTheme + * @license MIT */ class Browser { diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 99ccd702d..b9b6db7b8 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -65,6 +65,7 @@ class Page protected $frontmatter; protected $language; protected $content; + protected $content_meta; protected $summary; protected $raw_content; protected $pagination; @@ -517,7 +518,15 @@ public function content($var = null) /** @var Cache $cache */ $cache = self::getGrav()['cache']; $cache_id = md5('page' . $this->id()); - $this->content = $cache->fetch($cache_id); + $content_obj = $cache->fetch($cache_id); + + if (is_array($content_obj)) { + $this->content = $content_obj['content']; + $this->content_meta = $content_obj['content_meta']; + } else { + $this->content = $content_obj; + } + $process_markdown = $this->shouldProcess('markdown'); $process_twig = $this->shouldProcess('twig'); @@ -574,6 +583,51 @@ public function content($var = null) return $this->content; } + /** + * Get the contentMeta array and initialize content first if it's not already + * + * @return mixed + */ + public function contentMeta() + { + if ($this->content === null) { + $this->content(); + } + return $this->getContentMeta(); + } + + /** + * Add an entry to the page's contentMeta array + * + * @param $name + * @param $value + */ + public function addContentMeta($name, $value) + { + $this->content_meta[$name] = $value; + } + + /** + * Return the whole contentMeta array as it currently stands + * + * @return mixed + */ + public function getContentMeta() + { + return $this->content_meta; + } + + /** + * Sets the whole content meta array in one shot + * + * @param $content_meta + * @return mixed + */ + public function setContentMeta($content_meta) + { + return $this->content_meta = $content_meta; + } + /** * Process the Markdown content. Uses Parsedown or Parsedown Extra depending on configuration */ @@ -619,7 +673,7 @@ private function cachePageContent() { $cache = self::getGrav()['cache']; $cache_id = md5('page' . $this->id()); - $cache->save($cache_id, $this->content); + $cache->save($cache_id, ['content' => $this->content, 'content_meta' => $this->content_meta]); } /**