MicroEngine - fast and minimalistic site engine

MicroEngine is a fast, simple and minimalistic site engine. It be created for simple sites, which only share information (maybe in some languages) and has web interface to edit, create and delete pages.

MicroEngine has a good support for i18n. User languages will be detected automatically.

MicroEngine didn’t use database. Information is storage in files and may be cached in memory on engine loading.

It’s ideal for simple homepages.

Install

Depends

MicroEngine used only FastCGI, so your web server must be support it. Apache must has mod_rewrite and mod_fastcgi modules.

# gem install microengine $ cd /SITE/DIR/ $ microengine ./

Apache example config

After install MicroEngine files you must add this information to Apache config file. Note, if .htaccess isn’t support, you must copy content of /PATH/TO/MICROENGINE/ROOT/public/.htaccess in <VirtualHost *> tag.

NameVirtualHost *
<VirtualHost *>
    ServerName YOUR_SITE.COM
    DocumentRoot /PATH/TO/MICROENGINE/ROOT/public/
</VirtualHost>

Security

Note that anyone can catch you admin password in Internet. So change http:// to https:// in admin links to use SSL (if you web server support it).

Layouts

You must always open www.YOUR_SITE.COM/admin/refresh/ after any changing of layout to refresh cache.

Layout contain design and other HTML code, which was repeated in pages. Page contain header and body section, which will be put in layout.

Layout is saved in /layout/LAYOUT_NAME/ dir. This dir must contain layout.rhtml file and YAML files for translations with name like LANG.yaml (LANG is a language code). All translation files must contain language.code and language.title values.

layout.rhtml is a simple ERB file with HTML. You may use Ruby code in <% and %> tags. To insert some variable value use <%= variable %> . See en.wikipedia.org/wiki/ERuby for details.

There are some predefined variables in ERB:

  • header - Will be contain page header. Must be located in <head> tag.

  • body - Will be contain page body. Must be located in <body> tag.

  • languages - Will be contain HTML list with available page translations.

  • translation - Hash with layout translation form YAML files in layout dir.

  • path - path to current page.

Usage

Web interface

To edit or create page open URL www.YOUR_SITE.COM/admin/edit/PATH . You must change PATH to path for you page. For example, if you want to create page www.example.com/films/best/ open www.example.com/admin/edit/films/best/

To delete translation open www.YOUR_SITE.COM/admin/untranslate/PATH?lang=LANG . LANG must be changed to language code of deleting translation. For example, if you want to delete French translation of www.example.com/resume/ page input www.example.com/admin/untranslate/resume/?lang=fr

To delete page (and all translations) open www.YOUR_SITE.COM/admin/delete/PATH .

Manually edit

You must always open www.YOUR_SITE.COM/admin/refresh/ after any file changing to refresh cache.

You can also edit site manually. Site content saved in /content/ dir. ‘layout’ file contain layout name. There are files LANG.body and LANG.header (LANG is a language code) for all translations exists with body and header, respectively.

License

Microengine is licensed under the GNU General Public License version 3. You can read it in LICENSE file or in www.gnu.org/licenses/gpl.html .

Author

Andrey “A.I.” Sitnik <[email protected]>