dkyme
a3dd0b9fbd
replace strlen in readPages() with variables
...
see issue #671
2023-08-14 10:58:36 +02:00
Daniel Rudolf
0c87fae09b
Various small improvements
2023-01-05 22:32:10 +01:00
Daniel Rudolf
c0639ccef6
Minor code improvements
2022-03-09 15:36:58 +01:00
Daniel Rudolf
3b6984dbd7
Add some "art" to Pico class docs
2022-03-08 22:41:11 +01:00
Daniel Rudolf
71c0dfbffb
Proberly handle page data of hidden pages when accessing such a page
...
This is a workaround for meta pages (i.e. pages starting with a '_'): If a user attempts to request such a page, Pico won't respond with the contents of this meta page, but with a 404 page. This is expected behavior. However, we also have a shortcut in Pico::readPages() attempting to skip reading the contents of the requested page twice. Since we're not serving the contents of the meta page, but of the 404 page, we accidentally overwrite the contents of the meta page by Pico's 404 page. This is unexpected behavior. Even though this commit fixes this particular issue, it doesn't fix its major cause, as the shortcut still exists and can still be triggered by plugin authors by simply overwriting the contents of an existing page. Even though a plugin author might want this to happen, we can't really tell whether it is intended or not. The solution is to remove the shortcut, but we don't want that either, it's a useful performance optimization. The only real solution to this is to switch to page objects, allowing us to handle such situations more verbose. This feature is expected for Pico 4.0. For now we leave this partially fixed...
Fixes #602
2022-03-03 21:55:00 +01:00
Daniel Rudolf
9a8b3da2ae
Simplify PHP class imports
2022-03-03 21:39:27 +01:00
Daniel Rudolf
a3f801b89a
Enable PHP strict typing
...
We can't enable strict typing everywhere without major BC breaks (likely Pico 4.0), so we're doing this on a best-effort basis.
Fixes #603
2022-03-03 21:37:04 +01:00
Daniel Rudolf
61880d150e
Update Pico::VERSION to '3.0.0-dev'
2022-02-26 21:52:11 +01:00
Daniel Rudolf
8b4b20fe97
PHP_CodeSniffer: Allow using strftime()
2022-02-13 15:34:44 +01:00
Daniel Rudolf
e33f6c8148
Update various links
2022-02-13 15:10:08 +01:00
Daniel Rudolf
76a761c3a2
Bump to API version 4
2022-02-07 00:00:27 +01:00
Daniel Rudolf
4e572adb33
Merge branch 'master' into pico-3.0
2022-02-06 23:21:00 +01:00
Daniel Rudolf
fe6c8f805a
Re-add deprecated Pico::getBaseThemeUrl() and AbstractPicoPlugin::__call()
...
This reverts commits efc4fb5288d39e66a81df3707255278b33506232 and bc816febfca84fed80ca96d499bb5e034b0f8e8f
2022-02-06 23:15:39 +01:00
Daniel Rudolf
41fc15a7e8
Remove picocms\Pico\ namespace
...
This reverts commit 812ae5c21548905e308f002bc6d97a042ea09aad
2022-02-06 23:14:08 +01:00
Daniel Rudolf
edfab74ff2
Add %page_*% replacements for Markdown files
...
`%page_id%` is replaced by the page's ID, `%page_url%` by the page's relative URL, and `%page_path%` by the dirname of page file.
2022-02-06 22:43:19 +01:00
Daniel Rudolf
b95cfe0a0e
Update Pico::VERSION and Pico::VERSION_ID
2020-08-29 16:15:37 +02:00
Daniel Rudolf
1916dc5645
Silence PHP notices in upstream Parsedown
...
Parsedown is a still unresolved issue in whole, this at least ensures that we don't fill up logfiles with useless errors...
2020-08-29 16:07:10 +02:00
Daniel Rudolf
4be1f6ae90
Try to proberly encode formatted date strings returned by strftime()
...
Fixes #560
2020-08-29 16:04:10 +02:00
Daniel Rudolf
590d467347
Update Pico::VERSION and Pico::VERSION_ID
2020-07-10 18:51:32 +02:00
Daniel Willmann
b2df860546
Add option to set a locale
...
As mentioned in https://www.php.net/manual/en/function.basename.php both
basename() and dirname() are locale aware.
An incorrect locale can cause the page tree to behave in strange ways.
For example the structure
/über-uns
|-index.md
|-impressum.md
could lead to the page impressum not being a child of über-uns.
2020-06-14 17:34:46 +02:00
Daniel Rudolf
d6f9806b32
Replace substr()-based comparisons by substr_compare()
2020-05-01 20:55:00 +02:00
Daniel Rudolf
bc816febfc
Remove deprecated Pico::getBaseThemeUrl()
...
Use Pico::getConfig('themes_url') instead.
2020-04-11 23:21:45 +02:00
Daniel Rudolf
646aa355e5
Various small improvements
2020-04-11 21:15:50 +02:00
Daniel Rudolf
62aa4dbc7e
Check theme dir before trying to load theme
2020-04-10 23:44:00 +02:00
Daniel Rudolf
b892d6bb11
Update Pico::VERSION and Pico::VERSION_ID
2020-04-10 23:17:45 +02:00
Daniel Rudolf
85d7573020
Update to Symfony YAML 5.0 and Twig 3.0
...
Pico now requires PHP 7.2.5+
2020-04-10 23:11:53 +02:00
Daniel Rudolf
b1a58b9300
Update code styling to PHP 7.0+
...
This commit includes no functional changes.
2020-04-10 23:08:57 +02:00
Daniel Rudolf
812ae5c215
Move Pico to picocms\Pico\ namespace
2020-04-10 23:08:54 +02:00
Daniel Rudolf
2ee41e9a8d
Update Pico::VERSION and Pico::VERSION_ID
2020-03-29 14:57:08 +02:00
Daniel Rudolf
718b790b19
Kick-start development of Pico 3.0
2020-03-29 14:37:35 +02:00
Daniel Rudolf
6672fb2277
Update Pico::VERSION and Pico::VERSION_ID
2019-12-31 16:33:45 +01:00
Daniel Rudolf
447479d973
Test hidden page requests on page ID
...
Fixes #523
2019-12-31 00:36:22 +01:00
Daniel Rudolf
a87e40fbf0
Update Pico::VERSION
2019-11-25 00:43:58 +01:00
Daniel Rudolf
29f2e95160
Update Pico::VERSION
2019-11-04 01:49:11 +01:00
Daniel Rudolf
e0415c8c1d
Mark Pico's content Twig variable as being safe
...
This no longer requires themes to output the `content` variable using `{{ content|raw }}`, theme developers can use `{{ content }}` as before.
2019-10-26 14:02:11 +02:00
Daniel Rudolf
2a23edde4e
Fix code formatting
2019-10-26 11:34:58 +02:00
Daniel Rudolf
23000af64e
Add $singleLine param to Twig markdown parser
...
This allows you to parse just a single line of Markdown, i.e. the parsed output won't include a HTML paragraph element.
2019-10-24 13:03:38 +02:00
Daniel Rudolf
be0812fb55
Mark Twig content filter as HTML safe
2019-10-24 12:05:08 +02:00
Daniel Rudolf
d2573c5df5
Fix $this->config['twig_config'] handling in Pico::loadTheme()
2019-10-20 19:17:42 +02:00
Daniel Rudolf
1d5aba46af
Support content files with UTF-8 BOM
...
Resolves #461
2019-10-20 15:16:40 +02:00
Daniel Rudolf
87bcff1654
Various small improvements
2019-10-12 15:54:05 +02:00
Daniel Rudolf
6ffbbec689
Improve theme API version retrieval
2019-10-12 15:01:16 +02:00
Daniel Rudolf
b27b4f388a
🎉 Add Pico theme API versioning and add pico-theme.yml
...
- Add pico-theme.yml with a theme's API version, theme-specific default Twig config, registering theme-specific custom meta headers and defaults for Pico's `theme_config` config
- Add new `onThemeLoading(&$theme)` and `onThemeLoaded($theme, $themeApiVersion, &$themeConfig)` events
- Enable Twig autoescaping by default
2019-09-22 18:49:37 +02:00
Daniel Rudolf
c1113a780c
Fix @deprecated notice for Pico::getBaseThemeUrl() and AbstractPicoPlugin::__call()
2019-09-12 14:00:58 +02:00
Daniel Rudolf
cd3d3dcec5
Bump API version
...
Due to ad729a99c4b8db986e59d1b2241bef49a394973e and 33117be981aa9c8acb6b3f91c5513e4a266d7a9d
2019-09-12 12:45:35 +02:00
Daniel Rudolf
17aba01513
Various small improvements
2019-09-12 12:42:01 +02:00
Daniel Rudolf
eca06a38a9
phpDoc class docs: Remove superflous @return void
2019-09-12 12:38:59 +02:00
Daniel Rudolf
6e6d80c044
Add Pico::substituteUrl() and url
Twig filter
...
Allows theme developers and users to use URL placeholders like `%base_url%` in meta headers, e.g. to include images.
2019-08-30 16:37:01 +02:00
Daniel Rudolf
715cb83431
Improve class docs of Pico::getBaseThemeUrl() and Pico::getUrlFromPath()
2019-08-29 23:07:16 +02:00
Daniel Rudolf
8d6e9ac31e
Replace file_exists() by is_file()
2019-08-29 23:06:27 +02:00