Skip to content

Commit 8ddb60c

Browse files
committed
move supporter list into environment config
1 parent 2b1f607 commit 8ddb60c

6 files changed

Lines changed: 22 additions & 24 deletions

File tree

src/SMAPI.Web/Controllers/IndexController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public async Task<ViewResult> Index()
7272
: null;
7373

7474
// render view
75-
var model = new IndexModel(stableVersionModel, betaVersionModel, this.SiteConfig.BetaBlurb);
75+
var model = new IndexModel(stableVersionModel, betaVersionModel, this.SiteConfig.BetaBlurb, this.SiteConfig.SupporterList);
7676
return this.View(model);
7777
}
7878

src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ public class SiteConfig // must be public to pass into views
1111

1212
/// <summary>A short sentence shown under the beta download button, if any.</summary>
1313
public string BetaBlurb { get; set; }
14+
15+
/// <summary>A list of supports to credit on the main page, in Markdown format.</summary>
16+
public string SupporterList { get; set; }
1417
}
1518
}

src/SMAPI.Web/ViewModels/IndexModel.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ public class IndexModel
1515
/// <summary>A short sentence shown under the beta download button, if any.</summary>
1616
public string BetaBlurb { get; set; }
1717

18+
/// <summary>A list of supports to credit on the main page, in Markdown format.</summary>
19+
public string SupporterList { get; set; }
20+
1821

1922
/*********
2023
** Public methods
@@ -26,11 +29,13 @@ public IndexModel() { }
2629
/// <param name="stableVersion">The latest stable SMAPI version.</param>
2730
/// <param name="betaVersion">The latest prerelease SMAPI version (if newer than <paramref name="stableVersion"/>).</param>
2831
/// <param name="betaBlurb">A short sentence shown under the beta download button, if any.</param>
29-
internal IndexModel(IndexVersionModel stableVersion, IndexVersionModel betaVersion, string betaBlurb)
32+
/// <param name="supporterList">A list of supports to credit on the main page, in Markdown format.</param>
33+
internal IndexModel(IndexVersionModel stableVersion, IndexVersionModel betaVersion, string betaBlurb, string supporterList)
3034
{
3135
this.StableVersion = stableVersion;
3236
this.BetaVersion = betaVersion;
3337
this.BetaBlurb = betaBlurb;
38+
this.SupporterList = supporterList;
3439
}
3540
}
3641
}

src/SMAPI.Web/Views/Index/Index.cshtml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@using Markdig
12
@using Microsoft.Extensions.Options
23
@using StardewModdingAPI.Web.Framework
34
@using StardewModdingAPI.Web.Framework.ConfigModels
@@ -94,29 +95,22 @@ else
9495
</li>
9596
<li>
9697
<a href="https://ko-fi.com/pathoschild" class="donate-button">
97-
<img src="Content/images/ko-fi.png"/> Buy me a coffee
98+
<img src="Content/images/ko-fi.png" /> Buy me a coffee
9899
</a>
99100
</li>
100101
<li>
101102
<a href="https://www.paypal.me/pathoschild" class="donate-button">
102-
<img src="Content/images/paypal.png"/> Donate via PayPal
103+
<img src="Content/images/paypal.png" /> Donate via PayPal
103104
</a>
104105
</li>
105106
</ul>
106107

107-
<p>
108-
Special thanks to
109-
<a href="https://www.nexusmods.com/users/65566526?tab=user+files">bwdy</a>,
110-
hawkfalcon,
111-
<a href="https://twitter.com/iKeychain">iKeychain</a>,
112-
jwdred,
113-
<a href="https://www.nexusmods.com/users/12252523">Karmylla</a>,
114-
<a href="https://www.nexusmods.com/stardewvalley/users/51777556">minervamaga</a>,
115-
Pucklynn,
116-
Renorien,
117-
Robby LaFarge,
118-
and a few anonymous users for their ongoing support on Patreon; you're awesome!
119-
</p>
108+
@if (!string.IsNullOrWhiteSpace(Model.SupporterList))
109+
{
110+
@Html.Raw(Markdig.Markdown.ToHtml(
111+
$"Special thanks to {Model.SupporterList}, and a few anonymous users for their ongoing support on Patreon; you're awesome!"
112+
))
113+
}
120114

121115
<h2 id="modcreators">For mod creators</h2>
122116
<ul>

src/SMAPI.Web/appsettings.Development.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88

99
*/
1010
{
11-
"Site": {
12-
"BetaEnabled": false,
13-
"BetaBlurb": null
14-
},
15-
1611
"ApiClients": {
1712
"AmazonAccessKey": null,
1813
"AmazonSecretKey": null,

src/SMAPI.Web/appsettings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
},
1717

1818
"Site": {
19-
"BetaEnabled": null,
20-
"BetaBlurb": null
19+
"BetaEnabled": false,
20+
"BetaBlurb": null,
21+
"SupporterList": null
2122
},
2223

2324
"ApiClients": {

0 commit comments

Comments
 (0)