Themes

Themes in PRSS are responsible for the rendering of your post and site data. As of this early release, themes are React-based, although more parsers may be added in the future.


Available themes


How to install a theme

  • In your Site Dashboard, press the "Themes" button.
  • In the Themes page, press the plus button (  ).
    Themes
  • Press "Yes" in the popup that appears. This will open your local Themes directory.
  • Drag and drop any new theme builds to that directory.
    A "theme build" is a directory you'd find under the "build" directory of a theme.
    Click here for an example.
  • In the Themes page, press the refresh button (  ). Then, click your newly added theme to select it.


How do themes work?

PRSS Process

When your site is built (i.e.: Save & Build, Preview or Publish processes), your post and site information is combined into a single object that we call "bufferItem" (this object fuels the variables functionality).

This object is then passed to the "Parser" specified by the theme manifest (which as of now is a React parser). The parser fetches the theme's template files and parses the content in order to generate html and js files. These built files are sent to the "Buffer" (buffer directory) to be used for Previewing or Publishing.

PRSS sites are not server-rendered (to avoid theme code from being executed locally). Instead, the "bufferItem" object we mentioned is passed as prop to the themes for browser-rendering.

As an example, check out the code for the Press theme's Homepage template:

https://github.com/prss-io/press-theme/blob/master/src/home/index.tsx