From d885677fea26be82c27bb26130169d3111df7cc5 Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Thu, 26 Oct 2023 14:35:51 +0100 Subject: [PATCH] Add docs. Bump version. Update change log --- Changes.md | 7 +++++++ bin/aphra | 34 +++++++++++++++++++++++++++++++++- lib/App/Aphra.pm | 4 ++-- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/Changes.md b/Changes.md index 7158ebb..08f5081 100644 --- a/Changes.md +++ b/Changes.md @@ -1,5 +1,12 @@ # Change Log +## [0.0.7] - 2023-10-26 + +### Added + +- Support for `site.yml` +- Support for front matter in templates + ## [0.0.6] - 2020-12-06 ### Fixed diff --git a/bin/aphra b/bin/aphra index abc2a0f..db3de53 100755 --- a/bin/aphra +++ b/bin/aphra @@ -197,6 +197,38 @@ directory: docs/style.css docs/about/index.html +=head1 SITE CONFIGURATION FILE - site.yml + +You can store site-wide configuration and data in a file called C, +which should be in the same directory as the various directories discussed +above. + +The file is in YAML format. Any variables defined inside this file will be +available inside your templates within the `site` variable. For example, your +`site.yml` could contain the following definition: + + name: My Cool Site + +And you could access that text inside your templates with markup like this: + +

<% site.name %>

+ +=head1 FRONT MATTER IN INDIVIDUAL PAGES + +At the start of the template for a page, you can add a data section which +contains variable defintions. This section is preceded and followed by lines +consisting of three dashed. The variables are defined using YAML format. The +variables defined in this section are available within templates by using the +`page` variable. For example, your template could start with this definition: + + --- + title: Important Page + --- + +And you could access that text inside your templates with markdown like this: + + ## <% page.title %> + =cut use strict; @@ -213,7 +245,7 @@ Dave Cross =head1 COPYRIGHT AND LICENCE -Copyright (c) 2017, Magnum Solutions Ltd. All Rights Reserved. +Copyright (c) 2017-2023, Magnum Solutions Ltd. All Rights Reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/lib/App/Aphra.pm b/lib/App/Aphra.pm index ac32c37..43530c2 100644 --- a/lib/App/Aphra.pm +++ b/lib/App/Aphra.pm @@ -37,7 +37,7 @@ use YAML::XS 'LoadFile'; use App::Aphra::File; -our $VERSION = '0.0.6'; +our $VERSION = '0.0.7'; has commands => ( isa => 'HashRef', @@ -243,7 +243,7 @@ Dave Cross =head1 COPYRIGHT AND LICENCE -Copyright (c) 2017, Magnum Solutions Ltd. All Rights Reserved. +Copyright (c) 2017-2023, Magnum Solutions Ltd. All Rights Reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.