Saisho / Usage and Installation guide

Saishō may not be the most straightforward "engine" but since it's very simple, getting it up and running how you'd like isn't hard (Of course, if you feel like any basic functionality is missing, please do open a ticket).

Read about configuration, displaying content, config values or my notes.

Web server configuration

Saishō requires all requests to be routed through index.php.

nginx - The following directive has to be used:

location / {
  try_files $uri $uri/ /index.php$is_args$args;
}

Apache - under .htaccess:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

Note: I personally do not use Apache, so I'm hoping this information is correct.

Saishō configuration

At least currently, Saishō is very simple to configure. Config.php file should be self-explanatory.

Templates and displaying content

Template tags

Template tags are surrounded by curly braces. Currently available template tags are title, description and content.

Where

In order to distinguish which page is displaying, please use $this->where e.g.:

<?php if ( $this->where === 'page' ): ?>
  <div class="content">
    {content}
  </div>
<?php endif; ?>

Currently, the available values are home, page and not-found.

Listing

To get a list of pages, you would use $this->get_list( string $sortby = 'by_date', string $order = 'desc', bool $metadata = true ), e.g:

$page_list = $this->get_list( 'by_date','asc' );
foreach ( $page_list as $page ) {
    echo '<div class="entry">';
    echo '<a href="' . $page['url'] . '">' . $page['metadata']['title'] . '</a>' . (( $page['metadata']['date'] )? ' &mdash;<span class="g"> ' . $page['metadata']['date'] : '') . '</span>';
    echo '</div>';
}

Config values

You can get config values like site_name and logo through $this->config, e.g.:

<div class="footer">
  <img style="width:32px;height:auto;" src="<?php echo $this->config->logo; ?>">
</div>

Notes (and known issues)

1.419ms