Skip to content

Commit

Permalink
feat: add helpers for linkedin, github and buymeacoffee usernames
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkurSheel committed Dec 1, 2021
1 parent 4d5ae28 commit 070adbb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/StatiqHelpers/Extensions/ContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@ public static string GetDescription(this IExecutionContext context)
public static string GetCanonicalUrl(this IExecutionContext context, IDocument document)
=> context.GetString("canonicalUrl") ?? document.GetPageUrl(false);

public static string GetTwitterUserName(this IExecutionContext context)
public static string GetTwitterUsername(this IExecutionContext context)
=> context.GetString("TwitterUsername");

public static string GetLinkedInUsername(this IExecutionContext context)
=> context.GetString("LinkedInUsername");

public static string GetBuyMeACoffeeUsername(this IExecutionContext context)
=> context.GetString("BuyMeACoffeeUsername");

public static string GetGithubUserName(this IExecutionContext context)
=> context.GetString("GithubUsername");

public static string? GetGoogleTagManagerId(this IExecutionContext context)
=> context.GetString("Environment") != "Development"
? context.GetString("GoogleTagManagerId")
Expand Down

0 comments on commit 070adbb

Please sign in to comment.