Various small improvements
This commit is contained in:
parent
03d466c117
commit
c02e3fa7a4
2 changed files with 10 additions and 9 deletions
|
@ -20,6 +20,7 @@ Pico Changelog
|
|||
Released: 2019-11-03
|
||||
|
||||
```
|
||||
* [New] Introduce API version 3
|
||||
* [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
|
||||
|
@ -35,7 +36,7 @@ Released: 2019-11-03
|
|||
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
|
||||
checking 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
|
||||
|
@ -43,7 +44,6 @@ Released: 2019-11-03
|
|||
* [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)
|
||||
|
@ -51,7 +51,8 @@ Released: 2019-11-03
|
|||
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] Mark `markdown` and `content` Twig filters as well as the `content`
|
||||
variable 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
|
||||
|
@ -65,7 +66,7 @@ Released: 2019-11-03
|
|||
* [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] Improve Pico docs and PHP class docs
|
||||
* [Changed] Various small improvements
|
||||
* [Removed] Remove superfluous `base_dir` and `theme_dir` Twig variables
|
||||
* [Removed] Remove `PicoPluginInterface::__construct()`
|
||||
|
|
|
@ -244,8 +244,8 @@ including images and JavaScript files.
|
|||
|
||||
Please note that Twig escapes HTML in all strings before outputting them. So
|
||||
for example, if you add `headline: My <strong>favorite</strong> color` to the
|
||||
YAML header of your page and output it using `{{ meta.headline }}`, you'll end
|
||||
up seeing `My <strong>favorite</strong> color` - yes, including the markup! To
|
||||
YAML header of a page and output it using `{{ meta.headline }}`, you'll end up
|
||||
seeing `My <strong>favorite</strong> color` - yes, including the markup! To
|
||||
actually get it parsed, you must use `{{ meta.headline|raw }}` (resulting in
|
||||
the expected <code>My **favorite** color</code>). Notable exceptions to this
|
||||
are Pico's `content` variable (e.g. `{{ content }}`), Pico's `content` filter
|
||||
|
@ -257,7 +257,7 @@ marked as HTML safe.
|
|||
There are several ways to access Pico's pages list. You can access the current
|
||||
page's data using the `current_page` variable, or use the `prev_page` and/or
|
||||
`next_page` variables to access the respective previous/next page in Pico's
|
||||
pages list. But more importantly there's the `pages` function. No matter how
|
||||
pages list. But more importantly there's the `pages()` function. No matter how
|
||||
you access a page, it will always consist of the following data:
|
||||
|
||||
* `{{ id }}` - The relative path to the content file (unique ID)
|
||||
|
@ -304,7 +304,7 @@ a page's child pages by passing the `depth`, `depthOffset` and `offset` params.
|
|||
For example, if you pass `pages(depthOffset=-1)`, the list will also include
|
||||
Pico's main index page (i.e. `content/index.md`). This one is commonly used to
|
||||
create a theme's main navigation. If you want to learn more, head over to
|
||||
Pico's complete [`pages` function documentation][FeaturesPagesFunction].
|
||||
Pico's complete [`pages()` function documentation][FeaturesPagesFunction].
|
||||
|
||||
#### Twig filters and functions
|
||||
|
||||
|
@ -317,7 +317,7 @@ even easier.
|
|||
* You can replace URL placeholders (like <code>%base_url%</code>) in
|
||||
arbitrary strings using the `url` filter. This is helpful together with meta
|
||||
variables, e.g. if you add <code>image: %assets_url%/stock.jpg</code>
|
||||
to the YAML header of your page, `{{ meta.image|url }}` will return
|
||||
to the YAML header of a page, `{{ meta.image|url }}` will return
|
||||
`%assets_url%/stock.jpg`.
|
||||
* To get the parsed contents of a page, pass its unique ID to the `content`
|
||||
filter (e.g. `{{ "sub/page"|content }}`).
|
||||
|
|
Loading…
Reference in a new issue