-
-
Notifications
You must be signed in to change notification settings - Fork 616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pico 2.1 #515
Pico 2.1 #515
Conversation
You can enable Pico's debug mode by setting the PICO_DEBUG environment variable. At the moment this just enables Twig's debug mode.
…::getBaseThemeUrl()
These variables aren't really needed in Twig and can still be accessed using $config
Allows theme developers and users to use URL placeholders like `%base_url%` in meta headers, e.g. to include images.
PHP_CodeSniffer and phpDocumentor are external tools which should never affect Pico's environment, thus we rather use PHARs in the future.
It doesn't really matter how the current Pico instance is injected into the plugin unless PicoPluginInterface::getPico() is implemented
``` * [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()` ```
The first beta release of Pico v2.1 is out now! ➡️ Download Pico Follow Pico's usual install resp. upgrade instructions to try the next minor release of Pico. Feedback is highly appreciated! ❤️ |
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.
Also shows the new image utility classes of Pico's default theme Co-Authored-By: type76 <osmanjaro@gmail.com>
873ca4d
to
6714022
Compare
Unfortunately we must force Composer minimum stability <= beta due to Parsedown 1.8 currently being in beta. Composer AFAIK can't decide this on a per-dependency basis...
``` * [Changed] Add Pico's official logo and tagline to `content-sample/_meta.md` * [Changed] Improve `content-sample/theme.md` to show Pico's official logo and the usage of the new image utility classes of Pico's default theme * [Changed] Improve Pico docs and PHPDoc class docs ```
6714022
to
232a90b
Compare
Pico 2.1 is out now! 🎉 🎊 Follow Pico's usual install resp. upgrade instructions to try the next minor release of Pico! You can find more extensive upgrade instructions as well as a complete list of all changes at http://picocms.org/in-depth/upgrade-pico-21/ ❤️ 💓 ❤️ Have fun running Pico 2.1 - it's small, but mighty! You might also want to give Pico CMS for Nextcloud I really hope the rather reluctant feedback was because there wasn't a single issue to report... 😉 Just to make this clear: Feedback is highly appreciated - always! 👍 |
Pico 2.1 mostly targets the mostly completed rewrite of Pico CMS for Nextcloud (GitHub, Pull Request, Announcement, also see #395), which is going to be a officially supported Pico project. Pico 2.1 is a minor release. This release includes new features, but doesn't break BC with older releases of Pico when using Pico's official
PicoDeprecated
plugin (Pull Request).As always, feedback is highly appreciated!
Related links
PicoDeprecated
pull requestpico-theme
pull requestpico-composer
pull requestcomposer-installer
pull requestMajor changes
pico-theme.yml
(Example), also see Pico's default theme (Pull Request)onThemeLoading
andonThemeLoaded
eventsautoesape
feature by default, old themes and plugins will fall back toautoescape: false
to preserve BC (thanks toPicoDeprecated
)url
Twig filter to replace URL placeholders like%base_url%
in strings (e.g. to be used with a meta variable likeimage: %base_url%/assets/my_image.png
in a Markdown file and{{ meta.image|url }}
in a theme) using the newPico::substituteUrl()
method (phpDoc class docs)pages
Twig function to deal with Pico's page tree; this function replaces the raw usage of thepages
array, which will be deprecated with Pico 3.0; for example,{{ pages() }}
returns the pagessub/index.md
andpage.md
, but notsub/page.md
,{{ pages("blog") }}
returns all pages directly inside thecontent/blog/
directory, and{{ pages(current_page.id) }}
returns all direct child pages of the current page; also seePicoTwigExtension::pagesFunction()
's phpDoc class docs for a more extensive description of the parameters (there will be a in-depth article in the docs about this function to explain its usage)themes_url
,plugins_url
andassets_url
config parameters%config.*%
placeholders for scalar config variables in Markdown filesPico::getNormalizedPath()
function (phpDoc class docs)PicoDeprecated
's functionality is now split into multiple compatibility plugins, allowing a more distinct handling of deprecated featuresToDo
CHANGELOG.md
ofpicocms/Pico
CHANGELOG.md
ofpicocms/pico-deprecated
CHANGELOG.md
ofpicocms/pico-theme
content-sample
directory)pages
Twig functionpicocms/pico-deprecated
repo to build release packagespico-2.1
branches 7 days after releaseResolves #476, Resolves #461, Closes #499, Closes #395, Closes #517