Rebranding the code, still not made any frontend branding.

This commit is contained in:
sergiotarxz 2023-05-09 03:20:23 +02:00
parent b3e96df1f1
commit b69f3babb7
22 changed files with 194 additions and 166 deletions

View File

@ -1,12 +1,12 @@
package BurguillosInfo;
package OwlcodeTech;
use BurguillosInfo::Controller::Metrics;
use OwlcodeTech::Controller::Metrics;
use Mojo::Base 'Mojolicious', -signatures;
# This method will run once at server start
sub startup ($self) {
my $metrics = BurguillosInfo::Controller::Metrics->new;
my $metrics = OwlcodeTech::Controller::Metrics->new;
$self->hook(
around_dispatch => sub {
my $next = shift;

View File

@ -1,4 +1,4 @@
package BurguillosInfo::Categories;
package OwlcodeTech::Categories;
use v5.34.1;
@ -11,7 +11,7 @@ use Const::Fast;
use Mojo::DOM;
use Path::Tiny;
use BurguillosInfo::Preview;
use OwlcodeTech::Preview;
const my $CURRENT_FILE => __FILE__;
const my $CATEGORIES_DIR =>
@ -45,6 +45,7 @@ sub Retrieve($self) {
my $attributes = $self->_GetAttributes( $dom, $category_file );
my $parent_tag = $dom->at(':root > parent');
my $parent;
if ( defined $parent_tag ) {
$parent = $parent_tag->content;
}
@ -55,9 +56,9 @@ sub Retrieve($self) {
description => $description,
priority => $priority,
(
(defined $parent) ?
(parent => $parent) :
()
( defined $parent )
? ( parent => $parent )
: ()
),
attributes => $attributes,
};
@ -72,17 +73,22 @@ sub _GetAttributes($self, $dom, $category_file) {
my $attributes_tag = $dom->at(':root > attributes');
my %attributes;
if ( defined $attributes_tag ) {
my @attribute_tag_list = $attributes_tag->find('attributes > attribute')->each;
my @attribute_tag_list =
$attributes_tag->find('attributes > attribute')->each;
for my $attribute_tag (@attribute_tag_list) {
defined (my $menu_text = $attribute_tag->at('attribute > menu_text')->content)
defined( my $menu_text =
$attribute_tag->at('attribute > menu_text')->content )
or die "Missing attribute menu_text at $category_file";
defined (my $description = $attribute_tag->at('attribute > description')->content)
defined( my $description =
$attribute_tag->at('attribute > description')->content )
or die "Missing attribute description at $category_file";
defined( my $title = $attribute_tag->at('attribute > title')->text )
or die "Missing attribute title at $category_file";
defined (my $identifier = $attribute_tag->at('attribute > identifier')->text)
defined( my $identifier =
$attribute_tag->at('attribute > identifier')->text )
or die "Missing attribute identifier at $category_file";
defined (my $priority = $attribute_tag->at('attribute > priority')->text)
defined( my $priority =
$attribute_tag->at('attribute > priority')->text )
or die "Missing attribute priority at $category_file";
$attributes{$identifier} = {
title => $title,
@ -106,7 +112,8 @@ sub _PopulateChildrenField($self, $categories) {
}
my $parent = $categories->{$parent_name};
if ( !defined $parent ) {
die "Category $parent not exists and is the parent of $category_name.";
die
"Category $parent not exists and is the parent of $category_name.";
}
$parent->{children} //= [];
push $parent->{children}->@*, $category;
@ -118,7 +125,8 @@ sub _AvoidGrandChildCategories($self, $categories) {
my $category = $categories->{$category_slug};
my $parent = $category->{parent};
if ( defined $parent && defined $categories->{$parent}{parent} ) {
die "$category_slug category is grandchild of $categories->{$parent}{parent}) category and this is not allowed.";
die
"$category_slug category is grandchild of $categories->{$parent}{parent}) category and this is not allowed.";
}
}
}
@ -126,6 +134,8 @@ sub _AvoidGrandChildCategories($self, $categories) {
sub PreviewOg ( $self, $category ) {
my $title = $category->{title};
my $description = $category->{description};
return BurguillosInfo::Preview->Generate($title, $description, undef);
my $site_name = $self->config('site_name');
return OwlcodeTech::Preview->Generate( $title, $description, undef,
$site_name );
}
1;

View File

@ -1,4 +1,4 @@
package BurguillosInfo::Controller::Attribute;
package OwlcodeTech::Controller::Attribute;
use v5.34.1;
use strict;
@ -6,17 +6,18 @@ use warnings;
use Data::Dumper;
use BurguillosInfo::Categories;
use OwlcodeTech::Categories;
use Mojo::Base 'Mojolicious::Controller', -signatures;
use BurguillosInfo::Preview;
use OwlcodeTech::Preview;
sub get_attribute_preview ($self) {
my $category_slug = $self->param('category_slug');
my $attribute_slug = $self->param('attribute_slug');
my $categories = BurguillosInfo::Categories->new->Retrieve;
my $categories = OwlcodeTech::Categories->new->Retrieve;
my $category = $categories->{$category_slug};
my $site_name = $self->config('site_name');
if ( !defined $category ) {
return $self->reply->not_found;
}
@ -27,8 +28,9 @@ sub get_attribute_preview ($self) {
$self->render(
format => 'png',
data => BurguillosInfo::Preview->Generate(
$attribute->{title}, $attribute->{description}, undef
data => OwlcodeTech::Preview->Generate(
$attribute->{title}, $attribute->{description},
undef, $site_name
),
);
}
@ -37,7 +39,7 @@ sub get ($self) {
my $category_slug = $self->param('category_slug');
my $attribute_slug = $self->param('attribute_slug');
my $categories = BurguillosInfo::Categories->new->Retrieve;
my $categories = OwlcodeTech::Categories->new->Retrieve;
my $category = $categories->{$category_slug};
if ( !defined $category ) {
return $self->reply->not_found;
@ -46,8 +48,8 @@ sub get ($self) {
if ( !defined $attribute ) {
return $self->reply->not_found;
}
my $posts = BurguillosInfo::Posts->RetrieveDirectPostsForCategory(
$category->{slug} );
my $posts =
OwlcodeTech::Posts->RetrieveDirectPostsForCategory( $category->{slug} );
$posts = [ grep { defined $_->{attributes}{$attribute_slug} } @$posts ];
my $base_url = $self->config('base_url');
$self->render(

View File

@ -1,4 +1,4 @@
package BurguillosInfo::Controller::Example;
package OwlcodeTech::Controller::Example;
use Mojo::Base 'Mojolicious::Controller', -signatures;
# This action will render a template

View File

@ -1,4 +1,4 @@
package BurguillosInfo::Controller::Metrics;
package OwlcodeTech::Controller::Metrics;
use v5.34.1;
@ -7,7 +7,7 @@ use warnings;
use Data::Dumper;
use BurguillosInfo::Tracking;
use OwlcodeTech::Tracking;
use Mojo::Base 'Mojolicious::Controller', '-signatures';
@ -22,10 +22,15 @@ sub request {
shift;
my $c = shift;
my $app = $c->app;
eval {
if (!defined $tracking) {
$tracking = BurguillosInfo::Tracking->new($app);
$tracking = OwlcodeTech::Tracking->new($app);
}
$tracking->register_request($c);
};
if ($@) {
warn $@;
}
}
sub stats {

View File

@ -1,23 +1,23 @@
package BurguillosInfo::Controller::Page;
package OwlcodeTech::Controller::Page;
use v5.34.1;
use strict;
use warnings;
use BurguillosInfo::Categories;
use BurguillosInfo::Posts;
use OwlcodeTech::Categories;
use OwlcodeTech::Posts;
use Data::Dumper;
use Mojo::Base 'Mojolicious::Controller';
use Mojo::Base 'Mojolicious::Controller', '-signatures';
use DateTime::Format::ISO8601;
use DateTime::Format::Mail;
sub index {
my $self = shift;
my $categories = BurguillosInfo::Categories->new->Retrieve;
my $categories = OwlcodeTech::Categories->new->Retrieve;
my $current_category = $categories->{'index'};
# Render template "example/welcome.html.ep" with message
@ -29,22 +29,24 @@ sub index {
sub category_rss {
my $self = shift;
my $categories = BurguillosInfo::Categories->new->Retrieve;
my $categories = OwlcodeTech::Categories->new->Retrieve;
my $category_name = $self->param('category');
my $current_category = $categories->{$category_name};
my ( $posts_categories, $posts_slug ) =
BurguillosInfo::Posts->new->Retrieve;
OwlcodeTech::Posts->new->Retrieve;
if ( !defined $current_category && $category_name ne 'all' ) {
$self->render( template => '404', status => 404 );
return;
}
my $dom = Mojo::DOM->new_tag( 'rss', version => '2.0', undef );
my $channel_tag = Mojo::DOM->new_tag('channel');
my $base_url = $self->config('base_url');
my $site_name = $self->config('site_name');
if ( $category_name eq 'all' ) {
my $title_tag = Mojo::DOM->new_tag( 'title', 'Burguillos.info' );
my $title_tag = Mojo::DOM->new_tag( 'title', $site_name );
my $description_tag = Mojo::DOM->new_tag( 'description',
'Todas las noticias de Burguillos.info.' );
my $link_tag = Mojo::DOM->new_tag( 'link', 'https://burguillos.info/' );
"Todas las noticias de $site_name." );
my $link_tag = Mojo::DOM->new_tag( 'link', $base_url );
$channel_tag->child_nodes->first->append_content($title_tag);
$channel_tag->child_nodes->first->append_content($description_tag);
$channel_tag->child_nodes->first->append_content($link_tag);
@ -52,19 +54,19 @@ sub category_rss {
my $posts = $posts_categories->{$category};
for my $post (@$posts) {
$channel_tag->child_nodes->first->append_content(
_post_to_rss($post) );
$self->_post_to_rss($post) );
}
}
}
else {
my $category = $current_category;
my $title_tag = Mojo::DOM->new_tag( 'title',
"Burguillos.info - " . $category->{title} );
"$site_name - " . $category->{title} );
my $description_tag = Mojo::DOM->new_tag( 'description',
'Todas las noticias de la categoria de Burguillos.info '
"Todas las noticias de la categoria de $site_name "
. $category->{title} );
my $link_tag = Mojo::DOM->new_tag( 'link',
'https://burguillos.info/' . $category->{slug} );
$base_url . '/' . $category->{slug} );
$channel_tag->child_nodes->first->append_content($title_tag);
$channel_tag->child_nodes->first->append_content($description_tag);
$channel_tag->child_nodes->first->append_content($link_tag);
@ -72,7 +74,7 @@ sub category_rss {
for my $post (@$posts) {
$channel_tag->child_nodes->first->append_content(
_post_to_rss($post) );
$self->_post_to_rss($post) );
}
}
@ -83,12 +85,12 @@ sub category_rss {
);
}
sub _post_to_rss {
my $post = shift;
sub _post_to_rss($self, $post) {
my $item_tag = Mojo::DOM->new_tag('item');
my $title_tag = Mojo::DOM->new_tag( 'title', $post->{title} );
my $base_url = $self->config('base_url');
my $link = Mojo::DOM->new_tag( 'link',
'https://burguillos.info/posts/' . $post->{slug} );
"$base_url/posts/" . $post->{slug} );
my $description = Mojo::DOM->new_tag( 'description',
Mojo::DOM->new( $post->{content} )->all_text );
my $guid = Mojo::DOM->new_tag( 'guid', $post->{slug} );
@ -112,8 +114,8 @@ sub post {
my $self = shift;
my $slug = $self->param('slug');
my ( $posts_categories, $posts_slug ) =
BurguillosInfo::Posts->new->Retrieve;
my $categories = BurguillosInfo::Categories->new->Retrieve;
OwlcodeTech::Posts->new->Retrieve;
my $categories = OwlcodeTech::Categories->new->Retrieve;
my $post = $posts_slug->{$slug};
if ( !defined $post ) {
$self->render( template => '404', status => 404 );
@ -129,7 +131,7 @@ sub post {
sub category {
my $self = shift;
my $categories = BurguillosInfo::Categories->new->Retrieve;
my $categories = OwlcodeTech::Categories->new->Retrieve;
my $category_name = $self->param('category');
my $current_category = $categories->{$category_name};
my $base_url = $self->config('base_url');
@ -148,7 +150,7 @@ sub category {
sub get_category_preview {
my $self = shift;
my $category_slug = $self->param('category');
my $category_model = BurguillosInfo::Categories->new;
my $category_model = OwlcodeTech::Categories->new;
my $categories = $category_model->Retrieve;
if ( !defined $categories->{$category_slug} ) {
$self->render( template => '404', status => 404 );
@ -164,7 +166,7 @@ sub get_category_preview {
sub get_post_preview {
my $self = shift;
my $slug = $self->param('slug');
my $post_model = BurguillosInfo::Posts->new;
my $post_model = OwlcodeTech::Posts->new;
my ( $posts_categories, $posts_slug ) = $post_model->Retrieve;
if ( !defined $posts_slug->{$slug} ) {
$self->render( template => '404', status => 404 );

View File

@ -1,4 +1,4 @@
package BurguillosInfo::Controller::Robots;
package OwlcodeTech::Controller::Robots;
use Mojo::Base 'Mojolicious::Controller', '-signatures';
sub robots($self) {

View File

@ -1,12 +1,12 @@
package BurguillosInfo::Controller::Sitemap;
package OwlcodeTech::Controller::Sitemap;
use v5.34.1;
use strict;
use warnings;
use BurguillosInfo::Categories;
use BurguillosInfo::Posts;
use OwlcodeTech::Categories;
use OwlcodeTech::Posts;
use DateTime::Format::ISO8601;
@ -15,7 +15,7 @@ use XML::Twig;
use Mojo::Base 'Mojolicious::Controller', '-signatures';
sub sitemap ($self) {
my $categories = BurguillosInfo::Categories->new->Retrieve;
my $categories = OwlcodeTech::Categories->new->Retrieve;
my $dom = Mojo::DOM->new_tag(
'urlset',
xmlns => 'http://www.sitemaps.org/schemas/sitemap/0.9',
@ -38,7 +38,7 @@ sub _append_category_dom ( $self, $dom, $category_key, $categories ) {
my $date_last_modification_category;
my ( $posts_categories, $posts_slug ) =
BurguillosInfo::Posts->new->Retrieve;
OwlcodeTech::Posts->new->Retrieve;
for my $post ( $posts_categories->{$category_key}->@* ) {
( $date_publish_category, $date_last_modification_category ) =
_get_dates_for_category( $date_publish_category,

View File

@ -1,4 +1,4 @@
package BurguillosInfo::DB;
package OwlcodeTech::DB;
use v5.34.1;
@ -8,7 +8,7 @@ use warnings;
use DBI;
use DBD::Pg;
use BurguillosInfo::DB::Migrations;
use OwlcodeTech::DB::Migrations;
use Data::Dumper;
my $dbh;
@ -38,7 +38,7 @@ sub _migrate {
my $dbh = shift;
local $dbh->{RaiseError} = 0;
local $dbh->{PrintError} = 0;
my @migrations = BurguillosInfo::DB::Migrations::MIGRATIONS();
my @migrations = OwlcodeTech::DB::Migrations::MIGRATIONS();
if ( $class->get_current_migration($dbh) > @migrations ) {
warn "Something happened there, wrong migration number.";
}

View File

@ -1,4 +1,4 @@
package BurguillosInfo::DB::Migrations;
package OwlcodeTech::DB::Migrations;
use v5.34.1;

View File

@ -1,4 +1,4 @@
package BurguillosInfo::Posts;
package OwlcodeTech::Posts;
use v5.34.1;
@ -10,7 +10,7 @@ use feature 'signatures';
use Data::Dumper;
use MIME::Base64;
use BurguillosInfo::Categories;
use OwlcodeTech::Categories;
use Const::Fast;
use Mojo::DOM;
@ -18,7 +18,7 @@ use Path::Tiny;
use DateTime::Format::ISO8601;
use DateTime;
use BurguillosInfo::Preview;
use OwlcodeTech::Preview;
const my $CURRENT_FILE => __FILE__;
const my $ROOT_PROJECT => path($CURRENT_FILE)->parent->parent->parent;
@ -41,9 +41,7 @@ sub _ReturnCacheFilter {
for my $category ( keys %$cached_posts_by_category ) {
for my $post ( @{ $cached_posts_by_category->{$category} } ) {
my $date_post;
eval {
$date_post = $iso8601->parse_datetime( $post->{date} );
};
eval { $date_post = $iso8601->parse_datetime( $post->{date} ); };
if ($@) {
print Data::Dumper::Dumper $post;
}
@ -113,7 +111,8 @@ sub _GetAttributes($self, $post_file, $dom) {
my $attributes_tag = $dom->at(':root > attributes');
my %attributes;
if ( defined $attributes_tag ) {
my @attribute_list = $attributes_tag->find('attributes > attribute')->map('text')->each;
my @attribute_list =
$attributes_tag->find('attributes > attribute')->map('text')->each;
%attributes = map {
my $identifier = $_;
( $identifier => 1 );
@ -150,11 +149,12 @@ sub Retrieve {
}
my $cache_all_post_categories = {};
sub RetrieveAllPostsForCategory ( $self, $category_name ) {
if ( defined $cache_all_post_categories->{$category_name} ) {
return $cache_all_post_categories->{$category_name};
}
my $categories = BurguillosInfo::Categories->new->Retrieve;
my $categories = OwlcodeTech::Categories->new->Retrieve;
my $category = $categories->{$category_name};
my $posts = $self->RetrieveDirectPostsForCategory($category_name);
for my $child_category ( $category->{children}->@* ) {
@ -163,8 +163,8 @@ sub RetrieveAllPostsForCategory ( $self, $category_name ) {
@{ $self->RetrieveDirectPostsForCategory($child_category_name) };
}
@$posts = sort {
DateTime::Format::ISO8601->parse_datetime($b->{date}) <=>
DateTime::Format::ISO8601->parse_datetime($a->{date})
DateTime::Format::ISO8601->parse_datetime( $b->{date} )
<=> DateTime::Format::ISO8601->parse_datetime( $a->{date} )
} @$posts;
$cache_all_post_categories->{$category_name} = $posts;
return $posts;
@ -172,7 +172,7 @@ sub RetrieveAllPostsForCategory ( $self, $category_name ) {
sub RetrieveDirectPostsForCategory ( $self, $category_name ) {
my ($post_by_category) = $self->Retrieve;
my $categories = BurguillosInfo::Categories->new->Retrieve;
my $categories = OwlcodeTech::Categories->new->Retrieve;
my $category = $categories->{$category_name};
if ( !defined $category ) {
die "$category_name category does not exists";
@ -185,12 +185,12 @@ sub RetrieveDirectPostsForCategory ( $self, $category_name ) {
sub PreviewOg {
my $self = shift;
my $post = shift;
my $site_name = $self->config('site_name');
my $title = $post->{title};
my $content = $post->{content};
my $image_file = $post->{image};
return BurguillosInfo::Preview->Generate($title, $content, $image_file);
return OwlcodeTech::Preview->Generate( $title, $content, $image_file,
$site_name );
}
1;

View File

@ -1,4 +1,4 @@
package BurguillosInfo::Preview;
package OwlcodeTech::Preview;
use v5.36.0;
@ -23,13 +23,14 @@ const my $SVG_HEIGHT => 627;
const my $SVG_EMBEDDED_IMAGE_MAX_WIDTH => 1000;
const my $SVG_EMBEDDED_IMAGE_MAX_HEIGHT => 200;
sub Generate($self, $title, $content, $image_file) {
sub Generate ( $self, $title, $content, $image_file, $site_name ) {
my $dom = Mojo::DOM->new($content);
$content = $dom->all_text;
my $svg =
$self->_GenerateSVGPreview( $title, $self->_DivideTextContentInLines($content), $image_file );
$self->_GenerateSVGPreview( $title,
$self->_DivideTextContentInLines($content),
$image_file, $site_name );
return $self->_SVGToPNG($svg);
}
@ -45,7 +46,7 @@ sub _ToPng($self, $image) {
return path($image);
}
sub _GenerateSVGPreviewHeaderBar($self, $svg, $group) {
sub _GenerateSVGPreviewHeaderBar ( $self, $svg, $group, $site_name ) {
$group->rect(
x => 0,
y => 0,
@ -61,7 +62,6 @@ sub _GenerateSVGPreviewHeaderBar($self, $svg, $group) {
style => { fill => '#F8F8FF' }
);
my $burguillos_logo_png = path( $self->_ToPng($BURGUILLOS_LOGO) );
say $burguillos_logo_png;
say '' . $burguillos_logo_png;
@ -77,10 +77,10 @@ sub _GenerateSVGPreviewHeaderBar($self, $svg, $group) {
x => 60,
y => 40,
style => { 'font-size' => 50, fill => '#f2eb8c' }
)->cdata('Burguillos.info');
)->cdata($site_name);
}
sub _GenerateSVGPreview($self, $title, $content, $image_file) {
sub _GenerateSVGPreview ( $self, $title, $content, $image_file, $site_name ) {
my @content = @$content;
my $svg = SVG->new( width => $SVG_WIDTH, height => $SVG_HEIGHT );
@ -92,7 +92,7 @@ sub _GenerateSVGPreview($self, $title, $content, $image_file) {
}
);
$self->_GenerateSVGPreviewHeaderBar($svg, $group);
$self->_GenerateSVGPreviewHeaderBar( $svg, $group, $site_name );
my $new_y;
@ -153,6 +153,7 @@ sub _DivideTextContentInLines($self, $content) {
}
return \@new_content;
}
sub _AttachImageSVG ( $self, $svg, $image_file ) {
$image_file = $PUBLIC_DIR->child( './' . $image_file );
$image_file = path( $self->_ToPng($image_file) );

View File

@ -1,4 +1,4 @@
package BurguillosInfo::Tracking;
package OwlcodeTech::Tracking;
use v5.34.1;
@ -10,7 +10,7 @@ use feature 'signatures';
use JSON;
use Const::Fast;
use BurguillosInfo::DB;
use OwlcodeTech::DB;
my $app;
@ -22,12 +22,12 @@ EOF
sub new {
my $class = shift;
$app = shift;
my $dbh = BurguillosInfo::DB->connect($app);
my $dbh = OwlcodeTech::DB->connect($app);
return bless {}, $class;
}
sub _add_path ( $self, $url ) {
my $dbh = BurguillosInfo::DB->connect($app);
my $dbh = OwlcodeTech::DB->connect($app);
$dbh->do( <<'EOF', undef, $url );
INSERT INTO paths (path) VALUES($1)
ON CONFLICT (path) DO
@ -36,7 +36,7 @@ EOF
}
sub _update_null_last_seen_paths_if_any ($self) {
my $dbh = BurguillosInfo::DB->connect($app);
my $dbh = OwlcodeTech::DB->connect($app);
$dbh->do( <<'EOF', undef );
UPDATE paths
@ -53,7 +53,7 @@ EOF
sub _register_request_query ( $self, $remote_address, $user_agent,
$params_json, $path, $referer )
{
my $dbh = BurguillosInfo::DB->connect($app);
my $dbh = OwlcodeTech::DB->connect($app);
$dbh->do(
<<'EOF', undef, $remote_address, $user_agent, $params_json, $path, $referer );
INSERT INTO requests(remote_address, user_agent, params, path, referer)
@ -65,7 +65,7 @@ sub register_request {
my $self = shift;
my $c = shift;
my $path = $c->req->url->path;
my $dbh = BurguillosInfo::DB->connect($app);
my $dbh = OwlcodeTech::DB->connect($app);
$self->_add_path($path);
$self->_update_null_last_seen_paths_if_any();
my $remote_address = $c->tx->remote_address;
@ -82,7 +82,7 @@ sub get_global_data {
my $self = shift;
my $c = shift;
my $app = $c->app;
my $dbh = BurguillosInfo::DB->connect($app);
my $dbh = OwlcodeTech::DB->connect($app);
my $data = $dbh->selectrow_hashref( <<"EOF", undef );
SELECT
(
@ -112,7 +112,7 @@ sub get_google_data {
my $self = shift;
my $c = shift;
my $app = $c->app;
my $dbh = BurguillosInfo::DB->connect($app);
my $dbh = OwlcodeTech::DB->connect($app);
my $data = $dbh->selectall_arrayref(<<"EOF", { Slice => {} } );
SELECT paths.path,
(
@ -150,7 +150,7 @@ sub get_data_for_urls {
my $self = shift;
my $c = shift;
my $app = $c->app;
my $dbh = BurguillosInfo::DB->connect($app);
my $dbh = OwlcodeTech::DB->connect($app);
my $data = $dbh->selectall_arrayref( <<"EOF", { Slice => {} } );
SELECT paths.path,
(

View File

@ -4,6 +4,6 @@
"db": {
"database": "example"
},
"base_url": "https://burguillos.info",
"listen": "https:localhost:3555"
"base_url": "https://owlcode.tech",
"listen": "https://localhost:3000"
}

View File

@ -219,6 +219,7 @@ body {
body div.page-contents nav.mobile-foldable, body div.page-contents nav.mobile-foldable.show {
display: none; }
body div.page-contents div.description {
margin-top: auto;
margin-left: 10%;
margin-right: 10%; }
body div.page-contents nav.desktop {

View File

@ -357,6 +357,7 @@ body {
}
div.description {
margin-top: auto;
margin-left: 10%;
margin-right: 10%;
}

View File

@ -8,4 +8,4 @@ use lib curfile->dirname->sibling('lib')->to_string;
use Mojolicious::Commands;
# Start command line interface for application
Mojolicious::Commands->start_app('BurguillosInfo');
Mojolicious::Commands->start_app('OwlcodeTech');

View File

@ -1,6 +1,6 @@
% use Mojo::Util;
% use BurguillosInfo::Categories;
% layout 'default', current_category_slug => undef, categories => BurguillosInfo::Categories->new->Retrieve;
% use OwlcodeTech::Categories;
% layout 'default', current_category_slug => undef, categories => OwlcodeTech::Categories->new->Retrieve;
<div class="description">
<h2>Esta página no existe.</h2>
<p>Si un enlace te ha llevado aquí, reporta el error a <a href="mailto:contact@owlcode.tech">los administradores</a>.</p>

View File

@ -1 +0,0 @@
404.html.ep

View File

@ -0,0 +1,7 @@
% use Mojo::Util;
% use OwlcodeTech::Categories;
% layout 'default', current_category_slug => undef, categories => OwlcodeTech::Categories->new->Retrieve;
<div class="description">
<h2>Esta página no existe.</h2>
<p>Si un enlace te ha llevado aquí, reporta el error a <a href="mailto:contact@owlcode.tech">los administradores</a>.</p>
</div>

View File

@ -4,7 +4,7 @@
% use Mojo::DOM;
% use Mojo::Util;
%
% use BurguillosInfo::Posts;
% use OwlcodeTech::Posts;
%
% my $category = stash 'category';
% my $attribute = stash 'attribute';

View File

@ -5,7 +5,7 @@
% use Mojo::DOM;
% use Mojo::Util;
%
% use BurguillosInfo::Posts;
% use OwlcodeTech::Posts;
%
% my $description_og = '<div>'.$current_category->{description}.'</div>';
% $description_og = Mojo::DOM->new($description_og)->all_text;
@ -26,7 +26,7 @@
<p><a href="<%="/$current_category->{slug}/atributo/$attribute->{identifier}"%>"><%==$attribute->{menu_text}%></a></p>
% }
% }
% my ($category_posts) = BurguillosInfo::Posts->new->RetrieveAllPostsForCategory($current_category->{slug});
% my ($category_posts) = OwlcodeTech::Posts->new->RetrieveAllPostsForCategory($current_category->{slug});
%= include 'page/_list_posts', posts => $category_posts;
<h2>Suscribete a esta categoría.</h2>

View File

@ -3,9 +3,9 @@
% use Mojo::DOM;
% use Mojo::Util;
%
% use BurguillosInfo::Posts;
% use BurguillosInfo::Categories;
% my $categories = BurguillosInfo::Categories->new->Retrieve;
% use OwlcodeTech::Posts;
% use OwlcodeTech::Categories;
% my $categories = OwlcodeTech::Categories->new->Retrieve;
% my $description_og = '<div>'.$post->{content}.'</div>';
% $description_og = Mojo::DOM->new($description_og)->all_text;
% my $base_url = config 'base_url';