Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Pixelfed & Mastodon social media support. #2949

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
4 changes: 4 additions & 0 deletions app/Http/Resources/GalleryConfigs/FooterConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class FooterConfig extends Data
public string $sm_instagram_url;
public string $sm_twitter_url;
public string $sm_youtube_url;
public string $sm_pixelfed_url;
public string $sm_mastodon_url;

public function __construct()
{
Expand All @@ -38,6 +40,8 @@ public function __construct()
$this->sm_instagram_url = Configs::getValueAsString('sm_instagram_url');
$this->sm_twitter_url = Configs::getValueAsString('sm_twitter_url');
$this->sm_youtube_url = Configs::getValueAsString('sm_youtube_url');
$this->sm_pixelfed_url = Configs::getValueAsString('sm_pixelfed_url');
$this->sm_mastodon_url = Configs::getValueAsString('sm_mastodon_url');

$copy_right_year = $site_copyright_begin;
if ($site_copyright_begin !== $site_copyright_end) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

/**
* SPDX-License-Identifier: MIT
* Copyright (c) 2017-2018 Tobias Reich
* Copyright (c) 2018-2025 LycheeOrg.
*/

use App\Models\Extensions\BaseConfigMigration;

return new class() extends BaseConfigMigration {
public function getConfigs(): array
{
return [
[
'key' => 'sm_pixelfed_url',
'value' => '', // default -> empty URL
'cat' => 'Footer',
'type_range' => self::STRING,
'description' => 'Url of pixelfed profile',
'details' => '',
'is_secret' => true,
'level' => 0,
],
[
'key' => 'sm_mastodon_url',
'value' => '', // default -> empty URL
'cat' => 'Footer',
'type_range' => self::STRING,
'description' => 'Url of mastodon profile',
'details' => '',
'is_secret' => true,
'level' => 0,
],
];
}
};
16 changes: 16 additions & 0 deletions resources/js/components/footers/GalleryFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@
target="_blank"
rel="noopener"
></a>
<a
v-if="footerData.sm_pixelfed_url !== ''"
:href="footerData.sm_pixelfed_url"
class="socials socialicons"
id="pixelfed"
target="_blank"
rel="noopener"
></a>
<a
v-if="footerData.sm_mastodon_url !== ''"
:href="footerData.sm_mastodon_url"
class="socials socialicons"
id="mastodon"
target="_blank"
rel="noopener"
></a>
</div>
<p
v-if="footerData.footer_show_copyright && footerData.copyright !== ''"
Expand Down
16 changes: 16 additions & 0 deletions resources/js/components/footers/LandingFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@
target="_blank"
rel="noopener"
></a>
<a
v-if="props.footerData.sm_pixelfed_url !== ''"
:href="props.footerData.sm_pixelfed_url"
class="inline-block hover:scale-150 hover:text-muted-color transition-all ease-in-out duration-300 text-surface-0 socials text-2xl my-4 mx-5 socialicons"
id="pixelfed"
target="_blank"
rel="noopener"
></a>
<a
v-if="props.footerData.sm_mastodon_url !== ''"
:href="props.footerData.sm_mastodon_url"
class="inline-block hover:scale-150 hover:text-muted-color transition-all ease-in-out duration-300 text-surface-0 socials text-2xl my-4 mx-5 socialicons"
id="mastodon"
target="_blank"
rel="noopener"
></a>
</div>
<p
v-if="props.footerData.footer_show_copyright"
Expand Down
2 changes: 2 additions & 0 deletions resources/js/lychee.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ declare namespace App.Http.Resources.GalleryConfigs {
sm_instagram_url: string;
sm_twitter_url: string;
sm_youtube_url: string;
sm_pixelfed_url: string;
sm_mastodon_url: string;
};
export type InitConfig = {
is_debug_enabled: boolean;
Expand Down
Loading