jflepp/picopagefolders

Turns every page into a folder. Enables multilanguage support and thumbnail creation

Installs: 70

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 0

Type:pico-plugin

0.0.8 2019-03-29 12:26 UTC

This package is auto-updated.

Last update: 2024-04-29 04:12:46 UTC


README

Latest Stable Version Total Downloads

PicoPageFolders is a plugin for Pico which provides MultiLanguage support. Pages are being separated into folders, the file names are being used as their language.

This plugin features a 100% CodeCoverage (wrappers excluded), separated in Unit and Integration Tests.

Pull Requests are welcome!

Features

  • Organize multiple languages in a folder
  • URL rewriting
  • Additional twig variables
  • Skip loading of not needed pages
  • Adjusted Index and 404 pages

Installation

Install via composer: composer require jflepp/picopagefolders

Creating multi language pages

content
|
|- 404
   |- en.md
   |- de.md
|- index
   |- en.md
   |- de.md
|- sites
   |- articles
      |- Page1
         |- de.md
         |- en.md
Pages:
- index: /
- index-de: /?lang=de
- sites/articles/Page1
- sites/articles/Page1?lang=de

Additional variables

  • index_page - current page
  • language - current language
  • other_languages - other languages available with links (key-value)

examples

Display other languages

{% for lang,page in other_languages %}
    <li>{{ lang }} - <a href="{{ page }}">{{ page }}</a></li>
{% endfor %}