diff --git a/content/categories/comercios.xml b/content/categories/comercios.xml index e9947b5..a428f1c 100644 --- a/content/categories/comercios.xml +++ b/content/categories/comercios.xml @@ -2,6 +2,7 @@ Comercios de Burguillos.

Aquí puedes encontrar información acerca de los comercios de Burguillos.

+

¿Quieres que tu comercio aparezca aquí? Contacta con contact@owlcode.tech

2 Comercios diff --git a/content/categories/esta-pagina.xml b/content/categories/esta-pagina.xml index af2f20d..9e8851f 100644 --- a/content/categories/esta-pagina.xml +++ b/content/categories/esta-pagina.xml @@ -6,7 +6,7 @@

Esta página es software libre, puedes tomar cualquier parte del código de la página para tu propia web o programa mientras cumplas con la licencia AGPLv3 or later, puedes encontrar su código aquí.

- 3 + 999 Esta página esta-pagina diff --git a/content/categories/talleres.xml b/content/categories/talleres.xml new file mode 100644 index 0000000..a2d4d26 --- /dev/null +++ b/content/categories/talleres.xml @@ -0,0 +1,10 @@ + + Talleres en Burguillos. + +

Aquí puedes encontrar información acerca de los talleres y actividades disponibles en Burguillos.

+

¿Quieres que tu taller o actividad aparezca aquí? Contacta con contact@owlcode.tech

+
+ 3 + Talleres + talleres +
diff --git a/content/posts/0000008-taller-de-macrame.xml b/content/posts/0000008-taller-de-macrame.xml new file mode 100644 index 0000000..929f634 --- /dev/null +++ b/content/posts/0000008-taller-de-macrame.xml @@ -0,0 +1,25 @@ + + Burguillos.info + 2022-11-14T12:00+00:00 + Últimas plazas para Taller de Macrame. + Últimas plazas para Taller de Macrame. + talleres + + ultimas-plazas-taller-de-macrame + + Poster del taller + +

Ultima hora, nos hemos enterado de un taller de Macramé planeado para el 26 de Noviembre de 10:00 a 18:00 en la Mercería la Gallina Costurera localizada en Avenida Pepe Luna.

+

El taller está organizado por Maka Guijo y costará 45€ por persona.

+ +

Los materiales vienen incluidos con el precio de la plaza.

+ +

Si os preguntáis.-¿Qué es el Macramé?.- No os angustieis que yo os lo cuento.

+

Según Wikipedia, el Macramé es la técnica de crear tejidos mediante el uso de nudos decorativos.

+ +

Usando Macramé puedes crear regalos preciosos para tus familiares o amigos; o incluso quedarte tú con tu obra para exponerla, en el cartel se puede apreciar algunas de las cosas que se pueden realizar mediante el uso de Macramé.

+ +

Si quieres pasar un buen rato y divertirte con este peculiar estilo de artesanía no dudes en contactar con 611 489 981, no esperes hasta el último momento ya que las plazas son limitadas.

+ +
+
diff --git a/lib/BurguillosInfo/Posts.pm b/lib/BurguillosInfo/Posts.pm index 21face8..44424f1 100644 --- a/lib/BurguillosInfo/Posts.pm +++ b/lib/BurguillosInfo/Posts.pm @@ -12,6 +12,7 @@ use Const::Fast; use Mojo::DOM; use Path::Tiny; use DateTime::Format::ISO8601; +use DateTime; use SVG; use Capture::Tiny qw/capture/; @@ -25,8 +26,6 @@ const my $SVG_HEIGHT => 627; const my $SVG_EMBEDDED_IMAGE_MAX_WIDTH => 1000; const my $SVG_EMBEDDED_IMAGE_MAX_HEIGHT => 200; -my $iso8601 = DateTime::Format::ISO8601->new; - my $cached_posts_by_category; my $cached_posts_by_slug; @@ -34,9 +33,30 @@ sub new { return bless {}, shift; } +sub _ReturnCacheFilter { + my $self = shift; + my %posts_by_category_filtered; + my %posts_by_slug_filtered; + my $iso8601 = DateTime::Format::ISO8601->new; + my $current_date = DateTime->now; + for my $category ( keys %$cached_posts_by_category ) { + for my $post ( @{ $cached_posts_by_category->{$category} } ) { + my $date_post = $iso8601->parse_datetime( $post->{date} ); + if ( $date_post > $current_date ) { + next; + } + $posts_by_slug_filtered{ $post->{slug} } = $post; + $posts_by_category_filtered{ $post->{category} } //= []; + push @{ $posts_by_category_filtered{ $post->{category} } }, $post; + } + } + return (\%posts_by_category_filtered, \%posts_by_slug_filtered); +} + sub Retrieve { + my $self = shift; if ( defined $cached_posts_by_category && defined $cached_posts_by_slug ) { - return ( $cached_posts_by_category, $cached_posts_by_slug ); + return $self->_ReturnCacheFilter; } $cached_posts_by_category = {}; $cached_posts_by_slug = {}; @@ -59,10 +79,11 @@ sub Retrieve { my $content = $dom->at(':root > content')->content or die "Missing content at $post_file."; my $image_element = $dom->at(':root > img'); - my $image; - if (defined $image_element) { - $image = $image_element->attr->{src}; - } + my $image; + + if ( defined $image_element ) { + $image = $image_element->attr->{src}; + } my $post = { title => $title, @@ -79,7 +100,7 @@ sub Retrieve { $cached_posts_by_slug->{$slug} = $post; push @$category_posts, $post; } - return ( $cached_posts_by_category, $cached_posts_by_slug ); + return $self->_ReturnCacheFilter; } sub PostPreviewOg { @@ -137,20 +158,20 @@ sub _AttachImageSVG { my ( $width, $height ) = $stdout =~ /^"(\d+)x(\d+)"$/; if ( $height > $SVG_EMBEDDED_IMAGE_MAX_HEIGHT ) { $width /= $height / $SVG_EMBEDDED_IMAGE_MAX_HEIGHT; - $width = int($width); + $width = int($width); $height = $SVG_EMBEDDED_IMAGE_MAX_HEIGHT; } if ( $width > $SVG_EMBEDDED_IMAGE_MAX_WIDTH ) { $height /= $width / $SVG_EMBEDDED_IMAGE_MAX_WIDTH; - $height = int($height); - $width = $SVG_EMBEDDED_IMAGE_MAX_WIDTH; + $height = int($height); + $width = $SVG_EMBEDDED_IMAGE_MAX_WIDTH; } - my $x = int(($SVG_WIDTH/2) - ($width / 2)); - my $y = 90; + my $x = int( ( $SVG_WIDTH / 2 ) - ( $width / 2 ) ); + my $y = 90; my ($output) = capture { - system qw/file --mime-type/, $image; + system qw/file --mime-type/, $image; }; my ($format) = $output =~ /(\S+)$/; $svg->image( @@ -158,8 +179,7 @@ sub _AttachImageSVG { y => $y, width => $width, height => $height, - -href => "data:$format;base64," - . encode_base64( $image->slurp ) + -href => "data:$format;base64," . encode_base64( $image->slurp ) ); return $y + $height + 50; } diff --git a/public/img/poster-macrame-preview.png b/public/img/poster-macrame-preview.png new file mode 100644 index 0000000..667c01a Binary files /dev/null and b/public/img/poster-macrame-preview.png differ diff --git a/public/img/poster-macrame.png b/public/img/poster-macrame.png new file mode 100644 index 0000000..1bb8e85 Binary files /dev/null and b/public/img/poster-macrame.png differ