Personal Content Management System using raw file storage, templating and markdown content in a modular way
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
libs
plugins
themes
.gitignore
.gitmodules
LICENSE
README.md
chrono.php
files.php
hooks.php
markdown.php
wxy.php

README.md

wxy

Personal Content Management System using raw file storage, templating and markdown content in a modular way

About wxy

wxy is built upon PicoCMS modular file-based content management system:

  • Modular: plugins can hook to each of the main parts of the page generation
  • Simple: make it as simple as possible, but not simpler; less is more
  • File-based: no database is required, files store what they should, such as images, text (markdown) or parameters (json)
  • Templated: use of Twig templates

Page cycle

  1. Plugin loading: the many different plugins are loaded
  2. Configuration loading: the configuration is loaded (resolution from the url)
  3. Url request treatment: the routing is made (plugins can do big work here)

Unless any plugin decides to take over the content processing, the page is then generated by 4. parsing the necessary content, 5. creating an index and 6. generating the page from the template.

Page hooks

  • plugins_loaded(HookEnvironment &$env)
  • config_loaded(array &$config)
  • request_url(string &$route)
  • content loading
    • before_load_content(string &$file)
    • after_load_content(string &$file, string &$content)
    • before_404_load_content(string &$file)
    • after_404_load_content(string &$file, string &$content)
  • metadata-related
    • before_file_meta(string $content, array &$headers)
    • get_file_meta(string $content, array &$headers, array &$meta)
    • after_file_meta(string $content, array &$meta)
  • parsing-related
    • before_parse_content(string &$content)
    • parse_content(string $content, string &$new_content)
    • after_parse_content(string &$new_content)
  • indexing-related
    • get_index(string $file, HookEnvironment $env, array &$index)
    • after_index(array &$index, array &$current, array &$prev, array &$next)
    • indexing_content(string $file, array $headers, array &$data)
    • after_indexing_content(array &$data, array $meta)
  • twig-related
    • before_twig_register()
    • before_render(array &$twig_vars, TwigEnvironment &$twig, string &$template)
    • after_render(string &$output)

Plugins can register new hooks (which they should do early such as in plugins_loaded(&$env)).

Plugin resolution

Plugins are resolved from the deepest level down to the root directory in their plugins directory. The order is enforced and plugins can prevent lower-level plugins to act by blocking the next plugins effects for the current hook. To do so, just return a TRUE value in your hook function.

For example, these are potential plugins in their resolution order for the file /1989/february/15/toto:

  1. /1989/february/15/plugins/
  2. /1989/february/plugins/
  3. /1989/plugins/
  4. /plugins/

Note that if your wxy.php is in a different directory than your document root folders, then the resolution is done first in the aforementioned order and then as well for the plugin directory of wxy.php. If the script directory is in /var/www/wxy/wxy.php, then /var/www/wxy/plugins is resolved at the end.

Themes

  • light - light single-column responsive theme
  • index - photo gallery index theme

Plugins

TODO

  • Add plugin for media management (uploading files)