Commit Graph

901 Commits

Author SHA1 Message Date
Daniel Rudolf 3b8d89fa30
composer.json: Adding myself as lead dev 2019-11-11 18:33:22 +01:00
Daniel Rudolf 420ede0daa
composer.json: Remove 'ext-dom' extension
Pico doesn't require 'ext-dom' itself, Parsedown Extra does; Parsedown Extra didn't declare this dependency before, but Parsedown Extra 0.8 finally does.
2019-11-10 17:24:25 +01:00
Daniel Rudolf a04bc6c6b8
Version 2.1.0-beta.1
```
* [New] Add `assets_dir`, `assets_url` and `plugins_url` config params
* [New] Add `%config.*%` Markdown placeholders for scalar config params and the
        `%assets_url%`, `%themes_url%` and `%plugins_url%` placeholders
* [New] Add `content-sample/theme.md` for theme testing purposes
* [New] Introduce API versioning for themes and support theme-specific configs
        using the new `pico-theme.yml` in a theme's directory; `pico-theme.yml`
        allows a theme to influence Pico's Twig config, to register known meta
        headers and to provide defaults for theme config params
* [New] Add `assets_url`, `themes_url` and `plugins_url` Twig variables
* [New] Add `pages` Twig function to deal with Pico's page tree; this function
        replaces the raw usage of Pico's `pages` array in themes
* [New] Add `url` Twig filter to replace URL placeholders (e.g. `%base_url%`)
        in strings using the new `Pico::substituteUrl()` method
* [New] Add `onThemeLoading` and `onThemeLoaded` events
* [New] Add `debug` config param and the `Pico::isDebugModeEnabled()` method,
        cehcking the `PICO_DEBUG` environment variable, to enable debugging
* [New] Add new `Pico::getNormalizedPath()` method to normalize a path; this
        method should be used to prevent content dir breakouts when dealing
        with paths provided by user input
* [New] Add new `Pico::getUrlFromPath()` method to guess a URL from a file path
* [New] Add new `Pico::getAbsoluteUrl()` method to make a relative URL absolute
* [New] #505: Create pre-built `.zip` release archives
* [Fixed] #461: Proberly handle content files with a UTF-8 BOM
* [Changed] Introduce API version 3
* [Changed] Rename `theme_url` config param to `themes_url`; the `theme_url`
            Twig variable and Markdown placeholder are kept unchanged
* [Changed] Update to Parsedown Extra 0.8 and Parsedown 1.8 (both still beta)
* [Changed] Enable Twig's `autoescape` feature by default; outputting a
            variable now causes Twig to escape HTML markup; Pico's `content`
            variable is a notable exception, as it is marked as being HTML safe
* [Changed] Rename `prev_page` Twig variable to `previous_page`
* [Changed] Mark `markdown` and `content` Twig filters as being HTML safe
* [Changed] Add `$singleLine` param to `markdown` Twig filter as well as the
            `Pico::parseFileContent()` method to parse just a single line of
            Markdown input
* [Changed] Add `AbstractPicoPlugin::configEnabled()` method to check whether
            a plugin should be enabled or disabled based on Pico's config
* [Changed] Deprecate the use of `AbstractPicoPlugin::__call()`, use
            `PicoPluginInterface::getPico()` instead
* [Changed] Update to Twig 1.36 as last version supporting PHP 5.3, use a
            Composer-based installation to use a newer Twig version
* [Changed] Add `$basePath` and `$endSlash` params to `Pico::getAbsolutePath()`
* [Changed] Deprecate `Pico::getBaseThemeUrl()`
* [Changed] Replace various `file_exists` calls with proper `is_file` calls
* [Changed] Refactor release & build system
* [Changed] Improve PHP class docs
* [Changed] Various small improvements
* [Removed] Remove superfluous `base_dir` and `theme_dir` Twig variables
* [Removed] Remove `PicoPluginInterface::__construct()`
```
2019-11-04 01:49:11 +01:00
Daniel Rudolf 29f2e95160
Update Pico::VERSION 2019-11-04 01:49:11 +01:00
Daniel Rudolf 58ec760f04
Update CHANGELOG.md 2019-11-04 01:49:11 +01:00
Daniel Rudolf db1c6301e6
Build system: Fix release package deployment 2019-11-04 01:49:03 +01:00
Daniel Rudolf 03d475c31c
Update Pico's sample contents to reflect the changes of Pico 2.1 2019-11-04 00:36:05 +01:00
Daniel Rudolf dec44817a5
Build system: Add $PROJECT_REPO_TAG param to release.sh call 2019-11-03 21:18:28 +01:00
Daniel Rudolf 58f615403e
Refactor Build system
- Separate Travis branch deployment and release deployment stages (also makes `deploy.sh` obsolete)
- Add `clean.sh` and `release.sh` scripts to allow users to create "release" packages locally
- Use `setup/*.sh` scripts to check and install build dependencies (like PHP_CodeSniffer, phpDocumentor and cloc)
- Use `create-release.sh` of `picocms/ci-tools` to create release archives
- Streamline script usage

Use the following to test Pico and to create a "release" package locally:

```sh
cd ~/My-Pico-Workspace/Components/pico

ln -rs ../ci-tools .build/ci-tools

. ./.build/ci-tools/init/local.sh.inc
. ./.build/init.sh.inc

phpcs --standard=.phpcs.xml "$PICO_PROJECT_DIR"

clean.sh
release.sh
```
2019-11-03 20:03:48 +01:00
Daniel Rudolf 7bbd8736d1
Update CHANGELOG.md 2019-10-26 14:09:58 +02: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 3480a520d9
Build system: Use PHP 5.3 to create pre-built release packages
Otherwise Composer downloads a newer version of Twig which isn't compatible with PHP 5.3. Since we don't pin down specific versions of our dependencies, Composer-based installations might use newer versions of Twig which aren't compatible with PHP 5.3. Raising the PHP requirements requires a new major version, something that will definitly happen with Pico 3.0.
2019-10-26 14:00:45 +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 cb3bdd149f
Mark Twig markdown filter as HTML safe 2019-10-24 12:02:23 +02:00
Daniel Rudolf d2573c5df5
Fix $this->config['twig_config'] handling in Pico::loadTheme() 2019-10-20 19:17:42 +02:00
Daniel Rudolf 9c00ac4191
Travis CI: Remove not-yet-released PHP 7.4 2019-10-20 15:54:31 +02:00
Daniel Rudolf b088555d17
Create .github/FUNDING.yml 2019-10-20 15:52:41 +02:00
Daniel Rudolf 1d5aba46af
Support content files with UTF-8 BOM
Resolves #461
2019-10-20 15:16:40 +02:00
Daniel Rudolf d95c9d3708
Add content-sample/theme.md
The purpose of `theme.md` is to aid theme development - on this page you'll find basically every format that is possible with Markdown. If you develop a theme, you should make sure that all examples below show decent. The page doesn't show up in the website's menu due to `hidden: true` in the page's YAML header.
2019-10-12 19:54:06 +02:00
Daniel Rudolf 87bcff1654
Various small improvements 2019-10-12 15:54:05 +02:00
Daniel Rudolf e4e6f0f5f0
Merge branch 'master' into pico-2.1
Conflicts:
	config/config.yml.template
2019-10-12 15:05:02 +02:00
Daniel Rudolf 6ffbbec689
Improve theme API version retrieval 2019-10-12 15:01:16 +02:00
Daniel Rudolf 87ced8c8bd
Improve phpDoc class docs 2019-10-01 13:29:16 +02:00
Daniel Rudolf 7684fc455a
Improve index.php error message for a missing 'vendor/autoload.php' 2019-10-01 13:29:06 +02:00
Daniel Rudolf 92a8a299f8
Travis CI: Add PHP 7.4, improve deployment logging 2019-10-01 13:28:21 +02:00
Daniel Rudolf 681ad27158
🎉 Add Twig pages function
This function should be used most of the time when dealing with Pico's pages array, as it allows one to easily traverse Pico's pages tree (see `Pico::getPageTree()`) to retrieve a subset of Pico's pages array in a very convenient and performant way.
2019-09-22 18:55:35 +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
Robbert c99e3e639d Fixed typo in config.yml (#510) 2019-09-14 22:18:23 +02:00
Daniel Rudolf c1113a780c
Fix @deprecated notice for Pico::getBaseThemeUrl() and AbstractPicoPlugin::__call() 2019-09-12 14:00:58 +02:00
Daniel Rudolf d0b637f686
Build system: Use PHP 5.6 for deployment due to broken phpDocumentor v2.9
phpDocumentor v3.0 (currently in alpha) is broken, too, generating class docs without a single working link
2019-09-12 13:46:22 +02:00
Daniel Rudolf cd3d3dcec5
Bump API version
Due to ad729a99c4 and 33117be981
2019-09-12 12:45:35 +02:00
Daniel Rudolf 17aba01513
Various small improvements 2019-09-12 12:42:01 +02:00
Daniel Rudolf fd97c70502
Deprecated AbstractPicoPlugin::__call() in favour of PicoPluginInterface::getPico() 2019-09-12 12:41:47 +02:00
Daniel Rudolf 581a3a0609
Add AbstractPicoPlugin::configEnabled() 2019-09-12 12:38:59 +02:00
Daniel Rudolf bbccb374de
phpDoc class docs: Use {@inheritDoc} in AbstractPicoPlugin 2019-09-12 12:38:59 +02:00
Daniel Rudolf d72bc24ab3
Remove PicoPluginInterface::__construct()
It doesn't really matter how the current Pico instance is injected into the plugin unless PicoPluginInterface::getPico() is implemented
2019-09-12 12:38:59 +02:00
Daniel Rudolf eca06a38a9
phpDoc class docs: Remove superflous @return void 2019-09-12 12:38:59 +02:00
Daniel Rudolf 56659ab95d
Build system: Don't use Composer for dev dependencies
PHP_CodeSniffer and phpDocumentor are external tools which should never affect Pico's environment, thus we rather use PHARs in the future.
2019-09-12 12:38:56 +02:00
TheTechRobo b1ec1e55e1 Update README.md (#507) 2019-09-03 09:53:45 +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
Daniel Rudolf 641cae849b
Travis CI: Additionally create .zip release archives 2019-08-29 16:42:18 +02:00
Daniel Rudolf c9a3f84673
Sync config/config.yml.template with Pico::loadConfig() 2019-07-14 16:16:57 +02:00
Daniel Rudolf 8c8c6e33f7
composer.json: Remove 3.0.x-dev alias 2019-07-14 15:36:02 +02:00
Daniel Rudolf 6476d6507d
Re-add deprecated Pico::getBaseThemeUrl() to maintain BC 2019-07-14 15:21:12 +02:00
Daniel Rudolf ae82c16369
composer.json: Add 2.1.x-dev alias for pico-2.1 branch 2019-07-14 15:20:39 +02:00
Daniel Rudolf 3eab6c58d0
Bump version to 2.1.0-nightly 2019-07-14 15:19:59 +02:00