mirror of
https://github.com/getgrav/grav.git
synced 2025-12-06 15:59:58 +01:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b6cadbeeb | ||
|
|
bf91d13222 | ||
|
|
0bd60d24b7 | ||
|
|
864f14344e | ||
|
|
81e25e314b | ||
|
|
028554dbf8 | ||
|
|
bda8de3076 | ||
|
|
36be17617d | ||
|
|
bb23f6157f | ||
|
|
39ac423bce | ||
|
|
39b1eed912 | ||
|
|
360286f3d4 | ||
|
|
88c84ed028 | ||
|
|
f03a7ced06 | ||
|
|
5605b69844 |
15
.travis.yml
15
.travis.yml
@@ -42,16 +42,20 @@ env:
|
|||||||
# BB_TOKEN value => "user:pass@"
|
# BB_TOKEN value => "user:pass@"
|
||||||
- secure: "einUtSEkUWy2IrqLXyVjwUU+mwaaoiOXRRVdLBpA3Zye6bZx8cm5h/5AplkPWhM/NmCJoW/MwNZHHkFhlr3mDRov5iOxVmTTYfnXB+I5lxYTSgduOLLErS7mU8hfADpVDU8bHNU44fNGD3UEiG1PD4qQBX4DMlqIFmR20mjs81k="
|
- secure: "einUtSEkUWy2IrqLXyVjwUU+mwaaoiOXRRVdLBpA3Zye6bZx8cm5h/5AplkPWhM/NmCJoW/MwNZHHkFhlr3mDRov5iOxVmTTYfnXB+I5lxYTSgduOLLErS7mU8hfADpVDU8bHNU44fNGD3UEiG1PD4qQBX4DMlqIFmR20mjs81k="
|
||||||
# GH_API_USER [for curl]
|
# 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:
|
before_install:
|
||||||
- export TZ=Pacific/Honolulu
|
- export TZ=Pacific/Honolulu
|
||||||
|
- echo $TRAVIS_PHP_VERSION
|
||||||
|
- echo $TRAVIS_BRANCH
|
||||||
|
- echo $TRAVIS_PULL_REQUEST
|
||||||
- composer self-update
|
- composer self-update
|
||||||
- if [ $TRAVIS_BRANCH == 'develop' ] || [ $TRAVIS_PULL_REQUEST != 'false' ]; then
|
- if [ $TRAVIS_BRANCH == 'develop' ] || [ $TRAVIS_PULL_REQUEST != 'false' ]; then
|
||||||
composer install --dev --prefer-dist;
|
composer install --dev --prefer-dist;
|
||||||
fi
|
fi
|
||||||
- if [ $TRAVIS_BRANCH != 'develop' ] && [ $TRAVIS_PHP_VERSION == '5.6' ] && [ $TRAVIS_PULL_REQUEST == "false" ]; then
|
- 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);
|
|
||||||
go get github.com/aktau/github-release;
|
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;
|
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
|
if [ ! -z "$TRAVIS_TAG" ]; then
|
||||||
@@ -64,10 +68,9 @@ before_script:
|
|||||||
script:
|
script:
|
||||||
- if [ $TRAVIS_BRANCH == 'develop' ] || [ $TRAVIS_PULL_REQUEST != 'false' ]; then
|
- if [ $TRAVIS_BRANCH == 'develop' ] || [ $TRAVIS_PULL_REQUEST != 'false' ]; then
|
||||||
vendor/bin/codecept run;
|
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
|
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";
|
FILES="$RT_DEVTOOLS/grav-dist/*.zip";
|
||||||
for file in ${FILES[@]}; do
|
for file in ${FILES[@]}; do
|
||||||
NAME=${file##*/};
|
NAME=${file##*/};
|
||||||
|
|||||||
12
CHANGELOG.md
12
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
|
# v1.0.9
|
||||||
## 02/05/2016
|
## 02/05/2016
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#  Grav [](https://travis-ci.org/getgrav/grav)
|
#  Grav
|
||||||
|
|
||||||
[](https://insight.sensiolabs.com/projects/cfd20465-d0f8-4a0a-8444-467f5b5f16ad) [](https://gitter.im/getgrav/grav?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
[](https://insight.sensiolabs.com/projects/cfd20465-d0f8-4a0a-8444-467f5b5f16ad) [](https://gitter.im/getgrav/grav?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](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.
|
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.
|
||||||
|
|
||||||
|
|||||||
30
composer.lock
generated
30
composer.lock
generated
@@ -675,16 +675,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "rockettheme/toolbox",
|
"name": "rockettheme/toolbox",
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/rockettheme/toolbox.git",
|
"url": "https://github.com/rockettheme/toolbox.git",
|
||||||
"reference": "0c7a3b4b6e4d73be8512e89f7acde6899334b7f2"
|
"reference": "22273dff75748eb1f51fcfa41fa85d8eff1f9f6c"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/rockettheme/toolbox/zipball/0c7a3b4b6e4d73be8512e89f7acde6899334b7f2",
|
"url": "https://api.github.com/repos/rockettheme/toolbox/zipball/22273dff75748eb1f51fcfa41fa85d8eff1f9f6c",
|
||||||
"reference": "0c7a3b4b6e4d73be8512e89f7acde6899334b7f2",
|
"reference": "22273dff75748eb1f51fcfa41fa85d8eff1f9f6c",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -720,7 +720,7 @@
|
|||||||
"php",
|
"php",
|
||||||
"rockettheme"
|
"rockettheme"
|
||||||
],
|
],
|
||||||
"time": "2015-11-24 17:04:24"
|
"time": "2016-02-11 19:08:48"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/console",
|
"name": "symfony/console",
|
||||||
@@ -1137,16 +1137,16 @@
|
|||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
{
|
{
|
||||||
"name": "codeception/codeception",
|
"name": "codeception/codeception",
|
||||||
"version": "2.1.5",
|
"version": "2.1.6",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Codeception/Codeception.git",
|
"url": "https://github.com/Codeception/Codeception.git",
|
||||||
"reference": "4ee562f421fd404139dd7b73ae46d075396a4baf"
|
"reference": "b199941f5e59d1e7fd32d78296c8ab98db873d89"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/4ee562f421fd404139dd7b73ae46d075396a4baf",
|
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/b199941f5e59d1e7fd32d78296c8ab98db873d89",
|
||||||
"reference": "4ee562f421fd404139dd7b73ae46d075396a4baf",
|
"reference": "b199941f5e59d1e7fd32d78296c8ab98db873d89",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1213,7 +1213,7 @@
|
|||||||
"functional testing",
|
"functional testing",
|
||||||
"unit testing"
|
"unit testing"
|
||||||
],
|
],
|
||||||
"time": "2015-12-20 12:11:42"
|
"time": "2016-02-09 22:27:48"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "doctrine/instantiator",
|
"name": "doctrine/instantiator",
|
||||||
@@ -1886,16 +1886,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/phpunit",
|
"name": "phpunit/phpunit",
|
||||||
"version": "4.8.22",
|
"version": "4.8.23",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||||
"reference": "dfb11aa5236376b4fc63853cf746af39fe780e72"
|
"reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/dfb11aa5236376b4fc63853cf746af39fe780e72",
|
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6e351261f9cd33daf205a131a1ba61c6d33bd483",
|
||||||
"reference": "dfb11aa5236376b4fc63853cf746af39fe780e72",
|
"reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1954,7 +1954,7 @@
|
|||||||
"testing",
|
"testing",
|
||||||
"xunit"
|
"xunit"
|
||||||
],
|
],
|
||||||
"time": "2016-02-02 09:01:21"
|
"time": "2016-02-11 14:56:33"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/phpunit-mock-objects",
|
"name": "phpunit/phpunit-mock-objects",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ title: PLUGIN_ADMIN.FILE_STREAMS
|
|||||||
|
|
||||||
form:
|
form:
|
||||||
validation: loose
|
validation: loose
|
||||||
|
hidden: true
|
||||||
fields:
|
fields:
|
||||||
schemes.xxx:
|
schemes.xxx:
|
||||||
type: array
|
type: array
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// Some standard defines
|
// Some standard defines
|
||||||
define('GRAV', true);
|
define('GRAV', true);
|
||||||
define('GRAV_VERSION', '1.0.9');
|
define('GRAV_VERSION', '1.0.10');
|
||||||
define('DS', '/');
|
define('DS', '/');
|
||||||
define('GRAV_PHP_MIN', '5.5.9');
|
define('GRAV_PHP_MIN', '5.5.9');
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
INFLECTOR_UNCOUNTABLE:
|
INFLECTOR_UNCOUNTABLE:
|
||||||
- vybavení
|
- vybavení
|
||||||
- informace
|
- informace
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
FRONTMATTER_ERROR_PAGE: |
|
FRONTMATTER_ERROR_PAGE: |
|
||||||
---
|
---
|
||||||
title: %1$s
|
title: %1$s
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
MONTHS_OF_THE_YEAR:
|
MONTHS_OF_THE_YEAR:
|
||||||
- Ιανουάριος
|
- Ιανουάριος
|
||||||
- Φεβρουάριος
|
- Φεβρουάριος
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
INFLECTOR_UNCOUNTABLE:
|
INFLECTOR_UNCOUNTABLE:
|
||||||
0: equipo
|
0: equipo
|
||||||
1: información
|
1: información
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
---
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
FRONTMATTER_ERROR_PAGE: |
|
FRONTMATTER_ERROR_PAGE: |
|
||||||
---
|
---
|
||||||
title: %1$s
|
title: %1$s
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
INFLECTOR_UNCOUNTABLE:
|
INFLECTOR_UNCOUNTABLE:
|
||||||
- oprema
|
- oprema
|
||||||
- informacije
|
- informacije
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
FRONTMATTER_ERROR_PAGE: |
|
FRONTMATTER_ERROR_PAGE: |
|
||||||
---
|
---
|
||||||
cím: %1$s
|
cím: %1$s
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
NICETIME:
|
NICETIME:
|
||||||
NO_DATE_PROVIDED: Nessuna data fornita
|
NO_DATE_PROVIDED: Nessuna data fornita
|
||||||
BAD_DATE: Data errata
|
BAD_DATE: Data errata
|
||||||
|
|||||||
59
system/languages/ja.yaml
Normal file
59
system/languages/ja.yaml
Normal file
@@ -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: <b>バリデーション失敗 :</b>
|
||||||
|
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: ['月', '火', '水', '木', '金', '土', '日']
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
INFLECTOR_UNCOUNTABLE:
|
INFLECTOR_UNCOUNTABLE:
|
||||||
2: ryžiai
|
2: ryžiai
|
||||||
3: pinigai
|
3: pinigai
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
INFLECTOR_IRREGULAR:
|
INFLECTOR_IRREGULAR:
|
||||||
person: personen
|
person: personen
|
||||||
man: mensen
|
man: mensen
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
FRONTMATTER_ERROR_PAGE: |
|
FRONTMATTER_ERROR_PAGE: |
|
||||||
---
|
---
|
||||||
Tittel: %1$s
|
Tittel: %1$s
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
FRONTMATTER_ERROR_PAGE: |
|
FRONTMATTER_ERROR_PAGE: |
|
||||||
---
|
---
|
||||||
title: %1$s
|
title: %1$s
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
INFLECTOR_UNCOUNTABLE:
|
INFLECTOR_UNCOUNTABLE:
|
||||||
1: informação
|
1: informação
|
||||||
2: arroz
|
2: arroz
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
MONTHS_OF_THE_YEAR:
|
MONTHS_OF_THE_YEAR:
|
||||||
0: Ianuarie
|
0: Ianuarie
|
||||||
1: Februarie
|
1: Februarie
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
INFLECTOR_IRREGULAR:
|
INFLECTOR_IRREGULAR:
|
||||||
person: люди
|
person: люди
|
||||||
man: человек
|
man: человек
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
---
|
|
||||||
@@ -1,3 +1,2 @@
|
|||||||
---
|
|
||||||
NICETIME:
|
NICETIME:
|
||||||
DAY: dag
|
DAY: dag
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
NICETIME:
|
NICETIME:
|
||||||
NO_DATE_PROVIDED: Tarih yok
|
NO_DATE_PROVIDED: Tarih yok
|
||||||
BAD_DATE: Yanlış tarih
|
BAD_DATE: Yanlış tarih
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ namespace Grav\Common;
|
|||||||
*
|
*
|
||||||
* Internally uses the PhpUserAgent package https://github.com/donatj/PhpUserAgent
|
* Internally uses the PhpUserAgent package https://github.com/donatj/PhpUserAgent
|
||||||
*
|
*
|
||||||
* @author RocketTHeme
|
* @author RocketTheme
|
||||||
* @licence MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
class Browser
|
class Browser
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ class Page
|
|||||||
protected $frontmatter;
|
protected $frontmatter;
|
||||||
protected $language;
|
protected $language;
|
||||||
protected $content;
|
protected $content;
|
||||||
|
protected $content_meta;
|
||||||
protected $summary;
|
protected $summary;
|
||||||
protected $raw_content;
|
protected $raw_content;
|
||||||
protected $pagination;
|
protected $pagination;
|
||||||
@@ -517,7 +518,15 @@ class Page
|
|||||||
/** @var Cache $cache */
|
/** @var Cache $cache */
|
||||||
$cache = self::getGrav()['cache'];
|
$cache = self::getGrav()['cache'];
|
||||||
$cache_id = md5('page' . $this->id());
|
$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_markdown = $this->shouldProcess('markdown');
|
||||||
$process_twig = $this->shouldProcess('twig');
|
$process_twig = $this->shouldProcess('twig');
|
||||||
@@ -574,6 +583,51 @@ class Page
|
|||||||
return $this->content;
|
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
|
* Process the Markdown content. Uses Parsedown or Parsedown Extra depending on configuration
|
||||||
*/
|
*/
|
||||||
@@ -619,7 +673,7 @@ class Page
|
|||||||
{
|
{
|
||||||
$cache = self::getGrav()['cache'];
|
$cache = self::getGrav()['cache'];
|
||||||
$cache_id = md5('page' . $this->id());
|
$cache_id = md5('page' . $this->id());
|
||||||
$cache->save($cache_id, $this->content);
|
$cache->save($cache_id, ['content' => $this->content, 'content_meta' => $this->content_meta]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user