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

View File

@@ -1,17 +1,19 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="en-GB">
<head> <head>
<meta charset="UTF-8"> {{ include('components/head/_meta.html.twig') }}
<title>{% block title %}Welcome!{% endblock %}</title> {{ include('components/head/_indie_web.html.twig') }}
<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>"> {{ include('components/head/_stylesheets.html.twig') }}
{% block stylesheets %} {{ include('components/head/_feeds.html.twig') }}
{% endblock %} {{ include('components/head/_open_graph.html.twig') }}
{{ include('components/head/_twitter.html.twig') }}
</head>
{% block javascripts %} <body>
{% block importmap %}{{ importmap('app') }}{% endblock %} {{ include('components/_navbar.html.twig') }}
{% endblock %}
</head> <main>
<body> {% block content %}{% endblock %}
{% block body %}{% endblock %} </main>
</body> </body>
</html> </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,116 +1,54 @@
<!DOCTYPE html> {% extends 'base.html.twig' %}
<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">
<!-- Stylesheets --> {% block content %}
<link rel="stylesheet" href="/css/reset.css" /> <section class="h-card">
<link rel="stylesheet" href="/css/base.css" /> <div>
<link rel="stylesheet" href="/css/hcard.css" /> <img class="u-photo" src="/images/headshot.webp" height="96" width="96" />
<link rel="stylesheet" href="/css/feed.css" /> </div>
<!-- Global Metadata --> <header>
<meta charset="utf-8" /> <h1>
<meta name="viewport" content="width=device-width,initial-scale=1" /> Joe Carstairs
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> </h1>
<meta name="generator" content={Astro.generator} />
<!-- Canonical URL --> <div hidden>
<link rel="canonical" href={canonicalURL} /> <a class="p-name u-url u-uid" href="https://joeac.net" rel="me">
Permalink
</a>
</div>
</header>
<!-- Primary Meta Tags --> <div class="h-card__text">
<title>{title}</title> <p>
<meta name="title" content={title} /> Hi! 👋 My name is <span class="p-given-name">Joe</span>
<meta name="description" content={description} /> <span class="p-family-name">Carstairs</span>. Im a
<span class="p-job-title">software developer</span> at
<a class="p-org" href="https://www.scottlogic.com">Scott Logic</a>, a
graduate of Philosophy and Mathematics at the University of Edinburgh,
a committed Christian and a pretty rubbish poet.
</p>
<!-- Open Graph / Facebook --> <p>
<meta property="og:type" content="website" /> Im also the <span class="p-job-title">secretary</span> of the
<meta property="og:url" content={Astro.url} /> <a class="p-org" href="https://scotsleidassocie.org">Scots Language Society</a>.
<meta property="og:title" content={title} /> <a href="https://github.com/joeacarstairs/lallans-wabsteid-astro">Help me maintain our website!</a>
<meta property="og:description" content={description} /> </p>
<meta property="og:image" content={new URL(image, Astro.url)} />
<!-- Twitter --> <p>
<meta property="twitter:card" content="summary_large_image" /> HMU with your thoughts on philosophy of science, Scots verse and
<meta property="twitter:url" content={Astro.url} /> John the Evangelist.
<meta property="twitter:title" content={title} /> </p>
<meta property="twitter:description" content={description} />
<meta property="twitter:image" content={new URL(image, Astro.url)} />
<!-- Feeds --> <p>
<link rel="alternate" type="text/xml" title="Blog RSS" href="/blog/rss.xml"> <small>
<link rel="alternate" type="text/xml" title="Links RSS" href="/links/rss.xml"> Or get me on
</head> <a href="https://www.facebook.com/joe.carstairs.5" rel="me">Facebook</a>,
<a href="https://mastodon.social/@joe_carstairs" rel="me">Mastodon</a>,
<body> <a href="https://www.linkedin.com/in/joe-carstairs-0aa936277" rel="me">LinkedIn</a>,
<nav> <a href="https://bsky.app/profile/joeacarstairs.bsky.social" rel="me">BlueSky</a>,
<ul> or <a href="https://github.com/joeacarstairs" rel="me">GitHub</a>.
<li> </small>
<a href="/">Home</a> </p>
</li> </div>
<li> </section>
<a href="/blog">Blog</a> {% endblock %}
</li>
<li>
<a href="/links">Links</a>
</li>
</ul>
</nav>
<main>
<section class="h-card">
<div>
<img class="u-photo" src="/images/headshot.webp" height="96" width="96" />
</div>
<header>
<h1>
Joe Carstairs
</h1>
<div hidden>
<a class="p-name u-url u-uid" href="https://joeac.net" rel="me">
Permalink
</a>
</div>
</header>
<div class="h-card__text">
<p>
Hi! 👋 My name is <span class="p-given-name">Joe</span>
<span class="p-family-name">Carstairs</span>. Im a
<span class="p-job-title">software developer</span> at
<a class="p-org" href="https://www.scottlogic.com">Scott Logic</a>, a
graduate of Philosophy and Mathematics at the University of Edinburgh,
a committed Christian and a pretty rubbish poet.
</p>
<p>
Im also the <span class="p-job-title">secretary</span> of the
<a class="p-org" href="https://scotsleidassocie.org">Scots Language Society</a>.
<a href="https://github.com/joeacarstairs/lallans-wabsteid-astro">Help me maintain our website!</a>
</p>
<p>
HMU with your thoughts on philosophy of science, Scots verse and
John the Evangelist.
</p>
<p>
<small>
Or get me on
<a href="https://www.facebook.com/joe.carstairs.5" rel="me">Facebook</a>,
<a href="https://mastodon.social/@joe_carstairs" rel="me">Mastodon</a>,
<a href="https://www.linkedin.com/in/joe-carstairs-0aa936277" rel="me">LinkedIn</a>,
<a href="https://bsky.app/profile/joeacarstairs.bsky.social" rel="me">BlueSky</a>,
or <a href="https://github.com/joeacarstairs" rel="me">GitHub</a>.
</small>
</p>
</div>
</section>
</main>
</body>
</html>