Refactor homepage

This commit is contained in:
2025-05-17 20:33:38 +01:00
parent c46f984b0a
commit a8d5c4dcdb
10 changed files with 109 additions and 126 deletions

View File

@@ -1,13 +1,17 @@
<?php
namespace App\Controller;
use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class GuiController extends AbstractController {
#[Route('/')]
public function index(): Response {
return $this->render('/index.html.twig');
#[Template('/index.html.twig')]
public function index(): Array {
return [
'title' => 'Joe Carstairs',
'description' => 'Joe Carstairs\' personal website',
];
}
}

View File

@@ -1,17 +1,19 @@
<!DOCTYPE html>
<html>
<html lang="en-GB">
<head>
<meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
{% block stylesheets %}
{% endblock %}
{% block javascripts %}
{% block importmap %}{{ importmap('app') }}{% endblock %}
{% endblock %}
{{ include('components/head/_meta.html.twig') }}
{{ include('components/head/_indie_web.html.twig') }}
{{ include('components/head/_stylesheets.html.twig') }}
{{ include('components/head/_feeds.html.twig') }}
{{ include('components/head/_open_graph.html.twig') }}
{{ include('components/head/_twitter.html.twig') }}
</head>
<body>
{% block body %}{% endblock %}
{{ include('components/_navbar.html.twig') }}
<main>
{% block content %}{% endblock %}
</main>
</body>
</html>

View File

@@ -0,0 +1,13 @@
<nav>
<ul>
<li>
<a href="/">Home</a>
</li>
<li>
<a href="/blog">Blog</a>
</li>
<li>
<a href="/links">Links</a>
</li>
</ul>
</nav>

View File

@@ -0,0 +1,2 @@
<link rel="alternate" type="text/xml" title="Blog RSS" href="/blog/rss.xml">
<link rel="alternate" type="text/xml" title="Links RSS" href="/links/rss.xml">

View File

@@ -0,0 +1,3 @@
<link rel="authorization_endpoint" href="https://indieauth.com/auth">
<link rel="token_endpoint" href="https://tokens.indieauth.com/token">
<link rel="micropub" href="https://tasty-windows-lick.loca.lt">

View File

@@ -0,0 +1,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="canonical" href="https://joeac.net{{ path(app.current_route, app.current_route_parameters) }}" />
<title>{{ title }}</title>
<meta name="title" content="{{ title }}" />
<meta name="description" content="{{ description }}" />

View File

@@ -0,0 +1,5 @@
<meta property="og:type" content="website" />
<meta property="og:url" content="https://joeac.net{{ path(app.current_route, app.current_route_parameters) }}" />
<meta property="og:title" content="{{ title }}" />
<meta property="og:description" content="{{ description }}" />
<meta property="og:image" content="/images/headshot.webp" />

View File

@@ -0,0 +1,4 @@
<link rel="stylesheet" href="/css/reset.css" />
<link rel="stylesheet" href="/css/base.css" />
<link rel="stylesheet" href="/css/hcard.css" />
<link rel="stylesheet" href="/css/feed.css" />

View File

@@ -0,0 +1,5 @@
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://joeac.net{{ path(app.current_route, app.current_route_parameters) }}" />
<meta property="twitter:title" content="{{ title }}" />
<meta property="twitter:description" content="{{ description }}" />
<meta property="twitter:image" content="/images/headshot.webp" />

View File

@@ -1,66 +1,6 @@
<!DOCTYPE html>
<html lang="en-GB">
<head>
<!-- IndieWeb -->
<link rel="authorization_endpoint" href="https://indieauth.com/auth">
<link rel="token_endpoint" href="https://tokens.indieauth.com/token">
<link rel="micropub" href="https://tasty-windows-lick.loca.lt">
{% extends 'base.html.twig' %}
<!-- Stylesheets -->
<link rel="stylesheet" href="/css/reset.css" />
<link rel="stylesheet" href="/css/base.css" />
<link rel="stylesheet" href="/css/hcard.css" />
<link rel="stylesheet" href="/css/feed.css" />
<!-- Global Metadata -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<!-- Canonical URL -->
<link rel="canonical" href={canonicalURL} />
<!-- Primary Meta Tags -->
<title>{title}</title>
<meta name="title" content={title} />
<meta name="description" content={description} />
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content={Astro.url} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:image" content={new URL(image, Astro.url)} />
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content={Astro.url} />
<meta property="twitter:title" content={title} />
<meta property="twitter:description" content={description} />
<meta property="twitter:image" content={new URL(image, Astro.url)} />
<!-- Feeds -->
<link rel="alternate" type="text/xml" title="Blog RSS" href="/blog/rss.xml">
<link rel="alternate" type="text/xml" title="Links RSS" href="/links/rss.xml">
</head>
<body>
<nav>
<ul>
<li>
<a href="/">Home</a>
</li>
<li>
<a href="/blog">Blog</a>
</li>
<li>
<a href="/links">Links</a>
</li>
</ul>
</nav>
<main>
{% block content %}
<section class="h-card">
<div>
<img class="u-photo" src="/images/headshot.webp" height="96" width="96" />
@@ -111,6 +51,4 @@
</p>
</div>
</section>
</main>
</body>
</html>
{% endblock %}