Skip to content

Commit

Permalink
Merged PR 97: Switched to SocialLinks
Browse files Browse the repository at this point in the history
- refactor: Moved to new Social Links
- refactor: Switched to SocialLinks from SocialProfileSettings.
- fix: Fixed missing Paypal Link
  • Loading branch information
saigkill committed Oct 27, 2024
2 parents e4baa3d + 16d4789 commit 763fa21
Show file tree
Hide file tree
Showing 19 changed files with 137 additions and 1,239 deletions.
3 changes: 0 additions & 3 deletions src/Moonglade.Configuration/BlogConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public interface IBlogConfig
LocalAccountSettings LocalAccountSettings { get; set; }
SocialLinkSettings SocialLinkSettings { get; set; }
SystemManifestSettings SystemManifestSettings { get; set; }
SocialProfileSettings SocialProfileSettings { get; set; }
IEnumerable<int> LoadFromConfig(IDictionary<string, string> config);
KeyValuePair<string, string> UpdateAsync<T>(T blogSettings) where T : IBlogSettings;
}
Expand All @@ -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; }

Expand All @@ -55,7 +53,6 @@ public IEnumerable<int> LoadFromConfig(IDictionary<string, string> 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);
Expand Down
32 changes: 16 additions & 16 deletions src/Moonglade.Configuration/SocialLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
[MaxLength(4096)]
public string JsonData { get; set; }
}
Loading

0 comments on commit 763fa21

Please sign in to comment.