Skip to content

Commit add65e1

Browse files
committed
1 parent 695a635 commit add65e1

File tree

3 files changed

+42
-9
lines changed

3 files changed

+42
-9
lines changed

App.config

+3
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@
1717
<!-- Turn on to speed up processing for development/writing -->
1818
<add key="SuppressSpeakers" value="false"/>
1919
<add key="SuppressProjects" value="false"/>
20+
<add key="SuppressSpeakerBlogs" value="false"/>
21+
<add key="SuppressSpeakerGeoLocation" value="false"/>
22+
<add key="SuppressSpeakerImages" value="false"/>
2023
</appSettings>
2124
</configuration>

AppSettings.cs

+8
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,13 @@ public static class AppSettings
4141
public static bool SuppressProjects { get; set; }
4242
= string.Equals(ConfigurationManager.AppSettings["SuppressProjects"], "true", StringComparison.OrdinalIgnoreCase);
4343

44+
public static bool SuppressSpeakerBlogs { get; set; }
45+
= string.Equals(ConfigurationManager.AppSettings["SuppressSpeakerBlogs"], "true", StringComparison.OrdinalIgnoreCase);
46+
47+
public static bool SuppressSpeakerGeoLocation { get; set; }
48+
= string.Equals(ConfigurationManager.AppSettings["SuppressSpeakerGeoLocation"], "true", StringComparison.OrdinalIgnoreCase);
49+
50+
public static bool SuppressSpeakerImages { get; set; }
51+
= string.Equals(ConfigurationManager.AppSettings["SuppressSpeakerImages"], "true", StringComparison.OrdinalIgnoreCase);
4452
}
4553
}

Program.cs

+31-9
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,39 @@ public static async Task<int> Main(string[] args)
5353

5454
private static Bootstrapper AddSpeakersPipeline(Bootstrapper bootstrapper)
5555
{
56+
var sources = new ExecuteSources("community/speakers/*.md");
57+
58+
if (!AppSettings.SuppressSpeakerGeoLocation)
59+
{
60+
sources.Add(new GeocodeLocations(Config.FromSetting(SiteKeys.AzureMapsSubscriptionKey)));
61+
}
62+
else
63+
{
64+
Console.WriteLine("Suppressing Geolocation extraction ****SHOULD ONLY BE IN DEBUG***");
65+
}
66+
67+
if (!AppSettings.SuppressSpeakerBlogs)
68+
{
69+
sources.Add(new GetBlogFeeds());
70+
}
71+
else
72+
{
73+
Console.WriteLine("Suppressing Speaker Blog Entry retrieval ****SHOULD ONLY BE IN DEBUG***");
74+
}
75+
76+
if (!AppSettings.SuppressSpeakerImages)
77+
{
78+
sources.Add(new SpeakerImage());
79+
}
80+
else
81+
{
82+
Console.WriteLine("Suppressing Speaker Images retrieval ****SHOULD ONLY BE IN DEBUG***");
83+
}
84+
5685
bootstrapper = bootstrapper.ModifyPipeline(
5786
nameof(Statiq.Web.Pipelines.Content),
58-
x => x.ProcessModules.Add(
59-
// Modules for speakers
60-
new ExecuteSources("community/speakers/*.md")
61-
{
62-
new GeocodeLocations(Config.FromSetting(SiteKeys.AzureMapsSubscriptionKey)),
63-
new GetBlogFeeds(),
64-
new SpeakerImage()
65-
}
66-
));
87+
x => x.ProcessModules.Add(sources));
88+
6789
return bootstrapper;
6890
}
6991

0 commit comments

Comments
 (0)