Move symfony stuff to own folder

This commit is contained in:
2025-05-28 23:51:27 +01:00
parent 20e604cf68
commit 077d33d801
89 changed files with 24 additions and 26 deletions

View File

@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en-GB">
<head>
{{ 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>
{{ include('components/_navbar.html.twig') }}
{% block main %}
<main>
{% block content %}{% endblock %}
</main>
{% endblock %}
</body>
</html>

View File

@@ -0,0 +1,47 @@
{% extends 'base.html.twig' %}
{% block content %}
{% if post %}
<article class="h-entry">
<aside>
<span>
This is a blog post by
<a class="p-author h-card" href="/">Joe Carstairs</a>.
</span>
<p>
Published: <time class="dt-published">{{ post.publishedDate.format('c') }}
</p>
{% if post.updatedDate %}}
<p>
Updated: <time class="dt-updated">{{ post.updatedDate.format('c') }}
</p>
{% endif %}
<span hidden>
<a class="u-url uid" href="{{ url('blog_post', { slug: post.slug }) }}">
Permalink
</a>
</span>
</aside>
<header>
<h1 class="p-name">{% apply markdown_to_html %}{{ post.title }}{% endapply %}</h1>
<p class="p-summary">
{% apply markdown_to_html %}{{ post.description }}{% endapply %}
</p>
</header>
{% apply markdown_to_html %}
<section class="e-content">
{{ post.content }}
</section>
{% endapply %}
</article>
{% else %}
<section>
<h1>Post not found</h1>
<p>I don't have a blog post '{{ slug }}'.</p>
<p>Go back to <a href="{{ path('blog_posts') }}">Blog</a>.</p>
</section>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,81 @@
{% extends 'base.html.twig' %}
{% block content %}
<section class="h-feed">
<h1 class="p-name">Joe Carstairs' blog</h1>
<p hidden>
This blog is written by
<a class="p-author h-card" href="{{ url('index') }}">
Joe Carstairs
</a>.
</p>
<p hidden>
<a class="u-url" href="{{ url('blog_posts') }}">Permalink</a>
</p>
{% if years %}
<nav class="skip-to">
Skip to:
<ul>
{% for year in years %}
<li><a href="#{{ year }}">{{ year }}</a></li>
{% endfor %}
</ul>
</nav>
{% endif %}
{% for year in years %}
<h2 id="{{ year }}">{{ year }}</h2>
<nav class="skip-to">
Skip to:
<ul>
{% for month in months[year] %}
<li><a href="#{{ year }}-{{ month }}">
{{ monthNames[month] }} <span class="visually-hidden">{{ year }}</span>
</a></li>
{% endfor %}
</ul>
</nav>
{% for month in months[year] %}
<h3 id="{{ year }}-{{ month }}">{{ monthNames[month] }}</h3>
{% for post in posts[year][month] %}
<section class="h-entry">
<a class="u-url" href="{{ path('blog_post', { 'slug': post.slug }) }}">
<h4 class="p-name">
{{ post.title }}
</h4>
<p>
Added:
<time class="dt-published" datetime="{{ post.publishedDate.format('c') }}">
{{ post.publishedDate.format('j F Y') }}
</time>
</p>
{% if post.updatedDate %}
<p>
Updated:
<time class="dt-updated" datetime="{{ post.updatedDate.format('c') }}">
{{ post.updatedDate.format('j F Y') }}
</time>
</p>
{% endif %}
<section class="p-summary">
{% apply markdown_to_html %}
{{ post.description|markdown_to_html|striptags('<i><em><b><strong><sup><p>')|html_to_markdown }}
{% endapply %}
</section>
</a>
</section>
{% endfor %}
{% endfor %}
{% else %}
<p>I have no blog posts.</p>
{% endfor %}
</section>
{% endblock %}

View File

@@ -0,0 +1,13 @@
<nav class="navbar">
<ul>
<li>
<a href="/">Home</a>
</li>
<li>
<a href="{{ path('blog_posts') }}">Blog</a>
</li>
<li>
<a href="{{ path('notes') }}">Notes</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,9 @@
<link rel="stylesheet" href="/css/reset.css" />
<link rel="stylesheet" href="/css/base.css" />
<link rel="stylesheet" href="/css/hcard.css" />
{% if isFeed|default(false) %}
<link rel="stylesheet" href="/css/feed.css" />
{% endif %}
{% if isFeedEntry|default(false) %}
<link rel="stylesheet" href="/css/feed-entry.css" />
{% endif %}

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

@@ -0,0 +1,54 @@
{% extends 'base.html.twig' %}
{% block content %}
<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>
{% endblock %}

View File

@@ -0,0 +1,28 @@
{% extends 'base.html.twig' %}
{% block main %}
{% if note %}
<article class="h-entry">
<header>
<h1 class="p-name">Note {{ note.slug }}</h1>
<p hidden><a class="p-author h-card" href="{{ url('index') }}">Joe Carstairs</a></p>
<p hidden <a class="u-url" href="{{ url('note', { slug: note.slug }) }}">Permalink</a></p>
<p>Added: <time class="dt-published">{{ note.publishedDate.format('c') }}</time></p>
</header>
<section class="e-content">
{{ note.content|markdown_to_html }}
</section>
</article>
{% else %}
<main>
<header>
<h1>Note not found</h1>
</header>
<section>
<p>I don't have a note '{{ slug }}'.</p>
<p>Go back to <a href="/notes">Notes</a>.</p>
</section>
</main>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,71 @@
{% extends 'base.html.twig' %}
{% block content %}
<section class="h-feed">
<h1 class="p-name">Joe Carstairs' notes</h1>
<p hidden>
These links are collected by
<a class="p-author h-card" href="{{ url('index') }}">
Joe Carstairs
</a>.
</p>
<p hidden>
<a class="u-url" href="{{ url('notes') }}">Permalink</a>
</p>
{% if years %}
<nav class="skip-to">
Skip to:
<ul>
{% for year in years %}
<li><a href="#{{ year }}">{{ year }}</a></li>
{% endfor %}
</ul>
</nav>
{% endif %}
{% for year in years %}
<h2 id="{{ year }}">{{ year }}</h2>
<nav class="skip-to">
Skip to:
<ul>
{% for month in months[year] %}
<li><a href="#{{ year }}-{{ month }}">
{{ monthNames[month] }} <span class="visually-hidden">{{ year }}</span>
</a></li>
{% endfor %}
</ul>
</nav>
{% for month in months[year] %}
<h3 id="{{ year }}-{{ month }}">{{ monthNames[month] }}</h3>
{% for note in notes[year][month] %}
<section class="h-entry">
<a class="u-url" href="{{ url('note', { slug: note.slug }) }}">
<h4 class="p-name">
Note {{ note.slug }}
</h4>
<p>
Added:
<time class="dt-published" datetime="{{ note.publishedDate.format('c') }}">
{{ note.publishedDate.format('j F Y') }}
</time>
</p>
<section class="e-content">
{% apply markdown_to_html %}
{{ note.content|markdown_to_html|striptags('<i><em><b><strong><sup><p>')|html_to_markdown }}
{% endapply %}
</section>
</a>
</section>
{% endfor %}
{% endfor %}
{% else %}
<p>I have no notes.</p>
{% endfor %}
</section>
{% endblock %}

View File

@@ -0,0 +1,47 @@
{% extends 'base.html.twig' %}
{% block content %}
<section>
<h1>Log in</h1>
{% if app.user %}
<p>
You are logged in as {{ app.user.userIdentifier }}.
If you're not happy about that, <a href="{{ path('logout') }}">log out</a>.
</p>
{% else %}
{% if error %}
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
<form action="{{ path('login') }}" method="POST">
<label for="username">Email</label>
<input
type="email"
value="{{ lastUsername }}"
name="_username"
id="username"
class="form-control"
autocomplete="email"
required
autofocus
>
<label for="password">Password</label>
<input
type="password"
name="_password"
id="password"
class="form-control"
autocomplete="current-password"
required
>
<input type="hidden" name="_target_path" value="{{ path('index') }}">
<input type="hidden" name="_csrf_token" data-controller="csrf-protection" value="{{ csrf_token('authenticate') }}">
<button type="submit">Log in</button>
</form>
{% endif %}
</section>
{% endblock %}

View File

@@ -0,0 +1,8 @@
{% extends 'base.html.twig' %}
{% block content %}
<section>
<h1>Write a note</h1>
{{ form(form) }}
</section>
{% endblock %}