Skip to content

Commit

Permalink
Added media type for .fhtml
Browse files Browse the repository at this point in the history
  • Loading branch information
daveaglick committed Dec 1, 2020
1 parent d108bda commit 752ddd7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Added some additional retry policies to file operations to avoid file lock exceptions under certain conditions (#151).
- Added ability to customize the body of meta-refresh redirect HTML files using the `RedirectBody` key (#153).
- Added `.fhtml` as a media type to mean HTML fragments (needed so that we can treat full HTML and HTML fragments differently when applying layouts in Statiq Web).

# 1.0.0-beta.30

Expand Down
18 changes: 10 additions & 8 deletions src/core/Statiq.Common/Content/MediaTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,22 @@ public static class MediaTypes
{
// Some common and relevant media types
// Use lookups to make sure we reflect any changes to the mapping
public static string CSharp => Get(".cs");
public static string Css => Get(".css");
public static string Gif => Get(".gif");
public static string Handlebars => Get(".hbs");
public static string Html => Get(".html");
public static string HtmlFragment => Get(".fhtml");
public static string Jpg => Get(".jpg");
public static string Json => Get(".json");
public static string Less => Get(".less");
public static string Markdown => Get(".md");
public static string Png => Get(".png");
public static string Razor => Get(".cshtml");
public static string Less => Get(".less");
public static string Sass => Get(".sass");
public static string Scss => Get(".scss");
public static string Xml => Get(".xml");
public static string Yaml => Get(".yaml");
public static string CSharp => Get(".cs");

/// <summary>
/// A mapping of file extension to both registered IANA media types
Expand Down Expand Up @@ -1058,17 +1059,18 @@ async Task Main()

// Additional conventional media types not registered with IANA
// This is a good resource for finding conventional extensions: https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
{ ".cs", "text/x-csharp" },
{ ".cshtml", "text/x-cshtml" }, // This is what VSCode uses: https://github.com/aspnet/AspNetCore-Tooling/blob/master/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode.Extension/package.json
{ ".csx", "text/x-csharp" },
{ ".fhtml", "text/x-fhtml" }, // HTML fragment, discussion at https://stackoverflow.com/q/811887
{ ".handlebars", "text/handlebars" },
{ ".hbs", "text/handlebars" },
{ ".md", "text/markdown" },
{ ".sass", "text/x-sass" },
{ ".scss", "text/x-scss" },
{ ".yaml", "text/yaml" },
{ ".yml", "text/yaml" },
{ ".wasm", "application/wasm" },
{ ".hbs", "text/handlebars" },
{ ".handlebars", "text/handlebars" },
{ ".cs", "text/x-csharp" },
{ ".csx", "text/x-csharp" }
{ ".yaml", "text/yaml" },
{ ".yml", "text/yaml" }
};

/// <summary>
Expand Down

0 comments on commit 752ddd7

Please sign in to comment.