Package
#n Wyam.Minification
Examples
Pipelines.Add("Content",
ReadFiles("*.md"),
FrontMatter(Yaml()),
Markdown(),
Razor(),
MinifyXhtml(),
WriteFiles(".html")
);
Usage
-
MinifyXhtml(bool useEmptyMinificationSettings = false)
Minifies the XHTML content.
useEmptyMinificationSettings
Boolean to specify whether to use empty minification settings. Default value is
false
, this will use commonly accepted settings.
Fluent Methods
Chain these methods together after the constructor to modify behavior.
-
RemoveHtmlComments(bool removeHtmlComments = true)
Flag for whether to remove all HTML comments, except conditional, noindex, KnockoutJS containerless comments and AngularJS comment directives.
removeHtmlComments
Default value is
true
.
-
RemoveTagsWithoutContent(bool removeTagsWithoutContent = false)
Flag for whether to remove tags without content, except for
textarea
,tr
,th
andtd
tags, and tags withclass
,id
,name
,role
,src
anddata-*
attributes.removeTagsWithoutContent
Default value is
false
.
-
RenderEmptyTagsWithSpace(bool renderEmptyTagsWithSpace = true)
Flag for whether to allow the inserting space before slash in empty tags (for example,
true
-
;false
-
).renderEmptyTagsWithSpace
Default value is
true
.
-
WithSettings(Action<XhtmlMinificationSettings> action)
Updates the minification settings.
action
A function to update the minification settings with.