Skip to content
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

Merged
merged 74 commits into from
Nov 25, 2019
Merged

Pico 2.1 #515

merged 74 commits into from
Nov 25, 2019

Conversation

PhrozenByte
Copy link
Collaborator

@PhrozenByte PhrozenByte commented Oct 20, 2019

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


Major changes

  • New Pico logo, see Logo proposal #499 🎉
  • Introducing API versioning for Pico themes and theme-specific config (including Twig config and registering meta headers) using the new pico-theme.yml (Example), also see Pico's default theme (Pull Request)
  • Introducing the new onThemeLoading and onThemeLoaded events
  • Pico now enables Twig's autoesape feature by default, old themes and plugins will fall back to autoescape: false to preserve BC (thanks to PicoDeprecated)
  • New url Twig filter to replace URL placeholders like %base_url% in strings (e.g. to be used with a meta variable like image: %base_url%/assets/my_image.png in a Markdown file and {{ meta.image|url }} in a theme) using the new Pico::substituteUrl() method (phpDoc class docs)
  • New pages Twig function to deal with Pico's page tree; this function replaces the raw usage of the pages array, which will be deprecated with Pico 3.0; for example, {{ pages() }} returns the pages sub/index.md and page.md, but not sub/page.md, {{ pages("blog") }} returns all pages directly inside the content/blog/ directory, and {{ pages(current_page.id) }} returns all direct child pages of the current page; also see PicoTwigExtension::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)
  • Introducing the themes_url, plugins_url and assets_url config parameters
  • The use of Parsedown 1.8 and Parsedown Extra 0.8, also see Pico v2.0.5-beta.1 and Footnotes not working in Pico 2 #476 (comment)
  • Introducing %config.*% placeholders for scalar config variables in Markdown files
  • Adding the public Pico::getNormalizedPath() function (phpDoc class docs)
  • PicoDeprecated's functionality is now split into multiple compatibility plugins, allowing a more distinct handling of deprecated features

ToDo

  • Create a beta release of Pico 2.1
  • Update CHANGELOG.md of picocms/Pico
  • Update CHANGELOG.md of picocms/pico-deprecated
  • Update CHANGELOG.md of picocms/pico-theme
  • Update inline docs (i.e. content-sample directory)
  • Update user docs on picocms.org
  • Update upgrade instructions on website
  • Write an in-depth article about the new pages Twig function
  • Enable Travis CI for the picocms/pico-deprecated repo to build release packages
  • Choose a new Pico logo and include it (Logo proposal #499)
  • Delete all pico-2.1 branches 7 days after release

Resolves #476, Resolves #461, Closes #499, Closes #395, Closes #517

You can enable Pico's debug mode by setting the PICO_DEBUG environment variable. At the moment this just enables Twig's debug mode.
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()`
```
@PhrozenByte
Copy link
Collaborator Author

The first beta release of Pico v2.1 is out now!

➡️ Download Pico v2.1.0-beta.1 ⬅️

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.
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
```
@PhrozenByte
Copy link
Collaborator Author

Pico 2.1 is out now! 🎉 🎊

➡️ Download Pico v2.1.0 ⬅️

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 v1.0.0 a try. You can find more info at http://picocms.org/plugins/#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! 👍

@PhrozenByte PhrozenByte deleted the pico-2.1 branch December 2, 2019 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logo proposal Footnotes not working in Pico 2 UTF-8 with BOM integrating Pico in Nextcloud
1 participant