Metatag fixes, front end description work

This commit is contained in:
Alex 2026-06-08 15:10:12 -07:00
parent d09f49ed24
commit 2907e95d6b
13 changed files with 48 additions and 15 deletions

File diff suppressed because one or more lines are too long

View file

@ -37,6 +37,16 @@
text-decoration-color: colors.$computerBorder; text-decoration-color: colors.$computerBorder;
} }
} }
.description {
margin-top: 1rem;
padding-left: 1rem;
border-left: 5px solid colors.$computerBorder;
p {
padding: 1rem 0;
}
}
} }
} }
} }

View file

@ -38,6 +38,7 @@ final class BrainPageController extends AbstractController
$page->setTitle($data->getTitle()); $page->setTitle($data->getTitle());
$page->setText($data->getText()); $page->setText($data->getText());
$page->setDescription($data->getDescription());
$page->setUrl($data->getUrl()); $page->setUrl($data->getUrl());
if ($data->isPublished()) { if ($data->isPublished()) {
@ -73,6 +74,7 @@ final class BrainPageController extends AbstractController
$data = $form->getData(); $data = $form->getData();
$page->setTitle($data->getTitle()); $page->setTitle($data->getTitle());
$page->setDescription($data->getDescription());
$page->setText($data->getText()); $page->setText($data->getText());
$page->setUrl($data->getUrl()); $page->setUrl($data->getUrl());

View file

@ -40,6 +40,7 @@ final class BrainPhotosController extends AbstractController
$photos->setTitle($data->getTitle()); $photos->setTitle($data->getTitle());
$photos->setDate($data->getDate()); $photos->setDate($data->getDate());
$photos->setDescription($data->getDescription());
$photos->setText($data->getText()); $photos->setText($data->getText());
$photos->setUrl($data->getUrl()); $photos->setUrl($data->getUrl());

View file

@ -41,6 +41,7 @@ final class BrainPostController extends AbstractController
$post->setTitle($data->getTitle()); $post->setTitle($data->getTitle());
$post->setDate($data->getDate()); $post->setDate($data->getDate());
$post->setDescription($data->getDescription());
$post->setText($data->getText()); $post->setText($data->getText());
$post->setUrl($data->getUrl()); $post->setUrl($data->getUrl());
@ -102,6 +103,7 @@ final class BrainPostController extends AbstractController
$post->setTitle($data->getTitle()); $post->setTitle($data->getTitle());
$post->setDate($data->getDate()); $post->setDate($data->getDate());
$post->setDescription($data->getDescription());
$post->setText($data->getText()); $post->setText($data->getText());
$post->setUrl($data->getUrl()); $post->setUrl($data->getUrl());

View file

@ -49,6 +49,7 @@ final class PhotosController extends AbstractController
'description' => $photos->getDescription(), 'description' => $photos->getDescription(),
'date' => $photos->getDate(), 'date' => $photos->getDate(),
'thumbnail' => '/files/uploads/photos/' . strtolower(str_replace(' ', '_', $photos->getTitle())) . '/' . $photos->getThumbnail(), 'thumbnail' => '/files/uploads/photos/' . strtolower(str_replace(' ', '_', $photos->getTitle())) . '/' . $photos->getThumbnail(),
'url' => $photos->getUrl(),
]; ];
foreach ($uploads as $index => $upload) { foreach ($uploads as $index => $upload) {

View file

@ -25,6 +25,7 @@ final class PostController extends AbstractController
'title' => $post->getTitle(), 'title' => $post->getTitle(),
'category' => $post->getCategory()->getTitle(), 'category' => $post->getCategory()->getTitle(),
'urlSafeCategory' => $post->getCategory()->getUrlSafeTitle(), 'urlSafeCategory' => $post->getCategory()->getUrlSafeTitle(),
'description' => $post->getDescription(),
'date' => $post->getDate(), 'date' => $post->getDate(),
'url' => $post->getUrl() 'url' => $post->getUrl()
]; ];

View file

@ -26,14 +26,14 @@
<meta name="description" content="{% block metadescription %}{% endblock %}" /> <meta name="description" content="{% block metadescription %}{% endblock %}" />
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:url" content="https://alexdaniels.me" /> <meta property="og:url" content="{% block ogurl %}{% endblock %}" />
<meta property="og:title" content="{% block ogtitle %}{% endblock %}" /> <meta property="og:title" content="{% block ogtitle %}{% endblock %}" />
<meta property="og:description" content="{% block ogdescription %}{% endblock %}" /> <meta property="og:description" content="{% block ogdescription %}{% endblock %}" />
<meta property="og:image" content="{% block ogimage %}{% endblock %}" /> <meta property="og:image" content="{% block ogimage %}{% endblock %}" />
<!-- X (Twitter) --> <!-- X (Twitter) -->
<meta property="twitter:card" content="summary_large_image" /> <meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://alexdaniels.me" /> <meta property="twitter:url" content="{% block twitterurl %}{% endblock %}" />
<meta property="twitter:title" content="{% block twittertitle %}{% endblock %}" /> <meta property="twitter:title" content="{% block twittertitle %}{% endblock %}" />
<meta property="twitter:description" content="{% block twitterdescription %}{% endblock %}" /> <meta property="twitter:description" content="{% block twitterdescription %}{% endblock %}" />
<meta property="twitter:image" content="{% block twitterimage %}{% endblock %}" /> <meta property="twitter:image" content="{% block twitterimage %}{% endblock %}" />

View file

@ -5,9 +5,12 @@
{% block metatitle %}{{page.title}} | Alex Daniels {% endblock %} {% block metatitle %}{{page.title}} | Alex Daniels {% endblock %}
{% block ogtitle %}{{page.title}} | Alex Daniels {% endblock %} {% block ogtitle %}{{page.title}} | Alex Daniels {% endblock %}
{% block twittertitle %}{{page.title}} | Alex Daniels{% endblock %} {% block twittertitle %}{{page.title}} | Alex Daniels{% endblock %}
{% block metadescription %}{{page.description }} {% endblock %} {% block metadescription %}{{page.description|striptags }} {% endblock %}
{% block ogdescription %}{{page.description }} {% endblock %} {% block ogdescription %}{{page.description|striptags }} {% endblock %}
{% block twitterdescription %}{{page.description }} {% endblock %} {% block twitterdescription %}{{page.description|striptags }} {% endblock %}
{% block ogurl %}https://alexdaniels.me/{{page.url}}{% endblock %}
{% block twitterurl %}https://alexdaniels.me/{{page.url}}{% endblock %}
{% block body %} {% block body %}
<section class="page"> <section class="page">

View file

@ -5,12 +5,15 @@
{% block metatitle %}{{photos['title']}} | Alex Daniels {% endblock %} {% block metatitle %}{{photos['title']}} | Alex Daniels {% endblock %}
{% block ogtitle %}{{photos['title']}} | Alex Daniels {% endblock %} {% block ogtitle %}{{photos['title']}} | Alex Daniels {% endblock %}
{% block twittertitle %}{{photos['title']}} | Alex Daniels{% endblock %} {% block twittertitle %}{{photos['title']}} | Alex Daniels{% endblock %}
{% block metadescription %}{{photos['description']}} {% endblock %} {% block metadescription %}{{photos['description']|striptags}} {% endblock %}
{% block ogdescription %}{{photos['description']}} {% endblock %} {% block ogdescription %}{{photos['description']|striptags}} {% endblock %}
{% block twitterdescription %}{{photos['description'] }} {% endblock %} {% block twitterdescription %}{{photos['description']|striptags }} {% endblock %}
{% block ogimage %}{{ photos['thumbnail']}}{% endblock %} {% block ogimage %}{{ photos['thumbnail']}}{% endblock %}
{% block twitterimage %}{{ photos['thumbnail']}}{% endblock %} {% block twitterimage %}{{ photos['thumbnail']}}{% endblock %}
{% block ogurl %}https://alexdaniels.me/photos/{{photos['url']}}{% endblock %}
{% block twitterurl %}https://alexdaniels.me/photos/{{photos['url']}}{% endblock %}
{% block body %} {% block body %}
<article id="album"> <article id="album">
<h2 class="title">{{photos['title']}}</h2> <h2 class="title">{{photos['title']}}</h2>

View file

@ -11,6 +11,9 @@
{# {% block ogimage %}{{ photos['thumbnail']}}{% endblock %} {# {% block ogimage %}{{ photos['thumbnail']}}{% endblock %}
{% block twitterimage %}{{ photos['thumbnail']}}{% endblock %} #} {% block twitterimage %}{{ photos['thumbnail']}}{% endblock %} #}
{% block ogurl %}https://alexdaniels.me/photos{% endblock %}
{% block twitterurl %}https://alexdaniels.me/words{% endblock %}
{% block body %} {% block body %}
<h2>Photography</h2> <h2>Photography</h2>
<div class="photos"> <div class="photos">

View file

@ -4,9 +4,12 @@
{% block metatitle %}{{post.title}} - Writing | Alex Daniels {% endblock %} {% block metatitle %}{{post.title}} - Writing | Alex Daniels {% endblock %}
{% block twittertitle %}{{post.title}} - Writing | Alex Daniels{% endblock %} {% block twittertitle %}{{post.title}} - Writing | Alex Daniels{% endblock %}
{% block metadescription %}{{post.description }} {% endblock %} {% block metadescription %}{{post.description|striptags }} {% endblock %}
{% block ogdescription %}{{post.description }} {% endblock %} {% block ogdescription %}{{post.description|striptags}} {% endblock %}
{% block twitterdescription %}{{post.description }} {% endblock %} {% block twitterdescription %}{{post.description|striptags }} {% endblock %}
{% block ogurl %}https://alexdaniels.me/words/{{post.url}}{% endblock %}
{% block twitterurl %}https://alexdaniels.me/words/{{post.url}}{% endblock %}
{% block body %} {% block body %}
<article class="post"> <article class="post">

View file

@ -9,6 +9,9 @@
{% block ogdescription %}A truly random smattering of thoughts and feelings. Things may not always be relevant, but they will always be irreverant.{% endblock %} {% block ogdescription %}A truly random smattering of thoughts and feelings. Things may not always be relevant, but they will always be irreverant.{% endblock %}
{% block twitterdescription %}A truly random smattering of thoughts and feelings. Things may not always be relevant, but they will always be irreverant.{% endblock %} {% block twitterdescription %}A truly random smattering of thoughts and feelings. Things may not always be relevant, but they will always be irreverant.{% endblock %}
{% block ogurl %}https://alexdaniels.me/words{% endblock %}
{% block twitterurl %}https://alexdaniels.me/words{% endblock %}
{% block body %} {% block body %}
<section class="posts"> <section class="posts">
<h2>Writing</h2> <h2>Writing</h2>
@ -19,9 +22,10 @@
{% for post in posts %} {% for post in posts %}
<li> <li>
<article class="post"> <article class="post">
<a href="/categories/{{post['urlSafeCategory']}}" class="category">{{post['category']}}</a> <a href="/categories/{{post['urlSafeCategory']}}" class="category">{{ post['category'] }}</a>
<a href="/words/{{post['url']}}"><h4 class="title">{{post['title']}}</h4></a> <a href="/words/{{post['url']}}"><h4 class="title">{{post['title'] }}</h4></a>
<time class="published">{{post['date']|date('l M d Y')}}</time> <time class="published">{{post['date']|date('l M d Y') }}</time>
<div class="description">{{ post['description']|raw }}</div>
</article> </article>
</li> </li>
{% endfor %} {% endfor %}