tl;dr
- π¨ Breaking change:
"phenomic/lib/content-loader"
should now be replaced
by a value imported from"phenomic"
(import { phenomicLoader } from "phenomic"
).
Following this, phenomic loader configuration should be directly in
phenomic section, notphenomic.loader
orphenomic.contentLoader
. - π New feature: dynamic pages! You now have the ability to generate
pages for all metadata used in your text files.
This can be used to generate pages for tags, categories, authors etc.
(Pagination is not handled yet, but will be in a near future). - π New feature: phenomic loader now supports plugins.
Lots of flexibility has been added with this feature,
unlocking a lot of possibilities!
π Examples of update and changes:
- Example of update from Phenomic 0.15 to 0.16
- Example of implementation of some tags and authors pages
βΉοΈ Some works has been done on the documentation:
- βΊοΈ A new Getting started has been
crafted. Please tell us what you think about it! - π€ We also have updated the Showcase page where
you can filter projects by tags. - β€οΈ Do not hesitate to submit your website/app made with Phenomic!
Details
-
Changed: default markdown renderer updated to
remark-autolink-headings@^4.0.0
.
This might fix issue with missing links for headings. -
Changed: default markdown renderer updated to
remark-highlight.js@^4.0.0
This might fix issue with broken highlighted code. -
Changed:
phenomic/lib/content-loader
reference is deprecated in favor of
import { phenomicLoader } from "phenomic"
.
You can usephenomicLoader
variable in webpack configuration to reference
Phenomic loader. This change allows us more flexibility for the location of
the code.
(@MoOx) -
Changed: loader will now read loader configuration directly from
phenomic
section, not inphenomic.loader
orphenomic.contentLoader
-
Removed:
renderer
option fromcontent-loader
(nowphenomicLoader
).
See the newplugins
option below for more information.
If you want to do the same effect, you can use the following pluginsimport { phenomicLoader, phenomicLoaderPlugins } from "phenomic" // ... phenomic: { // ... plugins: [ // this 3 default plugin can be replaced by the a preset. More info below phenomicLoaderPlugins.initHeadPropertyFromConfig phenomicLoaderPlugins.initHeadPropertyFromContent phenomicLoaderPlugins.initBodyPropertyFromContent phenomicLoaderPlugins.markdownInitHeadDescriptionPropertyFromContent // optional, now you can replace this if you don't use markdown! // phenomicLoaderPlugins.markdownTransformBodyPropertyToHtml // the commented plugin above is the default renderer // here is an example that can be used like the old renderer // method ({ result }) => { // the difference here, is you need to return the entire new // (modified) result. // The `body` part is what your are looking for return { ...result, body: doYourThing(result.body), } } ] }
-
Removed:
raw
andrawBody
properties from page data.
If you want those back, there are plugins ready for you:import { phenomicLoader, phenomicLoaderPlugins, phenomicLoaderPresets, } from "phenomic" // ...then in the webpack config phenomic: { plugins: [ ...phenomicLoaderPresets.default, ...phenomicLoaderPresets.markdown, phenomicLoaderPlugins.initRawPropertyFromContent, phenomicLoaderPlugins.initRawBodyPropertyFromContent, ] }
See the new
plugins
option below for more information.
(#547 - @MoOx) -
Added:
plugins
option for the phenomic loader.
This option allow more flexibility on how to handle and transform
input passed to it.
By default, almost the same behavior as before is executed via the following plugins:plugins: [ phenomicLoaderPlugins.initHeadPropertyFromConfig, phenomicLoaderPlugins.initHeadPropertyFromContent, phenomicLoaderPlugins.initBodyPropertyFromContent, phenomicLoaderPlugins.markdownInitHeadDescriptionPropertyFromContent, phenomicLoaderPlugins.markdownTransformBodyPropertyToHtml, ]
See the configuration section in the documentation to know more how to customize this.
If you want just add more plugins for specific behavior (and so keep
the default plugins), you can spread some plugins/presets.
(see documentation for more informations).
(#260 - @MoOx) -
Added:
"phenomic"
package now exposes new valuesphenomicLoader
(ex "phenomic/lib/content-loader")phenomicLoaderPlugins
, the list of all available pluginsphenomicLoaderPresets
, that containsdefault
andmarkdown
presets
(see documentation for more informations).
(@MoOx)
-
Added: More routes can be pre-rendered! Previously, only files consumed
viaphenomic-loader
(formercontent-loader
) where generated as HTML.
Now your routes are consumed and pre-rendered when possible!
This is super convenient to define pages that will list content by tags,
categories, authors etc!
Here is a simple example to add pages for each tags by editing
web_modules/app/routes.js
(if you still use default location):export default ( <Route component={ LayoutContainer }> <Route path="tag/:tag" component={ ContainerThatWillListPostByTag } /> <Route path="*" component={ PageContainer } /> </Route> )
Obviously, you will need to define
ContainerThatWillListPostByTag
(and find a better name for it).
Here is an example on a website that implemented this:
β Example of implementation of some tags and authors pages.
Please check out "Routing" section in the docs for more details.
Good news: pagination is on the roadmap!
(@MoOx)
Boilerplate
- Fixed: (boilerplate)
postcss-browser-reporter
was added on production
only when it should have been the opposite!
(@MoOx) - Changed: (boilerplate) LayoutContainer now import global CSS first
(#571 - @AdamQuadmon) - Changed: (boilerplate)
content-loader
reference is now in a variable
that can be imported (import { phenomicLoader } from "phenomic"
)
(@MoOx)