Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions web/landing/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ build/
vendor/
var/
public/assets
public/images/blog/social/
public/images/work-shop/social/
public/pagefind
public/*.xml
!public/BingSiteAuth.xml
4 changes: 3 additions & 1 deletion web/landing/config/bundles.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Expand Down
4 changes: 3 additions & 1 deletion web/landing/config/preload.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

if (\file_exists(\dirname(__DIR__) . '/var/cache/prod/Flow_Website_KernelProdContainer.preload.php')) {
require \dirname(__DIR__) . '/var/cache/prod/Flow_Website_KernelProdContainer.preload.php';
Expand Down
22 changes: 22 additions & 0 deletions web/landing/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,28 @@ services:
arguments:
$githubToken: '%env(GITHUB_TOKEN)%'

# curl-based clients segfault in php-fpm on macOS (system proxy lookup via
# fork-unsafe Network.framework), so avatar fetching uses the stream-based client.
social_card.http_client:
class: Symfony\Component\HttpClient\NativeHttpClient

Flow\Website\SocialCard\AvatarCache:
arguments:
$httpClient: '@social_card.http_client'
$cacheDir: '%kernel.project_dir%/var/avatars'

Flow\Website\SocialCard\CardPainter:
arguments:
$resourcesDir: '%kernel.project_dir%/resources'

Flow\Website\SocialCard\Blog\CardGenerator:
arguments:
$publicDir: '%kernel.project_dir%/public'

Flow\Website\SocialCard\WorkShop\CardGenerator:
arguments:
$publicDir: '%kernel.project_dir%/public'

Flow\Website\StaticSourceProvider\:
resource: '../src/Flow/Website/StaticSourceProvider/'
tags: ['static_content_generator.source_provider']
Expand Down
Binary file added web/landing/resources/fonts/Cabin-Bold.ttf
Binary file not shown.
Binary file added web/landing/resources/fonts/Cabin-Regular.ttf
Binary file not shown.
93 changes: 93 additions & 0 deletions web/landing/resources/fonts/OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2018 The Cabin Project Authors (https://github.com/impallari/Cabin.git)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file added web/landing/resources/images/elephant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 20 additions & 1 deletion web/landing/src/Flow/Website/Blog/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use function Flow\Types\DSL\type_string;
use function Flow\Types\DSL\type_structure;
use function sprintf;

final readonly class Post
{
Expand All @@ -16,6 +17,7 @@ public function __construct(
public string $description,
public DateTimeImmutable $date,
public string $slug,
public string $author,
) {}

public static function fromArray(array $data): self
Expand All @@ -25,8 +27,25 @@ public static function fromArray(array $data): self
'description' => type_string(),
'date' => type_string(),
'slug' => type_string(),
'author' => type_string(),
])->assert($data);

return new self($data['title'], $data['description'], new DateTimeImmutable($data['date']), $data['slug']);
return new self(
$data['title'],
$data['description'],
new DateTimeImmutable($data['date']),
$data['slug'],
$data['author'],
);
}

public function authorAvatarUrl(int $size = 96): string
{
return sprintf('https://github.com/%s.png?size=%d', $this->author, $size);
}

public function authorUrl(): string
{
return 'https://github.com/' . $this->author;
}
}
8 changes: 7 additions & 1 deletion web/landing/src/Flow/Website/Blog/Posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,42 @@ final class Posts
'description' => 'Learn how to extract data from Google Analytics API using Flow PHP but also how to build a custom data extractor.',
'date' => '2024-04-04',
'slug' => 'building-custom-extractor-google-analytics',
'author' => 'norberttech',
],
[
'title' => 'Scalar Functions',
'description' => 'Scalar functions are one of the most important building blocks of Flow. Learn how to build and use custom scalar functions in Flow PHP.',
'date' => '2024-08-08',
'slug' => 'scalar-functions',
'author' => 'norberttech',
],
[
'title' => 'Data processing in PHP',
'description' => 'Processing datasets is a common problem in almost any software. Learn how to process datasets in PHP just like it\'s being done in other programming languages.',
'date' => '2025-01-25',
'slug' => 'data-processing-in-php',
'author' => 'norberttech',
],
[
'title' => 'Flow PHP Release Cycle',
'description' => 'Explanation of the updated Flow PHP release cycle that improves adaptability of new features.',
'date' => '2025-03-16',
'slug' => 'flow-php-release-cycle',
'author' => 'norberttech',
],
[
'title' => 'Flow PHP - Release 0.41.0',
'description' => 'Summary of things changed in Flow PHP 0.41.0 release',
'date' => '2026-06-29',
'slug' => 'flow-php-release-0410',
'author' => 'norberttech',
],
[
'title' => 'Performance Optimizations',
'description' => 'Floe is a dedicated binary format, created to speedup serialization and reduce serialized content size of Rows.',
'date' => '2026-07-23',
'slug' => 'performance-optimizations',
'author' => 'norberttech',
],
];

Expand All @@ -58,7 +64,7 @@ final class Posts
*/
public function all(): array
{
return array_map(static fn(array $data): Post => Post::fromArray($data), array_reverse($this->posts));
return array_map(Post::fromArray(...), array_reverse($this->posts));
}

public function findByDateAndSlug(string $date, string $slug): Post
Expand Down
8 changes: 6 additions & 2 deletions web/landing/src/Flow/Website/Controller/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,24 @@
namespace Flow\Website\Controller;

use Flow\Website\Blog\Posts;
use Flow\Website\SocialCard\Blog\CardGenerator;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;

final class BlogController extends AbstractController
{
#[Route('/blog/{date}/{slug}', name: 'blog_post')]
public function post(string $date, string $slug): Response
public function post(string $date, string $slug, CardGenerator $socialCards): Response
{
$post = (new Posts())->findByDateAndSlug($date, $slug);

return $this->render('blog/posts/' . $date . '/' . $slug . '/post.html.twig', [
'template_folder' => 'blog/posts/' . $date . '/' . $slug,
'post' => (new Posts())->findByDateAndSlug($date, $slug),
'post' => $post,
'date' => $date,
'slug' => $slug,
'social_image' => $socialCards->generate($post),
]);
}

Expand Down
27 changes: 19 additions & 8 deletions web/landing/src/Flow/Website/Controller/WorkShopController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Flow\Website\Controller;

use Flow\Website\SocialCard\WorkShop\CardGenerator;
use Flow\Website\WorkShop\Listings;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
Expand All @@ -23,16 +25,19 @@ public function __construct(
#[Route('/work-shop', name: 'work_shop', options: ['sitemap' => false])]
public function index(): Response
{
return $this->render('work-shop/index.html.twig');
return $this->render('work-shop/index.html.twig', [
'categories' => (new Listings())->all(),
]);
}

#[Route('/work-shop/blueprints/symfony-backoffice', name: 'work_shop_blueprint_symfony', options: [
'sitemap' => false,
])]
public function blueprintSymfony(): Response
public function blueprintSymfony(CardGenerator $socialCards): Response
{
return $this->render('work-shop/blueprints/symfony-backoffice/index.html.twig', [
'listing_checkout_url' => $this->checkoutLinks['symfony_backoffice'] ?? null,
'social_image' => $socialCards->generate((new Listings())->findBySlug('symfony-backoffice')),
]);
}

Expand All @@ -49,10 +54,11 @@ public function blueprintHowItWorks(): Response
#[Route('/work-shop/ai/claude-skills', name: 'work_shop_ai_claude_skills', options: [
'sitemap' => false,
])]
public function aiClaudeSkills(): Response
public function aiClaudeSkills(CardGenerator $socialCards): Response
{
return $this->render('work-shop/ai/claude-skills/index.html.twig', [
'listing_checkout_url' => $this->checkoutLinks['claude_skills'] ?? null,
'social_image' => $socialCards->generate((new Listings())->findBySlug('claude-skills')),
]);
}

Expand All @@ -67,30 +73,33 @@ public function aiHowItWorks(): Response
#[Route('/work-shop/sponsoring/1-month', name: 'work_shop_sponsoring_1m', options: [
'sitemap' => false,
])]
public function sponsoring1Month(): Response
public function sponsoring1Month(CardGenerator $socialCards): Response
{
return $this->render('work-shop/sponsoring/1-month/index.html.twig', [
'listing_checkout_url' => $this->checkoutLinks['sponsoring_1m'] ?? null,
'social_image' => $socialCards->generate((new Listings())->findBySlug('sponsoring-1-month')),
]);
}

#[Route('/work-shop/sponsoring/6-months', name: 'work_shop_sponsoring_6m', options: [
'sitemap' => false,
])]
public function sponsoring6Months(): Response
public function sponsoring6Months(CardGenerator $socialCards): Response
{
return $this->render('work-shop/sponsoring/6-months/index.html.twig', [
'listing_checkout_url' => $this->checkoutLinks['sponsoring_6m'] ?? null,
'social_image' => $socialCards->generate((new Listings())->findBySlug('sponsoring-6-months')),
]);
}

#[Route('/work-shop/sponsoring/12-months', name: 'work_shop_sponsoring_12m', options: [
'sitemap' => false,
])]
public function sponsoring12Months(): Response
public function sponsoring12Months(CardGenerator $socialCards): Response
{
return $this->render('work-shop/sponsoring/12-months/index.html.twig', [
'listing_checkout_url' => $this->checkoutLinks['sponsoring_12m'] ?? null,
'social_image' => $socialCards->generate((new Listings())->findBySlug('sponsoring-12-months')),
]);
}

Expand All @@ -101,9 +110,11 @@ public function success(): Response
}

#[Route('/work-shop/consulting', name: 'work_shop_consulting', options: ['sitemap' => false])]
public function consulting(): Response
public function consulting(CardGenerator $socialCards): Response
{
return $this->render('work-shop/consulting/index.html.twig');
return $this->render('work-shop/consulting/index.html.twig', [
'social_image' => $socialCards->generate((new Listings())->findBySlug('consulting')),
]);
}

#[Route('/work-shop/terms-of-sales', name: 'work_shop_terms_of_sales', options: ['sitemap' => false])]
Expand Down
Loading