All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- HtmlFileContents.lang is induced by default from its contents.
- Import from vanilla JS compatibility.
SsiIncludeReplaceCommand
's constructorcontext
parameter.
SsiIncludeReplaceCommand
's constructor now accepts an optionaltransformer
s to apply before including.
ContentStep
'sname
can be optionally specified in constructor (fix).
ContentStep
'sname
can be optionally specified in constructor.
ContentStep.postExecute()
can be overridden.
ContentStep
doesn't require aSsgContextImpl
implementation anymore, just anySsgContext
implementation.
- Fix
shouldProcessFile()
ContentStep.shouldProcess()
is split betweenshouldProcessFile()
andshouldProcessContent()
to avoid loading file contents when not required
- output/input files date comparison for
ContentStep.shouldProcess()
- Use glob 11 instead of glob-promise.
ContentStep.shouldProcess()
is now async.
DomReplaceCommand
is not abstract anymore.
FileUtil.copy
now usesContext
andCopyStepConfig
parameters.CopyStepConfig
now relies onconfig.getOutputPath(context)
to devise output file path. This leveragesSsgConfig.toOutputPath()
and allows to copy each file to a different target.
HtmlTagReplaceCommand
as the genericDomReplaceCommand
with a tag selector is enough.
ClassDomReplaceCommand
now support multiple class names, which implies the relevant parameter has been moved as the last one.
- Support for angular currency expressions
- ConsoleLogger export
- Don't display warning if detected encoding but no declared encoding
- Leave literal template unchanged if no var is found with this name.
- Regression when using a var name in VarRegexReplacer.
- the
VarRegexReplacer
used byStringEchoVarReplaceCommand
andSsiEchoVarCommand
defaults to generic replacements when no variable name is specified.
DirectoryStep.config
visibility to public readonly.
CopyStep
now uses its configoutDir
.
SsgConfig.outDir
is nowSsgConfig.getOutputPath(context)
- All steps configs now extend
SsgConfig
to benefit from output path resolution.
SsgContext.inputFile
andSsgContext.inputFile
are replaced bySsgContext.file
ContentStepConfig.getOutputFile(context)
can now return FileContents or file path
SsgContext.setOutputFrom(filename)
instead ofSsgContext.setOutputFrom(filename)
to unify apis.
- make sure context
inputFile
andoutputFile
are assigned.
SsgContext.read(filename)
becomesSsgContext.getInputFrom(filename)
to denote it affects the context'sinputFile
.SsgContext.readOrNew(filename, dir)
becomesSsgContext.setOutputFrom(filename)
to denote it affects the context'soutputFile
.HtmlFileContents.create(fileInfo, fileContents)
becomesHtmlFileContents.create(fileInfo)
to denote it usesfileInfo
'scontents
.
HTML lang overrides lang from filename.
Update document title from FileContents title.
ContentStep.processFile()
hasn't fileCount
parameter anymore and returns a boolean
.
Replaced native charset detection by JS one.
Add generator
meta info as ssg-api
by default.
Serialize meta info.
ReplaceCommand.contentStepEnd()
callback when the relevant ContentStep is terminating.
FileUtil.ssgCopy()
removed cpy
dependency which has a bug causing output dir not always applied.
Replaced jest by testscript
- HtmlFileContents:meta.description
- Create files from context sets outputfile
- Read files from context now read HTML files as such.
- Read files from context now read HTML files as such.
- Remove duplicated spaces, carriage returns and tabs from HTML titles.
- Overridable method to allow processing a content file.
- Process only files that have been updated after output.
- Angular replacement of {{6000|number}} failure with 'Could not find variable "6000"'
- Exported
Logger
andDefaultLogger
- context variables scoped
- under
$context.
prefix to avoid collision with JS variables.- under reserved prefixes for each built-in object (like
$context._name
,$context.inputFile.name
, etc.)
- under reserved prefixes for each built-in object (like
- under
DefaultLogger
uses levels fromprocess.env.LOG_LEVEL
split with comma.
- Make
DomReplaceCommand.postExecute()
async.
DomReplaceCommand.postExecute()
can be overriden to execute some operation after some given replacements have been performed.
SsgContext.document
andSsgContext.serialize()
to avoid using deprecated JSDOM-dependentSsgContext.dom
.
- TagReplaceCommand is now the DOM implementation. Deprecated Regex implementation is renamed as such.
- Avoid redundancing in Ssg logs
- TagReplaceCommand, a DomReplacement to ease replacement of tags by name.
- Nested contexts with
push()
andpop()
, reflected in logs.
- TagReplaceCommand, a DomReplacement to ease replacement of tags by name.
- More parameterable context type in Ssg.
- change
ContentStep.processFile
visibility fromprivate
toprotected
to allow more fine-tuned specialization.
Logger.name
is the context name to be displayed before a log.SsgContext.logger
is the logger object used to perform context.logs.DefaultLogger
will be used bySsgContextImpl
unless anotherLogger
implementation is provided at construction.
- Changing
context.name
will change context's logger's name as well.
FileContentsLang.variants
can contain""
if there is the same file is found without language suffix.
- Publish src
FileContents.lang.variants
don't include currentFileContents.lang.lang
- Find
FileContents.lang.variants
for path with no directory.
DomReplaceCommand
now accepts a second Context type parameter, to allow it to query custom context members without casting.
- Unnecessary dependency.
FileContents.lang
changed from a single string to a{ lang, variants }
so that you can know which variants of a file exist.
- Parsing of HTML files
- ContentStep test.
This release adds API consistency and generalization, as well as a number of tests.
However it contains a regression that prevents HTML files to be parsed, so use 1.1.1+ instead.
FileContents.readOrNew()
to allow creating a FileContents in memory that doesn't exist on disk.
FileInfo
renamed asFileContents
to both improve consistency and avoid name collisions.HtmlFileInfo
renamed asHtmlFileContents
for the same reasons.writeFileInfo()
becomesFileContents.write()
getFileInfo()
becomesFileContents.read()
SsgContext.locale
becomes a single string (not an array of strings anymore) as you cannot output for multiple languages at once (use one context per language if you need to do so).
- Ability to use any variables names in a context.
- HTML are not parsed anymore.