Moar Open Graph tags

This commit is contained in:
swag 2023-06-04 17:47:36 -04:00
parent 782545b70f
commit d1612ae685
6 changed files with 40 additions and 2 deletions

View File

@ -1,5 +1,15 @@
% layout 'default'; % layout 'default';
% title 'About Post::Text'; % title 'About Post::Text';
% content_for open_graph => begin
<meta property="og:type" content="website">
<meta property="og:title" content="<%= title %>">
<meta
property="og:description"
content="Post::Text is a textboard a bit like 2channel. You can
post whatever you want anonymously just please mind
the rules."
>
% end
<h2 class="page-title"><%= title %></h2> <h2 class="page-title"><%= title %></h2>
<main class="page-body"> <main class="page-body">
<p>Post::Text is a <p>Post::Text is a

View File

@ -1,5 +1,15 @@
% layout 'default'; % layout 'default';
% title 'The Rules™'; % title 'The Rules™';
% content_for open_graph => begin
<meta property="og:type" content="website">
<meta property="og:title" content="<%= title %>">
<meta
property="og:description"
content="Post::Text is a textboard a bit like 2channel. You can
post whatever you want anonymously just please mind
the rules."
>
% end
<h2 class="page-title"><%= title %></h2> <h2 class="page-title"><%= title %></h2>
<main class="page-body"> <main class="page-body">
<p>The rules here are pretty simple:</p> <p>The rules here are pretty simple:</p>

View File

@ -2,6 +2,13 @@
% title my $remark_id = $remark->{'id'} ? "Remark #$remark_id" : '?'; % title my $remark_id = $remark->{'id'} ? "Remark #$remark_id" : '?';
<h2 class="page-title"><%= title %></h2> <h2 class="page-title"><%= title %></h2>
<% if (keys %{$remark}) { =%> <% if (keys %{$remark}) { =%>
<% content_for open_graph => begin %>
<meta property="og:type" content="article">
<meta property="og:title"
content="Thread #<%= $remark->{'thread_id'} %>, <%= title %>">
<meta property="og:description"
content="<%= truncate_text $remark->{'body'} %>">
<% end %>
<main class="pager"> <main class="pager">
<article class="post"> <article class="post">
<h4 class="post__title"> <h4 class="post__title">

View File

@ -1,7 +1,13 @@
% layout 'default'; % layout 'default';
% title 'New Remark'; % title my $thread_id = $thread->{'id'} ? "Remark on Thread #$thread_id" : '?';
<h2 class="page-title"><%= title %></h2> <h2 class="page-title"><%= title %></h2>
<% if (keys %{$thread}) { =%> <% if (keys %{$thread}) { =%>
<% content_for open_graph => begin %>
<meta property="og:type" content="website">
<meta property="og:title" content="<%= title %>">
<meta property="og:description"
content="Remark on thread #<%= $thread->{'id'} %>.">
<% end %>
<form method="post" class="form-body"> <form method="post" class="form-body">
<div class="form-field"> <div class="form-field">
<% if (my $error = validation->error('author')) { =%> <% if (my $error = validation->error('author')) { =%>

View File

@ -4,7 +4,7 @@
<% if (keys %{$thread}) { =%> <% if (keys %{$thread}) { =%>
<% content_for open_graph => begin %> <% content_for open_graph => begin %>
<meta property="og:type" content="article"> <meta property="og:type" content="article">
<meta property="og:title" content="<%= title %>: <%= $thread->{'title'} %>"> <meta property="og:title" content="<%= $thread->{'title'} %>">
<meta property="og:description" <meta property="og:description"
content="<%= truncate_text $thread->{'body'} %>"> content="<%= truncate_text $thread->{'body'} %>">
<% end %> <% end %>

View File

@ -1,5 +1,10 @@
% layout 'default'; % layout 'default';
% title 'New Thread'; % title 'New Thread';
% content_for open_graph => begin
<meta property="og:type" content="website">
<meta property="og:title" content="<%= title %>">
<meta property="og:description" content="Start a new thread.">
% end
<h2 class="page-title"><%= title %></h2> <h2 class="page-title"><%= title %></h2>
<form method="post" class="form-body"> <form method="post" class="form-body">
<div class="form-field"> <div class="form-field">