New
- Added new
case_insensitiveflag to theorderfilter (#101) - A new
highlighter.line_numbersconfiguration file option has been added to render line numbers in markup code blocks (#105, #112) - Added ability to highlight specific lines in markup code blocks (#105, #112)
- Add new global
redirectsTwig variable to keep track of all redirects used in a site (#113) - Collection items can now have assets tied to them either automatically by linking images or using the
assetsdirective in FrontMatter (#116) - Introduce new
anchorsTwig filter (#120) to let you add anchors to HTML headings
Fixes
- Added PHP 7.4 support where Parsedown threw deprecation warnings (#111)
Changes
- Improve the Sass compilation time by using scssphp's new built-in cache capabilities instead of our custom workaround
Development
- The core filesystem classes have been updated to have a unified way of handling paths, files, and directories (#115)
The next major release of stakx is ready and has been battle tested with the redesign of the BZFlag.org website.
Here are the changes since the last beta release:
Changes
- The
servecommand has been marked as experimental due to some known bugs that are not easy to fix - The minimum version of PHP required is now 5.6
- Our SCSS library has been updated with bug fixes and speed improvements
Fixes
- Unicode characters are now preserved in the
summaryandtocTwig filters
Changes
- The MIME list used in the development web server has been extended to use Symfony's list
Fixes
- Highlighting code in PHP 7.3 no longer causes an infinite loop
- Fix the
summaryandtocTwig filters failing under rare conditions when a<body>tag existed in the HTML given to it - "File aware" exceptions display more helpful messages when running under the
servecommand - Redirects now work correctly when using the
servecommand - Fix support for extra
/s added to permalinks via Front Matter variables (#99)
Development
- Updated Twig to use namespaces after a breaking change caused stakx to fail with an updated version of Twig
- The development web server now uses Symfony's router instead of nikic's FastRoute
New
- The
url()Twig filter can now link to Repeater PageViews (#78) - Twig now has a new global template called
repeatersto access all of the Repeater PageViews; these PageViews are indexed based on thetitleFrontMatter value just like Static PageViews. - Added new
slugTwig filter - The 500 error page in the
servecommand now shows more useful information about the exception that was thrown - Sass Asset Engine now caches the Sass AST it builds inside of
.stakx-cache/. Using the--use-cacheflag will enable stakx to read this cache and only rebuild the updated Sass (#91) - The
url()Twig filter can now handle external URLs without breaking them (#95)
Changes
- Passing a
JailedDocumentinto the Twigdump()filter will now output useful information; such as, all of the accessible FrontMatter and whitelisted methods. - Heading IDs inside of the markdown engine now use the same algorithm as the Twig
slug()filter - Underscore folders inside of themes are now automatically ignored (#87)
- The Sass compiler has been updated to better handle AST caching especially during
serveand--use-cache - The
where()Twig filter logic has been simplified and no longer works recursively, which was "undefined behavior" to begin with
Fixes
- Feeding
JailedDocuments into the Twigdump()filter will no longer cause an infinite loop - Sass is correctly updated and compiled during the
servecommand; you no longer need to restart the server to get your Sass to recompile (#86) - FrontMatter from Dynamic PageViews are now accessible through children DataItems (#93); information from the DataItem will override PageView FrontMatter
- DataItems part of Datasets now have the
filePathvariable to match ContentItems - Accidentally treating a
JailedDocumentas a string in Twig no longer crashes the compiler; it now throws a hidden warning instead - Fixed possible route shadowing caused by permalinks being registered in the wrong order
Development
- The
ReadableDocumentobject now has support for getting and setting metadata available to stakx internals - The
serveinfrastructure has been refactored and has had a lot of renaming to have more intuitive names - CompileProcess events have been renamed and split up into separate events for each PageView type and now contain more useful information
- highlight.php has been updated to use 9.13.1 language definitions
New
- Add new
servecommand to take the place of the defunctwatchcommand - Your
*.scss.twigfiles now support the@themedirective to import partials relative to your theme's_sassfolder
Fixes
- Nested folders inside of
_sassno longer throw errors
The first alpha tag of the next major release of stakx with a rebuilt core, Scss support, and Twig improvements.
Deprecations
- The
watchcommand has been removed - The
--no-confflag has been removed; all sites now need a configuration file
New
- FrontMatter now has "complex variables," meaning you can inject variables from your site's configuration file into any FM block
- The
select,order,where, andgroupTwig filters have support for dot notation to access nested data in arrays - Make use Symfony's Event Dispatcher throughout our core to dispatch events for core and possibly third-party plugins
- Add Scss and source map support in a
_sassfolder
Change
- The "working directory" of websites is now relative to the given configuration file
- Dynamic PageViews are no longer accessible through Twig
Fixes
- Twig files through
{% include %}are now treated as dependencies for the watch functionality - The
summaryandtocTwig filters now better support HTML5 and are more robust - The
basenameandfilenamevariables are available in FrontMatter
Development
- A lot of restructuring and moving of namespaces
- All references to files are now handled by a dedicated
Fileobject - Add Symfony container, which will autowrite classes and support dependency injection
- Use the official highlight.php library again, which is now maintained again
- Templating has been abstracted out into interfaces; a new Twig to stakx bridge has been created
- Updated to Symfony 3.4.x components
- Abstracted out data transformers into separate classes with an interface for DataItems
- Twig filters and functions are now handled through the container
- Improved cross-platform support for file paths used internally
- Markup engines have been abstracted out into interfaces and separate classes
- Standardized filesystem reads and writes throughout core
- The internal
Servicesingleton uses bitwise flags instead of an array of arbitrary keys
A maintenance release with small bug fixes.
New
- Added new
tocfilter that will pick out headings from given HTML and make them into an unordered list
Change
- All HTML headings now have IDs generated for them in markdown content
Fixes
- Parsing HTML isn't the same as XML, so filters like
summaryhave been made more robust and knowledgable about HTML - ContentItems not being a part of a collection no longer crashes the watch command
- DataItems now correctly have access to
basename,permalink,targetFile, andredirectsfor when they are in Datasets
For this release, all effort was focused on stabilizing the watch command and getting it out of its experimental phase.
Here's the changelog since the beta 1 release:
New
- Add new
build.preserveCaseoption to the configuration file which allows you to preserve the case of a permalink path. This option defaults to false meaning all permalinks are still converted to lower case. (#55) - ContentItems now support a
redirect_fromoption in the FrontMatter to have custom redirects on a per ContentItem basis (#26)
Fixes
- Watching a folder with spaces in any part of the path works as intended
- The target folder is automatically excluded and will no longer have a nested version of itself (#54)
- The
basenameattribute is now available in ContentItems that don't have a parent PageView set (#53)
New
- You can define custom syntax highlighting definitions for your own languages (#51)
- Added new
zipTwig filter - Added new
ignore_nulloption to theselectTwig filter - Added new
sha1andmd5Twig filters
Changes
- Improve Twig dependency detection in PageViews
- Collections and datasets with an underscore in the name are now handled correctly
- Add more languages to our syntax highlighter (#50)
- More helpful error messages are now outputted during the watch command
- The
urlTwig filter has received a newabsoluteboolean- When set to true, the generated URL takes
urlfrom your_config.ymland prepends it to the URL
- When set to true, the generated URL takes
Fixes
- The
whereTwig filter correctly checks against ArrayAccess objects - Correctly handle file paths in Twig's
{% extends %}during watch while on Windows - Fix asset tracking on Windows during the watch command
- Files that were
{% import %}'d in Twig templates now rebuild during watch - Empty files created during watch no longer through an error. Errors are only thrown now after you're editing the file
- Markdown headings created with
===or---now have IDs rendered in the HTML
Development
- Internal interfaces have been renamed
JailedDocumentInterface->JailableDocumentTwigDocumentInterface->TwigDocument
New
- Introduced new
importkeyword, which allows you to import other configuration files for different dev environments (#42) - Introduce new
--use-draftsoption to the build command, which looks fordraft: truein the FrontMatter of ContentItems. Any "draft" will not have a file written to the build folder and will not appear in thecollectionsarray in Twig (#45) - The
watchfunction now supports more external tools in addition to polling the file system- watchmedo (Cross platform pything shell utility)
- fswatch (Cross-platform file change monitor with multiple backends)
- inotifywait (Linux shell utility)
- inotify (Php PECL extension)
- Add new
--profileoption to show stats on time spent on each Twig template - Two new default FrontMatter keys have been added to all FrontMatter documents
filename- the full name of the filebasename- the name of the file without the extension
- All data is now housed in DataItem objects that can be used for more information about the data file (#48)
- Dynamic PageViews now support a new
datasetFrontMatter key that will allow you to use DataItems in a DataSet the same way as ContentItems in a Collection (#48) - Introduce new
select()Twig filter that will extract the values from the respective keys of an array of elements and flatten the items in addition to removing duplicate values - In addition to DataItem folders, ContentItem and PageView folders can now use the
.exampleextension (#33)
Changes
- The name on Packagist has been changed to
stakx/stakx. Since there wasn't any usage, the previousstakx-io/stakxpackage has been deleted. JailObjecthave been renamed toJailedDocument- Generic Twig runtime errors have been improved to provide more user-friendly information
Fixes
- Permalinks with several periods or FrontMatter variables containing periods would fail to build
- stakx now sets exit values greater than 0 when a website fails to build
- Using
watchwill now compile changes to parent templates now - Line numbers shown in Twig errors have been corrected to be accurate
- Assets are now copied correctly during the
watchprocess; a notice of an undefined index of 'prefix' has been silenced - PageViews accessing either
dataorcollectionsdirectly are now recompiled when the respective content is updated (#16)
Development
- Restructured the project to be PSR-4 complaint
- Change visibility of tracking class functions
- Always use
realpath()in FileExplorer - The
menuTwig variable is now handled by its own class - All file writing has been moved to a dedicated Compiler class
- PageManager class has been refactored to solely handle PageViews and nothing else
- Explicit file locks aren't used for writing files anymore
- A lot of namespaces for internal classes have been changed
- Build settings have begun to be moved to
Servicesingleton for global access to settings
New
- Added new
pagesvariable which provides access to all static pages a stakx website has - The
url()Twig function now accepts any PageView or CollectionItem for generating URLs - Data files with a
.exampleextension are ignored (#35) - Errors occurring due to a file's syntax now display the path to the file to the console (#34)
- Add Markdown Extra support
- All generated code blocks now have the
hljsclass added to it
Changes
- Ensure only JailObjects are given to Twig
- Children of hidden parents in the
menuvariable are no longer accessible - All FrontMatter objects implement
ArrayAccess - License file has been changed to MIT
- The
groupTwig filter has been improved with several crash bugs fixed- If a value is not set in the Front Matter, it will be discarded in the
groupresult - Grouping by booleans is now possible; a 'true' or 'false' literal will be used
- If a value is not set in the Front Matter, it will be discarded in the
- All FrontMatter objects no longer make use of magic methods (this should have no affect on websites)
- The
menuvariable only contains pages with atitleFrontMatter key - More errors thrown contain information regarding the path of the file that triggered the error instead of just the error
Fixes
- Fix calls to jailed functions in JailObjects
- Parsing FrontMatter files has improved cross-platform support
- The
whereTwig filter works better with null values - Don't crash when using
watchand no theme is present - Nested siblings in the
menuvariable no longer override each other - An error is now thrown when an unknown collection is referenced in a dynamic PageView instead of crashing
Bug fixes, improved Windows support, and repeaters!
New
- Introduction of a new Repeater PageView
- Repeater PageViews can also support automatic redirects to the permalink
- Added support for redirecting to PageViews or ContentItems
- By making the
permalinkFront Matter attribute an array of URLs instead of a single one, you will enable automatic redirects. The first element in that list will be the permalink while all the others will redirect automatically to the first link - Redirects can be special templates you define in your
_config.ymlor a generic will be used
- By making the
- Percent signs can be escaped in Front Matter now by using
\to escape it - Unit tests are now tested on AppVeyor in addition to Travis to test Windows
Changes
- The
menuTwig variable is now an array of PageViews instead of an array with limited information - FrontMatter evaluation has evolved into its own parser with supported for "expanded values"
- All objects passed to Twig as
thisare now JailObjects which restrict the functions that can be called from Twig; this will prevent undefined behavior - Improved messages thrown by exceptions
Fixes
- Fix broken Watch command where nothing would rebuild
- The
orderTwig filter now works with PageViews - Fixed fenced code blocks wouldn't render as escaped HTML
- RST include vulnerability has been fixed; everything is now jailed to the current working directory while building the website
- Fix
composer buildfunctionality on Windows - Fix file paths used internally to be Windows friendly
- Fix automatic permalink generation based on relative paths
thisin Twig will always refer to an object now, instead of just FrontMatter (which PageView was an offender of and didn't allow functions to be called)- Twig error line numbers now take into account the offset of the FrontMatter in the document
- Twig errors now show the correct relative file path instead of just the filename
- The
whereTwig filter now works with any PageView type in addition to ContentItems - Declaring both
baseurlandbasein the site's configuration leads tobaseurltaking precedence - Dates or timestamps evaluated from the
datefield (and the respectiveyear,month, anddayfields) in Front Matter are evaluated with respect to the timezone set in php.ini - Fix issue of cache creation when running from a PHAR
The compile time of a website and watch command startup time has been improved drastically.
New
- Add new
summaryTwig filter - Twig in ContentItems is now evaluated
- The
whereTwig filter has a new~=comparison for strings and arrays.- For strings, it will return true if the string (left) contains the needle (right)
- For arrays, it will return true if the needle exists inside of the array
- The
wherefilter can now check againstnull - Markdown headers (h1, h2, h3, etc.) automatically have an ID in the rendered HTML
- All internal manager classes now support tracking files for the
watchcommand - New
--no-cleanoption has been added to not clean the_site(target) folder on build - Verbose messages now show timestamps
- Using the
excludeoption in configuration files now ignores files or directories instead of filtering them out- e.g.
node_modulesis ignored by default; now,node_moduleswill be skipped entirely instead of being scanned and later ignored during the compile process
- e.g.
Changes
- Themes are now under the
themenamespace for Twig templates- In order to extend a theme template in Twig, it must be accessed with
@themeprefixed to it
- In order to extend a theme template in Twig, it must be accessed with
- The
watchcommand has been marked as experimental and has been rewritten from scratch - Collection items are now stored by file name instead of counter-intuitive hashes
- Permalinks are now always lowercase
- Twig errors now display file paths instead of random hashes
Fixes
- Don't fail when an invalid configuration file is parsed
- The
whereTwig filter no longer fails with ContentItems - Don't crash when a theme file doesn't have either the
excludeorincludesection
Changes
- The
baseconfiguration file option has been superseded bybaseurland will be removed in version 1.0.0.
Fixes
- An error message now appears with SimpleXML isn't installed; e.g. PHP 7
- Having a base URL in the configuration file now outputs that website into that specified folder. For example, a
website with a base URL of
super-sitewill now create the website at:_site/super-site/ - The target directory where the compiled website is now cleared at every build
- The
url()Twig function correctly outputs the base URL - Exceptions no longer cause the program to die
- Errors or exception during the
watchcommand no longer cause the program to stop watching and dying
New
- Add partial support for rendering reStructuredText
- Content Items with unknown file extensions are rendered as-is
Changes
- Front Matter variable names can only be alphabetic characters
- The Finder Twig function now requires a parameter of where to look at
Fixes
- Pemalinks are now sanitized and have invalid characters removed
- Files without an explicit
permalinkin the Front Matter get their permalink based on their location - Invalid Yaml in Front Matter now stops execution
- Front Matter special values are now re-evaluated when a dynamic page is built
- e.g. The
datefield creates the%year,%month, and%dayfields automatically
- e.g. The
- The Finder Twig function now works
New
- New
finderTwig filter gives access to Symfony's Finder component - New DataItems and DataSets have been introduced
- Add a
--safeoption to disable filesystem access from Twig - New
markdownTwig filter and tag - Add new
urlTwig function to generate a URL with thebaseprepended - Add new
groupTwig function to group array contents based on its contents - Add new
--no-confoption to build a website without a configuration - Add extremely primitive
watchcommand to rebuild the entire website every time there's a change - Add new
fileTwig function access a file content's
Changes
- FrontMatter variables now begin with a
%instead of:- e.g.
permalink: /blog/%year/%title/
- e.g.
- Remove Laravel dependencies
Fixes
- Looping through empty collections no longer crashes
- PHAR archives now work with the current working directory
- Don't crash when no PageView folders are specified
A very early tag of stakx with only the build command mostly functional