Slovo
view release on metacpan or search on metacpan
lib/Slovo/Themes/Malka.pm view on Meta::CPAN
=pod
=encoding utf8
=head1 NAME
Slovo::Themes::Malka - a small theme, using chota.css
=head1 SYNOPSIS
# in etc/slovo.conf
plugins => [
# ...
# Themes. The precedence is depending on the order here.
"Themes::Malka"
# another custom theme
{"Themes::MyTheme" => {templates => ['themes/my_theme' => 'themes/my_theme']}}
],
=head1 DESCRIPTION
Slovo::Themes::Malka is a core plugin which is loaded by defauld during
startup. It contains a __DATA__ section with a set of templates and static
files. It adds itself to the beginning of the
C<<@{$renderer->classes}>>. Also it appends its suggested relative
path C<themes/malka> to the "Themes" select_box in the form for editing domains
C<domove/form.html.ep>. This way the theme can be chosen for use by separate
domains, served by one Slovo instance.
Note that the theme must be inflated first to the respective C<domove> folder
for the selection to work. See L<Slovo::Command::Author::inflate>.
The theme holds templates and static files in its C<<__DATA__>> section.
Templates from C<<__DATA__>> section reduce IO operations during startup time
as the application does not have to load them from separate files. This reduces
the overall execution time when the application is run as a CGI script. This
works well for one-site or multidomain deployments, using the same theme.
The templates and static files can be inflated to separate files and customised
for your own deployment using the command
L<<Slovo::Command::Author::inflate>>. Here is an example with an
internationalized domain name (IDN) - Ñлово.бг (xn--b1arjbl.xn--90ae).
bin/slovo inflate --class Slovo::Themes::Malka -t \
--path domove/xn--b1arjbl.xn--90ae/templates/themes/malka
bin/slovo inflate --class Slovo::Themes::Malka -p \
--path domove/xn--b1arjbl.xn--90ae
=head1 METHODS
The usual method is implemented.
=head2 register
Prepends the class to renderer and static classes and prepends the base path of
the templates from the C<<__DATA__>> section to C<<$conf->{domove_templates}>>,
which is used in the domains form.
=head1 EMBEDDED FILES
Currently this theme embeds the following files. They will be inflated when
using the given example at the end of the L<<DESCRIPTION>>.
@@ celini/execute.html.ep
@@ layouts/site.html.ep
@@ layouts/uprava.html.ep
@@ partials/_beleyazhka.html.ep
@@ partials/_ceyalina.html.ep
@@ partials/_data_type.html.ep
@@ partials/_footer.html.ep
@@ partials/_footer_right.html.ep
@@ partials/_head.html.ep
@@ partials/_header.html.ep
@@ partials/_kniga.html.ep
@@ partials/_lang_menu.html.ep
@@ partials/_left.html.ep
@@ partials/_left_menu_stranici.html.ep
@@ partials/_otgowory.html.ep
@@ partials/_pisanie.html.ep
@@ partials/_pisanie_otkysy.html.ep
@@ partials/_right.html.ep
@@ partials/_wyprosy.html.ep
@@ partials/_zaglawie.html.ep
@@ stranici/templates/dom.html.ep
@@ stranici/execute.html.ep
@@ auth/form.html.ep
@@ layouts/uprava.html.ep
@@ css/malka/chota_all_min.css
@@ css/malka/site.css
@@ css/malka/email-fast-outline.svg
@@ css/malka/facebook.svg
@@ css/malka/icons8-telegram-app.svg
@@ css/malka/linkedin.svg
@@ css/malka/reddit.svg
@@ css/malka/twitter.svg
@@ css/malka/login.svg
@@ css/malka/logout.svg
=head1 SEE ALSO
L<Mojolicious::Guides::Tutorial/Stash and templates>,
L<Mojolicious/renderer>,
L<Mojolicious::Renderer>,
L<Mojolicious::Guides::Rendering/Bundling assets with plugins>,
L<Slovo::Command::Author::inflate>
=cut
__DATA__
@@ celini/execute.html.ep
<!-- celini/execute -->
<!-- from __DATA__ -->
<!-- <%=$domain->{templates} %> -->
<%
my $left = $celini->grep(sub { $_->{box} =~ /left|лѣво/ }) // '';
my $right = $celini->grep(sub { $_->{box} =~ /right|дѣÑно/ }) // '';
my $page_title = shift @$celini;
( run in 0.677 second using v1.01-cache-2.11-cpan-5511b514fd6 )