chore(post.html): drop post links to mastodon
This commit is contained in:
parent
d5c31a87d3
commit
d73444d714
6 changed files with 3 additions and 25 deletions
|
@ -83,7 +83,6 @@ class MastodonPostHandler extends ApiHandler
|
||||||
if ($mastodonPostUrl) {
|
if ($mastodonPostUrl) {
|
||||||
if (strpos($item["link"], $this->baseUrl . "/posts") !== false) {
|
if (strpos($item["link"], $this->baseUrl . "/posts") !== false) {
|
||||||
$slug = str_replace($this->baseUrl, "", $item["link"]);
|
$slug = str_replace($this->baseUrl, "", $item["link"]);
|
||||||
$this->updatePostWithMastodonUrl($slug, $mastodonPostUrl);
|
|
||||||
echo "Posted and stored URL: {$item["link"]}\n";
|
echo "Posted and stored URL: {$item["link"]}\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -209,15 +208,6 @@ class MastodonPostHandler extends ApiHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function updatePostWithMastodonUrl(
|
|
||||||
string $slug,
|
|
||||||
string $mastodonPostUrl
|
|
||||||
): void {
|
|
||||||
$data = ["mastodon_url" => $mastodonPostUrl];
|
|
||||||
|
|
||||||
$this->fetchFromPostgREST("posts", "slug=eq.{$slug}&mastodon_url=is.null", "PATCH", $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function truncateContent(
|
private function truncateContent(
|
||||||
string $title,
|
string $title,
|
||||||
string $description,
|
string $description,
|
||||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minisearch": "^7.1.2",
|
"minisearch": "^7.1.2",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"description": "The source for my personal site. Built using 11ty (and other tools).",
|
"description": "The source for my personal site. Built using 11ty (and other tools).",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
@ -7,7 +7,6 @@ SELECT
|
||||||
p.content,
|
p.content,
|
||||||
p.featured,
|
p.featured,
|
||||||
p.slug AS url,
|
p.slug AS url,
|
||||||
p.mastodon_url,
|
|
||||||
CASE WHEN df.filename_disk IS NOT NULL
|
CASE WHEN df.filename_disk IS NOT NULL
|
||||||
AND df.filename_disk != ''
|
AND df.filename_disk != ''
|
||||||
AND df.filename_disk != '/' THEN
|
AND df.filename_disk != '/' THEN
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
{%- if url -%}
|
|
||||||
<div class="banner mastodon">
|
|
||||||
<p>
|
|
||||||
{% tablericon "brand-mastodon" %}
|
|
||||||
<a class="mastodon" href="{{ url }}"> Discuss this post on Mastodon. </a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
{%- endif -%}
|
|
|
@ -53,9 +53,6 @@ schema: blog
|
||||||
posts: post.posts,
|
posts: post.posts,
|
||||||
shows: post.shows
|
shows: post.shows
|
||||||
%}
|
%}
|
||||||
{% render "blocks/banners/mastodon.liquid"
|
|
||||||
url:post.mastodon_url
|
|
||||||
%}
|
|
||||||
{% render "blocks/banners/coffee.liquid" %}
|
{% render "blocks/banners/coffee.liquid" %}
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|
Loading…
Reference in a new issue