Skip to content

Commit

Permalink
The djet.xyz site itself. Powered by Djet of course.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaare committed Feb 7, 2015
1 parent 607c344 commit 4d22bf4
Show file tree
Hide file tree
Showing 38 changed files with 19,674 additions and 0 deletions.
25 changes: 25 additions & 0 deletions sites/djet.xyz/app.psgi
@@ -0,0 +1,25 @@
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;

use Plack::Builder;

use Djet::Starter;

my $djet = Djet::Starter->new;
my $session_handler = $djet->session_handler;

builder {
enable 'Session', store => $session_handler;
enable 'ConditionalGET';
enable 'Plack::Middleware::AccessLog::Timed', format => '%v %h %l %u %t \"%r\" %>s %b %D';
enable 'Image::Scale', path => qr{^/(img)/}, flags => { fit => 1 };
enable 'Static', path => qr{^/css|fonts|images|js/}, root => './public/', pass_through => 1;
enable 'Static', path => qr{^/css|fonts|images|js/}, root => '../../public/';
enable 'Static', path => qr{^/img/}, root => './public/', pass_through => 1;
enable 'Static', path => qr{^/img/}, root => '../Djet/public/';
mount "/favicon.ico" => Plack::App::File->new(file => 'public/favicon.ico');
mount "/" => $djet->app;
};

28 changes: 28 additions & 0 deletions sites/djet.xyz/etc/djet.conf
@@ -0,0 +1,28 @@
model_name Djet::Model
connect_info dbi:Pg:dbname=djet.xyz
connect_info
connect_info
<connect_info>
AutoCommit 1
RaiseError 1
</connect_info>
template_path templates/
template_suffix .tx
<paths>
<image>
url images
file public/images/
</image>
</paths>
<mail>
transport [ SMTP ]
<transport>
host smtp.djet.xyz
</transport>
</mail>
<djet_config>
payload_class Djetsite::Payload
</djet_config>
fts_config english
environment live
language en
1 change: 1 addition & 0 deletions sites/djet.xyz/etc/djet_local.conf
@@ -0,0 +1 @@
environment dev
50 changes: 50 additions & 0 deletions sites/djet.xyz/lib/Djetsite/Engine/Pod.pm
@@ -0,0 +1,50 @@
package Djetsite::Engine::Pod;

use 5.010;
use Moose;

use Pod::Simple::XHTML;
use Pod::Simple::Search;

extends 'Djet::Engine::Default';
with qw/Djet::Part::List/;

=head1 NAME
Djetsite::Engine::Pod
=head1 DESCRIPTION
Renders pod as web pages for the Djet.xyz site
=head1 METHODS
=head2 to_html
=cut

before to_html => sub {
my $self = shift;
my $stash = $self->stash;
my $search = Pod::Simple::Search->new;

my $module = $self->rest_path || 'Djet::Manual';
return unless my $path = $search->find($module);

my $p = Pod::Simple::XHTML->new;
$p->$_('') for qw(html_header html_footer);
$p->output_string(\my $html);
$p->html_encode_chars('&<>">');
$p->perldoc_url_prefix("./");
$p->index(1);
$p->backlink(1);
$p->parse_file($path);
$stash->{title} = $module;
$stash->{pod} = $html;
};

__PACKAGE__->meta->make_immutable;

# COPYRIGHT

__END__
26 changes: 26 additions & 0 deletions sites/djet.xyz/lib/Djetsite/Payload.pm
@@ -0,0 +1,26 @@
package Djetsite::Payload;

use 5.010;
use Moose;

extends 'Djet::Payload';

with qw/
Djet::Part::Topmenu
/;

=head1 NAME
Jasonic::Payload.
=head1 DESCRIPTION
The payload of Djetsite.
=cut

__PACKAGE__->meta->make_immutable;

# COPYRIGHT

__END__

0 comments on commit 4d22bf4

Please sign in to comment.