-
-
Notifications
You must be signed in to change notification settings - Fork 615
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.0 #334
Pico 2.0 #334
Conversation
You MUST NOT trigger events of Pico's core through a plugin!
Allows plugins to extend the default template
👍 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
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.
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
Pico v2.0.0 is out now! (yes, the stable release!) 🎉 See #401 (comment) |
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-admin
instead... 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.1
branch.Planned changes to Pico's core
Pico::VERSION
constantincludePico()
function to prevent access to$this
/Pico
object in config/plugin files (use composer'sincludeFile()
function instead?)*.config.php
files, use*.yml
files 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 lettingPicoDeprecated
still readconfig/config.php
.Parsedown
doesn't support much configuration, probably it will be limited to the optional usage ofParsedown
instead ofParsedownExtra
,Parsedown::setBreaksEnabled()
,Parsedown::setMarkupEscaped()
andParsedown::setUrlsLinked()
)pico-composer
project to allowcomposer
users 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 Found
pagePico::is404Content()
method returningtrue
whenPico::$requestFile
doesn't exist (i.e.on404ContenLoading
has been triggered)PicoParsePagesContent
PicoExcerpt
$config['pages_order_by']
is specified -- breaks BConMetaHeaders
event only once, cache results ofPico::getMetaHeaders()
.README.md
to use a screenshot hosted on our websitesort_by
Twig filter)Pico::parseFileMeta()
. Preserve BC withPicoDeprecated
.SomeNotRegisteredKey: foobar
in the YAML Frontmatter should result in$meta['SomeNotRegisteredKey']
, not$meta['somenotregisteredkey']
).Pico::$metaHeaders
date_formatted: Friday, 1st of December, 2000
)Planned changes to Pico's plugin system
onSinglePageLoading
event (new preliminary event toonSinglePageLoaded
)$page
parameter of theonSinglePageLoaded
event tonull
, don't add this page to$pages
(keeping$page['sub/page'] = null
makes no sense, thus no BC break)DummyPlugin::API_VERSION
constant with Pico'smajor
.minor
version 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 BConParsedownRegistered
event and pass$parsedown
(instance ofParsedown
) to allow extendingerusev/parsedown
onTwigRegistration
event withonTwigRegistered
and pass$twig
(instance ofTwig_Environment
), remove$twig
parameter fromonPageRendering
eventPicoDeprecate
differentiate between legacy levels (i.e. always enable the plugin to e.g. readconfig.php
in Pico's root dir, but trigger deprecated events only when plugins of a specific legacy level are present)Pico::loadPlugin()
method)composer.json
Support 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
.onPagesLoading
andonPagesLoaded
passing the unsorted pages array (e.g.onPagesDiscovered
).$currentPage
,$nextPage
and$previousPage
parameters from theonPagesLoaded
event, 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_url
configurable; the default value should support thatPico::$themesDir
is a arbitrary deep sub path ofdirname($_SERVER['SCRIPT_FILENAME'])
(i.e.index.php
resp.httpdocs
folder); otherwise fallback tothemes
(and notbasename(Pico::$themesDir)
)Use Twig blocks in default theme (i.e.{% block replace_or_extend_me %}...{% endblock %}
)$_GET
superglobal)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.md
andsub/index.md
, but notsub/page.md
) -- breaks BC (more or less...)_
for the page navigation by default (e.g._meta.md
and all files in_collection/
are skipped) -- breaks BC (more or less...)Website & Documentation
See picocms/picocms.github.io#18
enhancement/bountysource
branch)New official plugins/themes
The following plugins won't defer the release of Pico 2.0:
robots.txt
andsitemap.xml
)