Merged
Conversation
You MUST NOT trigger events of Pico's core through a plugin!
Allows plugins to extend the default template
Closed
Collaborator
|
👍 Also, glad to see some of my ideas in that list. 😉 😄 |
Resolves #330 After loading the `config/config.php`, Pico proceeds with any existing `config/*.config.php` in alphabetical order. The file order is crucial: Config values which has been set already, cannot be overwritten by a succeeding file. This is also true for arrays, i.e. when specifying `$config['test'] = array('foo' => 'bar')` in `config/a.config.php` and `$config['test'] = array('baz' => 42)` in `config/b.config.php`, `$config['test']['baz']` will be undefined
Collaborator
|
I like the modular config implementation (988a23f) (the concept of it, can't really critique the php). My only concern would be that In practice, it would probably work well though. I suppose it'll help enforce a unified naming scheme between developers though. 😆 Anyway, nice work with it. I was expecting a feature like that to take more than one commit! 👍 |
This reverts commit a3fa373. At first glance this adds flexibility, but at the moment it is impossible with Twig to ensure the existance of a block. As a result, custom themes may break the plugin. A custom theme should overwrite a plugin's template explicitly.
Merged
Thanks @tony5 for bringing this up and testing!
…ram Twig functions
This is a follow-up to 80263a9
Thanks to PT on our Freenode IRC channel #picocms for reporting this!
```
* [Changed] Add `README.md`, `CONTRIBUTING.md` and `CHANGELOG.md` of main repo
to pre-bundled releases, keep `.gitignore`
* [Changed] Deny access to a possibly existing `composer.phar` in `.htaccess`
* [Changed] Disallow the use of the `callback` filter for the `url_param` and
`form_param` Twig functions
* [Changed] Improve documentation
* [Fixed] Fix page tree when sorting pages by arbitrary values
* [Fixed] Fix sorting of `Pico::$nativePlugins`
```
stop config.yml on loading again
Conflicts: README.md content-sample/index.md themes/default/font/fontello.eot themes/default/font/fontello.svg themes/default/font/fontello.ttf themes/default/font/fontello.woff themes/default/font/fontello.woff2 themes/default/fontello.css
Collaborator
Author
|
Pico v2.0.0 is out now! (yes, the stable release!) 🎉 See #401 (comment) |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At the moment this PR is "the mother of WORK IN PROGRESS"... 😄
Actually I don't have much to show yet, I'm primarily trying to point to
PhrozenByte/pico-admin. I decided to start with development of the admin plugin, because it may give us some more ideas for Pico1.12.0 (renamed 2016-12-12). Please use this PR to give feedback about the plugin (otherwise the discussion may get a bit fragmented).@theshka: Do you think it makes sense to ask @picocms once again to convert his/her account to an GitHub Organization? This will allow us to use
picocms/pico-admininstead... This is particularly meaningful when bearing in mind that I'm planning to create multiple repositories (picocms/pico-composer,picocms/pico-pagination,picocms/pico-tags,picocms/pico-feeds,picocms/pico-i18n,picocms/pico-search)...Most importantly we have to make a decision about replacing Pico's default theme (see #297) with Pico 2.0 or to defer this until Pico 3.0. What are your opinions about this? (especially, but not solely, @theshka) My objections are primarily related to BC, but I have not formed a opinion about this yet. Please also refer to the "Decisions to make" section below.
Refer to http://picocms.org/phpDoc/pico-1.1/ for updated phpDoc class docs.
Plannings for the more distant future (i.e. Pico 3.0) can be found in #317.
At the moment it's planned to let Pico 3.0 follow Pico 2.0 (i.e. no Pico 2.1).As always, feedback is highly appreciated!
#edit: This release has been renamed to Pico 2.0 (previously Pico 1.1) on 2016-12-12, however we can't rename the branch, thus development will still happen on the
pico-1.1branch.Planned changes to Pico's core
Pico::VERSIONconstantincludePico()function to prevent access to$this/Picoobject in config/plugin files (use composer'sincludeFile()function instead?)*.config.phpfiles, use*.ymlfiles to configure Pico. YAML is much easier to understand, more user friendly and (at least a bit) more error-tolerant, but still very powerful. Don't break BC by lettingPicoDeprecatedstill readconfig/config.php.Parsedowndoesn't support much configuration, probably it will be limited to the optional usage ofParsedowninstead ofParsedownExtra,Parsedown::setBreaksEnabled(),Parsedown::setMarkupEscaped()andParsedown::setUrlsLinked())pico-composerproject to allowcomposerusers to install Pico as dependency and benefit fromcomposer's update mechanism; see @gilbitron's BaunCMS/Baun repoThink about how users can easily install plugins with dependencies when they aren't usingcomposer, but a pre-bundled release404 Not FoundpagePico::is404Content()method returningtruewhenPico::$requestFiledoesn't exist (i.e.on404ContenLoadinghas been triggered)PicoParsePagesContentPicoExcerpt$config['pages_order_by']is specified -- breaks BConMetaHeadersevent only once, cache results ofPico::getMetaHeaders().README.mdto use a screenshot hosted on our websitesort_byTwig filter)Pico::parseFileMeta(). Preserve BC withPicoDeprecated.SomeNotRegisteredKey: foobarin the YAML Frontmatter should result in$meta['SomeNotRegisteredKey'], not$meta['somenotregisteredkey']).Pico::$metaHeadersdate_formatted: Friday, 1st of December, 2000)Planned changes to Pico's plugin system
onSinglePageLoadingevent (new preliminary event toonSinglePageLoaded)$pageparameter of theonSinglePageLoadedevent tonull, don't add this page to$pages(keeping$page['sub/page'] = nullmakes no sense, thus no BC break)DummyPlugin::API_VERSIONconstant with Pico'smajor.minorversion describing which API version the plugin expects; if the constant doesn't exist, assume1.0); this allows us to overhaul the plugin event system in the future without breaking BConParsedownRegisteredevent and pass$parsedown(instance ofParsedown) to allow extendingerusev/parsedownonTwigRegistrationevent withonTwigRegisteredand pass$twig(instance ofTwig_Environment), remove$twigparameter fromonPageRenderingeventPicoDeprecatedifferentiate between legacy levels (i.e. always enable the plugin to e.g. readconfig.phpin Pico's root dir, but trigger deprecated events only when plugins of a specific legacy level are present)Pico::loadPlugin()method)composer.jsonSupport multiple plugin dirsAdd hook/event forPico::getPageUrl()Pico::readPages(), similar to the events of the current pagePicoDeprecated. Seetsort,marcj/topsort.php,haberco/topological-sort-php.onPagesLoadingandonPagesLoadedpassing the unsorted pages array (e.g.onPagesDiscovered).$currentPage,$nextPageand$previousPageparameters from theonPagesLoadedevent, fire a separate event to "publish" themplugins/<plugin name>.php(non-recursive) andplugins/<plugin name>/<plugin name>.php(the class file must be named after the directory) only. Plugins with multiple classes may need to register an autoloader on their own. Also see Should load_plugins() only load plugin_name.php? #203 -- breaks BCPlanned changes to Pico's UI (themes, Twig, routing, …)
Support multiple theme dirstheme_urlconfigurable; the default value should support thatPico::$themesDiris a arbitrary deep sub path ofdirname($_SERVER['SCRIPT_FILENAME'])(i.e.index.phpresp.httpdocsfolder); otherwise fallback tothemes(and notbasename(Pico::$themesDir))Use Twig blocks in default theme (i.e.{% block replace_or_extend_me %}...{% endblock %})$_GETsuperglobal)REQUEST_URI-based URL rewriting to allow a much simpler webserver configuration{{ site_title }}and{{ rewrite_url }}in favour oftheirits{{ config.* }}equivalents.RenameDrop{{ current_page }}to{{ page }}.{{ is_front_page }}(use{% if page.id == "index" %}instead). Preserve BC withPicoDeprecated.array_search()inPico::discoverCurrentPage()walks through all pages anyway).Drop{{ next_page }}and{{ previous_page }}in favor of their resulting{{ page.* }}equivalents (see above). Preserve BC withPicoDeprecated.page.mdandsub/index.md, but notsub/page.md) -- breaks BC (more or less...)_for the page navigation by default (e.g._meta.mdand all files in_collection/are skipped) -- breaks BC (more or less...)Website & Documentation
See picocms/picocms.github.io#18
enhancement/bountysourcebranch)New official plugins/themes
The following plugins won't defer the release of Pico 2.0:
robots.txtandsitemap.xml)