Scope article feeds and expand canvas editing

This commit is contained in:
2026-11-21 22:55:59 +08:00
parent a2fc628f08
commit 9bc0ee0e45
32 changed files with 476 additions and 67 deletions
+14
View File
@@ -65,6 +65,20 @@ final class View
return $value ? date($format, strtotime($value)) : '';
}
public static function alignmentClass(?string $alignment): string
{
return in_array($alignment, Html::ALIGNMENTS, true) ? ' studio-align-' . $alignment : '';
}
public static function archivePage(string $path, int $page): string
{
if ($page === 1) {
return $path;
}
return $path . (str_contains($path, '?') ? '&' : '?') . 'page=' . $page;
}
public static function redirect(string $path, int $status = 303): Response
{
return new Response($status, ['Location' => $path, 'Cache-Control' => $status === 301 ? 'public, max-age=300' : 'no-store'], '');