diff --git a/src/Moonglade.Configuration/BlogConfig.cs b/src/Moonglade.Configuration/BlogConfig.cs index 31d15df16..f8e9e5fef 100644 --- a/src/Moonglade.Configuration/BlogConfig.cs +++ b/src/Moonglade.Configuration/BlogConfig.cs @@ -16,7 +16,6 @@ public interface IBlogConfig LocalAccountSettings LocalAccountSettings { get; set; } SocialLinkSettings SocialLinkSettings { get; set; } SystemManifestSettings SystemManifestSettings { get; set; } - SocialProfileSettings SocialProfileSettings { get; set; } IEnumerable LoadFromConfig(IDictionary config); KeyValuePair UpdateAsync(T blogSettings) where T : IBlogSettings; } @@ -35,7 +34,6 @@ public class BlogConfig : IBlogConfig public AdvancedSettings AdvancedSettings { get; set; } public CustomStyleSheetSettings CustomStyleSheetSettings { get; set; } - public SocialProfileSettings SocialProfileSettings { get; set; } public CustomMenuSettings CustomMenuSettings { get; set; } public LocalAccountSettings LocalAccountSettings { get; set; } @@ -55,7 +53,6 @@ public IEnumerable LoadFromConfig(IDictionary config) CustomMenuSettings = AssignValueForConfigItem(10, CustomMenuSettings.DefaultValue, config); LocalAccountSettings = AssignValueForConfigItem(11, LocalAccountSettings.DefaultValue, config); SocialLinkSettings = AssignValueForConfigItem(12, SocialLinkSettings.DefaultValue, config); - SocialProfileSettings = AssignValueForConfigItem(13, SocialProfileSettings.DefaultValue, config); // Special case SystemManifestSettings = AssignValueForConfigItem(99, SystemManifestSettings.DefaultValue, config); diff --git a/src/Moonglade.Configuration/SocialLink.cs b/src/Moonglade.Configuration/SocialLink.cs index 984bbce6d..c9d7bc59c 100644 --- a/src/Moonglade.Configuration/SocialLink.cs +++ b/src/Moonglade.Configuration/SocialLink.cs @@ -4,32 +4,32 @@ namespace Moonglade.Configuration; public class SocialLinkSettings : IBlogSettings { - public bool IsEnabled { get; set; } + public bool IsEnabled { get; set; } - public SocialLink[] Links { get; set; } = []; + public SocialLink[] Links { get; set; } = []; - public static SocialLinkSettings DefaultValue => - new() - { - IsEnabled = false, - Links = [] - }; + public static SocialLinkSettings DefaultValue => + new() + { + IsEnabled = false, + Links = [] + }; } public class SocialLink { - public string Name { get; set; } + public string Name { get; set; } - public string Icon { get; set; } + public string Icon { get; set; } - public string Url { get; set; } + public string Url { get; set; } } public class SocialLinkSettingsJsonModel { - [Display(Name = "Enable Social Links")] - public bool IsEnabled { get; set; } + [Display(Name = "Enable Social Links")] + public bool IsEnabled { get; set; } - [MaxLength(1024)] - public string JsonData { get; set; } -} \ No newline at end of file + [MaxLength(4096)] + public string JsonData { get; set; } +} diff --git a/src/Moonglade.Configuration/SocialProfileSettings.cs b/src/Moonglade.Configuration/SocialProfileSettings.cs deleted file mode 100644 index 9a5f225f9..000000000 --- a/src/Moonglade.Configuration/SocialProfileSettings.cs +++ /dev/null @@ -1,357 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Text.Json.Serialization; - -namespace Moonglade.Configuration -{ - /// - /// Settings for the Social Profiles. - /// - /// - public class SocialProfileSettings : IBlogSettings - { - /// - /// Gets or sets the GPG key URL. - /// - /// - /// The GPG key URL. - /// - [Display(Name = "Url to your public GPG key")] - public string GpgKeyUrl { get; set; } - - /// - /// Gets or sets the twitter profile link. - /// - /// - /// The twitter link. - /// - [Display(Name = "Twitter Profile Link")] - public string Twitter { get; set; } - - /// - /// Gets or sets the mastodon profile link. - /// - /// - /// The mastodon url. - /// - [Display(Name = "Mastodon Profile Link")] - public string Mastodon { get; set; } - - /// - /// Gets or sets the facebook profile url. - /// - /// - /// The facebook profile url. - /// - [Display(Name = "Facebook Profile Link")] - public string Facebook { get; set; } - - /// - /// Gets or sets the instagram profile url. - /// - /// - /// The instagram profile url. - /// - [Display(Name = "Instagram Profile Link")] - public string Instagram { get; set; } - - /// - /// Gets or sets the linkedIn profile url. - /// - /// - /// The linkedIn profile url. - /// - [Display(Name = "Linkedin Profile Link")] - public string LinkedIn { get; set; } - - /// - /// Gets or sets YouTube profile url. - /// - /// - /// You tube profile url. - /// - [Display(Name = "Youtube Profile Link")] - public string YouTube { get; set; } - - /// - /// Gets or sets the GitHub profile url. - /// - /// - /// The GitHub profile url. - /// - [Display(Name = "Github Profile Link")] - public string GitHub { get; set; } - - /// - /// Gets or sets the xing profile url. - /// - /// - /// The xing profile url. - /// - [Display(Name = "Xing Profile Link")] - public string Xing { get; set; } - - /// - /// Gets or sets the Pinterest profile url. - /// - /// - /// The pinterest profile url. - /// - [Display(Name = "Pinterest Profile Link")] - public string Pinterest { get; set; } - - /// - /// Gets or sets the Reddit profile url. - /// - /// - /// The reddit profile url. - /// - [Display(Name = "Reddit Profile Link")] - public string Reddit { get; set; } - - /// - /// Gets or sets the Vimeo profile url. - /// - /// - /// The Vimeo profile url. - /// - [Display(Name = "Vimeo Profile Link")] - public string Vimeo { get; set; } - - /// - /// Gets or sets the Behance profile url. - /// - /// - /// The Behance profile url. - /// - [Display(Name = "Behance Profile Link")] - public string Behance { get; set; } - - /// - /// Gets or sets the Spotify profile url. - /// - /// - /// The Spotify profile url. - /// - [Display(Name = "Spotify Profile Link")] - public string Spotify { get; set; } - - /// - /// Gets or sets the Twitch profile url. - /// - /// - /// The Twitch profile url. - /// - [Display(Name = "Twitch Profile Link")] - public string Twitch { get; set; } - - /// - /// Gets or sets the WhatsAPp profile page. - /// - /// - /// The profile Url Like: https://wa.me/YourNumber . - /// . - /// - [Display(Name = "WhatsApp Profile Link")] - public string WhatsApp { get; set; } - - /// - /// Gets or sets the Skype profile page. - /// - /// - /// The Skype profile page. - /// - [Display(Name = "Skype Profile Link")] - public string Skype { get; set; } - - /// - /// Gets or sets the Discord profile page. - /// - /// - /// The Discord profile page. - /// - [Display(Name = "Discord Profile Link")] - public string Discord { get; set; } - - /// - /// Gets or sets the Steam profile page. - /// - /// - /// The Steam profile page. - /// - [Display(Name = "Steam Profile Link")] - public string Steam { get; set; } - - /// - /// Gets or sets the Stackoverflow profile page. - /// - /// - /// The Stackoverflow profile page. - /// - [Display(Name = "Stackoverflow Profile Link")] - public string Stackoverflow { get; set; } - - /// - /// Gets or sets the DevTo profile page. - /// - /// - /// The DevTo profile page. - /// - [Display(Name = "DevTo Profile Link")] - public string DevTo { get; set; } - - /// - /// Gets or sets the Codersrank profile page. - /// - /// - /// The Codersrank profile page. - /// - [Display(Name = "Codersrank Profile Link")] - public string Codersrank { get; set; } - - /// - /// Gets or sets the amazon author page. If you published a book, this is your author page on Amazon. - /// - /// - /// The amazon author page. - /// - [Display(Name = "AmazonAuthor Profile Link")] - public string AmazonAuthorPage { get; set; } - - /// - /// Gets or sets the Last.fm profile page. - /// - /// - /// The last.fm profile page. - /// - [Display(Name = "LastFM Profile Link")] - public string LastFm { get; set; } - - /// - /// Gets or sets the CodeProject profile page. - /// - /// - /// The CodeProject profile page. - /// - [Display(Name = "Codeproject Profile Link")] - public string CodeProject { get; set; } - - /// - /// Gets or sets the Matrix profile page. - /// - /// - /// The Matrix profile page. - /// - [Display(Name = "Matrix Profile Link")] - public string Matrix { get; set; } - - /// - /// Gets or sets the OpenHub profile page. - /// - /// - /// The OpenHub profile page. - /// - [Display(Name = "OpenHub Profile Link")] - public string OpenHub { get; set; } - - /// - /// Gets or sets the CodeStats profile page. - /// - /// - /// The CodeStats profile page. - /// - [Display(Name = "CodeStats Profile Link")] - public string CodeStats { get; set; } - - /// - /// Gets or sets the KeyBase profile page. - /// - [Display(Name = "KeyBase Profile link")] - public string KeyBase { get; set; } - - // Donations - /// - /// Gets or sets the buy me a coffee. - /// - /// - /// The buy me a coffee. - /// - [Display(Name = "BuyMeACoffe Link")] - public string BuyMeACoffee { get; set; } - - /// - /// Gets or sets the amazon wishlist. - /// - /// - /// The amazon wishlist. - /// - [Display(Name = "Amazon Wishlist Link")] - public string AmazonWishlist { get; set; } - - /// - /// Gets or sets the Paypal.me link. - /// - /// - /// The Paypal.me link. - /// - [Display(Name = "Paypal.me Link")] - public string Paypal { get; set; } - - /// - /// Gets or sets the Patreon profile page. - /// - /// - /// The Patreon profile page. - /// - [Display(Name = "Patreon Link")] - public string Patreon { get; set; } - - /// - /// Gets or sets the Liberapay profile page. - /// - /// - /// The Liberapay profile page. - /// - [Display(Name = "Liberapay Link")] - public string Liberapay { get; set; } - - [JsonIgnore] - public static SocialProfileSettings DefaultValue => - new() - { - GpgKeyUrl = string.Empty, - Twitter = string.Empty, - Mastodon = string.Empty, - Facebook = string.Empty, - Instagram = string.Empty, - LinkedIn = string.Empty, - YouTube = string.Empty, - GitHub = string.Empty, - Xing = string.Empty, - Pinterest = string.Empty, - Reddit = string.Empty, - Vimeo = string.Empty, - Behance = string.Empty, - Spotify = string.Empty, - Twitch = string.Empty, - WhatsApp = string.Empty, - Skype = string.Empty, - Discord = string.Empty, - Steam = string.Empty, - Stackoverflow = string.Empty, - DevTo = string.Empty, - Codersrank = string.Empty, - AmazonAuthorPage = string.Empty, - LastFm = string.Empty, - CodeProject = string.Empty, - Matrix = string.Empty, - OpenHub = string.Empty, - CodeStats = string.Empty, - KeyBase = string.Empty, - BuyMeACoffee = string.Empty, - AmazonWishlist = string.Empty, - Paypal = string.Empty, - Patreon = string.Empty, - Liberapay = string.Empty - }; - } -} diff --git a/src/Moonglade.Core/GetAllSocialLinksQuery.cs b/src/Moonglade.Core/GetAllSocialLinksQuery.cs index 2302d6c71..eb291b175 100644 --- a/src/Moonglade.Core/GetAllSocialLinksQuery.cs +++ b/src/Moonglade.Core/GetAllSocialLinksQuery.cs @@ -6,16 +6,16 @@ public record GetAllSocialLinksQuery : IRequest; public class GetAllSocialLinksQueryHandler(IBlogConfig blogConfig) : IRequestHandler { - public Task Handle(GetAllSocialLinksQuery request, CancellationToken ct) - { - var section = blogConfig.SocialLinkSettings; - - if (!section.IsEnabled) - { - return Task.FromResult(Array.Empty()); - } + public Task Handle(GetAllSocialLinksQuery request, CancellationToken ct) + { + var section = blogConfig.SocialLinkSettings; - var links = blogConfig.SocialLinkSettings.Links; - return Task.FromResult(links); + if (!section.IsEnabled) + { + return Task.FromResult(Array.Empty()); } -} \ No newline at end of file + + var links = blogConfig.SocialLinkSettings.Links; + return Task.FromResult(links); + } +} diff --git a/src/Moonglade.Core/GetSocialLinkQuery.cs b/src/Moonglade.Core/GetSocialLinkQuery.cs new file mode 100644 index 000000000..705d4cbee --- /dev/null +++ b/src/Moonglade.Core/GetSocialLinkQuery.cs @@ -0,0 +1,21 @@ +using Moonglade.Configuration; + +namespace Moonglade.Core; + +public record GetSocialLinkQuery(string name) : IRequest; + +public class GetSocialLinkQueryHandler(IBlogConfig blogConfig) : IRequestHandler +{ + public Task Handle(GetSocialLinkQuery request, CancellationToken ct) + { + var section = blogConfig.SocialLinkSettings; + + if (!section.IsEnabled) + { + return Task.FromResult(new SocialLink { }); + } + + var link = Array.Find(blogConfig.SocialLinkSettings.Links, e => e.Name == request.name); + return Task.FromResult(link); + } +} diff --git a/src/Moonglade.Core/SaschaFeature/GetRepositoriesQuery.cs b/src/Moonglade.Core/SaschaFeature/GetRepositoriesQuery.cs index f75d1735c..7412e8a8b 100644 --- a/src/Moonglade.Core/SaschaFeature/GetRepositoriesQuery.cs +++ b/src/Moonglade.Core/SaschaFeature/GetRepositoriesQuery.cs @@ -1,15 +1,16 @@ -using Moonglade.Github.Client.Models; +using Moonglade.Configuration; +using Moonglade.Github.Client.Models; using Moonglade.Github.Client.Services; namespace Moonglade.Core.SaschaFeature; -public record GetAllRepositoriesQuery() : IRequest>; +public record GetAllRepositoriesQuery(SocialLink githubSocialLink) : IRequest>; public class GetAllRepositoriesQueryHandler(IGithubUserRepositoriesService service) : IRequestHandler> { public Task> Handle(GetAllRepositoriesQuery request, CancellationToken ct) { - var repos = service.GetUserRepositories(); + var repos = service.GetUserRepositories(request.githubSocialLink); return repos; } } diff --git a/src/Moonglade.Github.Client/Services/GithubUserRepositoriesService.cs b/src/Moonglade.Github.Client/Services/GithubUserRepositoriesService.cs index 8cdc52ad7..c8ad944f5 100644 --- a/src/Moonglade.Github.Client/Services/GithubUserRepositoriesService.cs +++ b/src/Moonglade.Github.Client/Services/GithubUserRepositoriesService.cs @@ -11,23 +11,21 @@ namespace Moonglade.Github.Client.Services; public class GithubUserRepositoriesService : IGithubUserRepositoriesService { - private readonly string _ghUser; private readonly ILogger _logger; private readonly IGithubClient _githubClient; public GithubUserRepositoriesService(IBlogConfig blogConfig, IGithubClient githubClient, ILogger logger) { - var ghProfileLink = blogConfig.SocialProfileSettings.GitHub; - _ghUser = ghProfileLink?.Replace("https://github.com/", ""); _githubClient = githubClient; _logger = logger; } - public async Task> GetUserRepositories() + public async Task> GetUserRepositories(SocialLink githubSocialLink) { try { - var endpoint = $"/users/{_ghUser}/repos"; + var ghUser = githubSocialLink.Url?.Replace("https://github.com/", ""); + var endpoint = $"/users/{ghUser}/repos"; var ghResponse = await _githubClient.SendRequest(Method.Get, endpoint, ""); _logger.LogInformation("Github response: {0}", ghResponse.Content); var repositories = JsonConvert.DeserializeObject>(ghResponse.Content); @@ -35,7 +33,7 @@ public async Task> GetUserRepositories() { if (string.IsNullOrEmpty(repo.HtmlUrl)) { - repo.HtmlUrl = $"https://github.com/{_ghUser}/{repo.Name}"; + repo.HtmlUrl = $"https://github.com/{ghUser}/{repo.Name}"; } } return repositories; diff --git a/src/Moonglade.Github.Client/Services/IGithubUserRepositoriesService.cs b/src/Moonglade.Github.Client/Services/IGithubUserRepositoriesService.cs index 32021de8f..891ae2923 100644 --- a/src/Moonglade.Github.Client/Services/IGithubUserRepositoriesService.cs +++ b/src/Moonglade.Github.Client/Services/IGithubUserRepositoriesService.cs @@ -1,8 +1,9 @@ -using Moonglade.Github.Client.Models; +using Moonglade.Configuration; +using Moonglade.Github.Client.Models; namespace Moonglade.Github.Client.Services; public interface IGithubUserRepositoriesService { - Task> GetUserRepositories(); + Task> GetUserRepositories(SocialLink githubSocialLink); } diff --git a/src/Moonglade.Web/Controllers/SettingsController.cs b/src/Moonglade.Web/Controllers/SettingsController.cs index 8dba83af9..821fb59b2 100644 --- a/src/Moonglade.Web/Controllers/SettingsController.cs +++ b/src/Moonglade.Web/Controllers/SettingsController.cs @@ -60,16 +60,6 @@ public async Task General(GeneralSettings model, ITimeZoneResolve return NoContent(); } - [HttpPost("social")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - public async Task Social(SocialProfileSettings model) - { - blogConfig.SocialProfileSettings = model; - - await SaveConfigAsync(blogConfig.SocialProfileSettings); - return NoContent(); - } - [HttpPost("content")] [ProducesResponseType(StatusCodes.Status204NoContent)] public async Task Content(ContentSettings model) @@ -169,31 +159,31 @@ public async Task Advanced(AdvancedSettings model) return NoContent(); } - [HttpPost("social-link")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - public async Task SocialLink(SocialLinkSettingsJsonModel model) + [HttpPost("social-link")] + [ProducesResponseType(StatusCodes.Status204NoContent)] + public async Task SocialLink(SocialLinkSettingsJsonModel model) + { + if (model.IsEnabled && string.IsNullOrWhiteSpace(model.JsonData)) { - if (model.IsEnabled && string.IsNullOrWhiteSpace(model.JsonData)) - { - ModelState.AddModelError(nameof(SocialLinkSettingsJsonModel.JsonData), "JsonData is required"); - return BadRequest(ModelState.CombineErrorMessages()); - } - - blogConfig.SocialLinkSettings = new() - { - IsEnabled = model.IsEnabled, - Links = model.JsonData.FromJson() - }; - - await SaveConfigAsync(blogConfig.SocialLinkSettings); - return NoContent(); + ModelState.AddModelError(nameof(SocialLinkSettingsJsonModel.JsonData), "JsonData is required"); + return BadRequest(ModelState.CombineErrorMessages()); } - [HttpPost("reset")] - [ProducesResponseType(StatusCodes.Status202Accepted)] - public async Task Reset(BlogDbContext context, IHostApplicationLifetime applicationLifetime) + blogConfig.SocialLinkSettings = new() { - logger.LogWarning($"System reset is requested by '{User.Identity?.Name}', IP: {Helper.GetClientIP(HttpContext)}."); + IsEnabled = model.IsEnabled, + Links = model.JsonData.FromJson() + }; + + await SaveConfigAsync(blogConfig.SocialLinkSettings); + return NoContent(); + } + + [HttpPost("reset")] + [ProducesResponseType(StatusCodes.Status202Accepted)] + public async Task Reset(BlogDbContext context, IHostApplicationLifetime applicationLifetime) + { + logger.LogWarning($"System reset is requested by '{User.Identity?.Name}', IP: {Helper.GetClientIP(HttpContext)}."); await context.ClearAllData(); diff --git a/src/Moonglade.Web/Pages/About.cshtml b/src/Moonglade.Web/Pages/About.cshtml index 5e79612b5..ed0b6274c 100644 --- a/src/Moonglade.Web/Pages/About.cshtml +++ b/src/Moonglade.Web/Pages/About.cshtml @@ -39,12 +39,6 @@ -
-

<@Model.ViewModel.Connect.Value

- -
Last.fm Last played badge
-
-

@Model.ViewModel.AboutMemberships.Value

@foreach (var membership in Model.ViewModel.Memberships) diff --git a/src/Moonglade.Web/Pages/About.cshtml.cs b/src/Moonglade.Web/Pages/About.cshtml.cs index e71327343..88745b897 100644 --- a/src/Moonglade.Web/Pages/About.cshtml.cs +++ b/src/Moonglade.Web/Pages/About.cshtml.cs @@ -19,7 +19,8 @@ public async Task OnGetAsync() ViewModel.Mandates = await mediator.Send(new GetAllMandatesQuery()); ViewModel.HonoraryPositions = await mediator.Send(new GetHonoraryPositionsByLanguageQuery()); ViewModel.Publications = await mediator.Send(new GetAllPublicationsQuery()); - ViewModel.Repositories = await mediator.Send(new GetAllRepositoriesQuery()); + var ghUserLink = await mediator.Send(new GetSocialLinkQuery("Github")); + ViewModel.Repositories = await mediator.Send(new GetAllRepositoriesQuery(ghUserLink)); var langCode = CultureInfo.CurrentUICulture.ToString().ToLower(); var convertedCulture = LanguageExtensions.FromLangCodeToLang(langCode); ViewModel.MeAnTheBlog = @@ -42,6 +43,7 @@ public async Task OnGetAsync() ViewModel.NugetTitle = await mediator.Send(new GetPageContentByKeyValueQuery("nuget", "about", convertedCulture)); ViewModel.NugetPackages = await mediator.Send(new GetAllNugetPackagesQuery()); ViewModel.Testimonials = await mediator.Send(new GetAllTestimonialsQuery()); + ViewModel.SocialLinks = await mediator.Send(new GetAllSocialLinksQuery()); return Page(); } } @@ -65,5 +67,6 @@ public class AboutViewModel public PagesContentEntity LastUpdated { get; set; } public PagesContentEntity NugetTitle { get; set; } public List NugetPackages { get; set; } + public SocialLink[] SocialLinks { get; set; } } } diff --git a/src/Moonglade.Web/Pages/Imprint.cshtml b/src/Moonglade.Web/Pages/Imprint.cshtml index 8235e8277..52d154d21 100644 --- a/src/Moonglade.Web/Pages/Imprint.cshtml +++ b/src/Moonglade.Web/Pages/Imprint.cshtml @@ -30,7 +30,6 @@ Width = 25 } }; - } @section Scripts { -} -@section head { - -} - - -
-
-
-
-
-
Social Media
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
-
@SharedLocalizer["Donations"]
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
-
-
-
@SharedLocalizer["Social Profiles"]
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
-
-
-
-
- -
-
-
- diff --git a/src/Moonglade.Web/Pages/Settings/_SettingsHeader.cshtml b/src/Moonglade.Web/Pages/Settings/_SettingsHeader.cshtml index 7d6769186..309ea53d6 100644 --- a/src/Moonglade.Web/Pages/Settings/_SettingsHeader.cshtml +++ b/src/Moonglade.Web/Pages/Settings/_SettingsHeader.cshtml @@ -28,8 +28,5 @@ -
diff --git a/src/Moonglade.Web/Pages/Shared/_SocialProfiles.cshtml b/src/Moonglade.Web/Pages/Shared/_SocialProfiles.cshtml deleted file mode 100644 index 66cc0b589..000000000 --- a/src/Moonglade.Web/Pages/Shared/_SocialProfiles.cshtml +++ /dev/null @@ -1,324 +0,0 @@ -@{ - -} -
    - @if (BlogConfig.SocialProfileSettings.GpgKeyUrl != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Twitter != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Instagram != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.YouTube != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Xing != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Reddit != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Behance != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Twitch != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Skype != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Steam != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.DevTo != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.AmazonAuthorPage != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.CodeProject != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.OpenHub != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.KeyBase != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Mastodon != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Facebook != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.LinkedIn != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.GitHub != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Pinterest != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Vimeo != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Spotify != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.WhatsApp != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Discord != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Stackoverflow != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Facebook != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.LastFm != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.Matrix != null) - { -
  • - - - - - - -
  • - } - @if (BlogConfig.SocialProfileSettings.CodeStats != null) - { -
  • - - - - - - -
  • - } -
\ No newline at end of file diff --git a/src/Moonglade.Web/Pages/Shared/_TwitterMetaData.cshtml b/src/Moonglade.Web/Pages/Shared/_TwitterMetaData.cshtml index 0b9bf0fa7..35a089806 100644 --- a/src/Moonglade.Web/Pages/Shared/_TwitterMetaData.cshtml +++ b/src/Moonglade.Web/Pages/Shared/_TwitterMetaData.cshtml @@ -1,7 +1,7 @@ @model Moonglade.Web.Pages.PostModel @{ - var xUrl = BlogConfig.SocialProfileSettings.Twitter; + var xUrl = Model.Twitter.Url; var user = "@" + xUrl.Replace("https://x.com/", ""); } diff --git a/src/Moonglade.Web/Pages/_Sponsoring.cshtml b/src/Moonglade.Web/Pages/_Sponsoring.cshtml index 8bc351de4..7f268d43d 100644 --- a/src/Moonglade.Web/Pages/_Sponsoring.cshtml +++ b/src/Moonglade.Web/Pages/_Sponsoring.cshtml @@ -1,67 +1,68 @@ -@{ +@model PostModel +@{ } -@if (BlogConfig.SocialProfileSettings.BuyMeACoffee != null) +@if (Model.BuyMeACoffee.Url != null) {
  • - + - + - Buy me a coffee + @Model.BuyMeACoffee.Name
  • } -@if (BlogConfig.SocialProfileSettings.Liberapay != null) +@if (Model.Liberapay.Url != null) {
  • - + - + - Liberapay + @Model.Liberapay.Name
  • } -@if (BlogConfig.SocialProfileSettings.Patreon != null) +@if (Model.Patreon.Url != null) {
  • - + - + - Patreon + @Model.Patreon.Name
  • } -@if (BlogConfig.SocialProfileSettings.AmazonWishlist != null) +@if (Model.AmazonWishlist.Url != null) {
  • - + - + - Amazon Wishlist + @Model.AmazonWishlist.Name
  • } -@if (BlogConfig.SocialProfileSettings.Paypal != null) +@if (Model.Paypal.Url != null) {
  • - + - + - Paypal + @Model.Paypal.Name
  • } \ No newline at end of file