x/lume@v1.9.0/CHANGELOG.md
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.
site.copy()
now accepts an array of file extensions to copy.
For example: site.copy([".jpg", ".png"])
.site.copy()
accepts a function as second argument to fine tuning the output file name.
For example: site.copy("assets", (file) => "/dir" + file)
and also with extensions: site.copy([".jpeg"], (file) => file.replace(".jpeg", ".jpg"))
prettyUrls
option allows no-html-extension
value to use the same url resolution as GitHub #193.imagick
plugin has the cache
option enabled by default.site.loadAssets()
) won't render the layout
variable.
This is something that you probably always wanted.
For example after defining a default layout
in a _data.yml
file,
this value was used also for assets like .css
or .jpg
files,
and the only way to prevent this is creating another _data.yml
file inside these files' directory with layout: null
.
With this change, this is no longer required, and layout
is applied only for pages loaded with site.loadPages()
.engines.ts
into renderer.ts
class.std
, postcss_autoprefixer
parcel_css
, cliffy
, deno_dom
and esbuild
dependencies.metas
to add automatically <meta>
tags for SEO and social networks #188.prism
to use this library as code highligher #187.search.values()
to return an array of all unique values of a key #191.cache
to imagick
plugin to cache the transformed images in the _cache
folder #184.site.ignore()
now supports functions #53.site.ignore()
affects to static files copied with site.copy()
.
This allows to copy a entire directory with site.copy("statics")
but ignoring some subdirectories with site.ignore("statics/ignored-folder")
.afterBuild
and afterUpdate
events have the staticFiles
property
with info about the static files that have been copied.site.files
containing all static files to be copied.
It's like site.pages
but for static files.parcel_css
, cliffy
, react
, markdown_it
, liquid
, std
, esbuild
, postcss
, postcss_autoprefixer
and pug
.printError
function to print SASS errors properly #194.import_map.json
and deno.json
files.serve
task generation in deno.json
to meet the changes introduced in Deno 1.21.2
denoland/deno/issues/14459date
variable of the pages is a string
or number
,
it's converted to Date
automatically #181.std
, denosass
, cliffy
, imagick
and esbuild
.afterRender
event must stop the build if any listener returns false
.lume upgrade
, the deno.json
and import_map.json
files are updated accordingly #182.--version
to lume upgrade
, to upgrade to a specific version.bundler
plugin detects automatically the import map file from deno.json
.lume init
command:import lume from "lume/mod.ts"
.import_map.json
file generation:
Only lume/
import is added. lume
and https://deno.land/x/lume/
are removed.std
, esbuild
, deno_dom
, deno_graph
, parcel-css
, highlight.js
, terser
and react
.date
plugin accepts an array of locales (ex: ["en", "gl", "pt", "es"]
),
that are loaded automatically.lume/plugins/date/locale
import from the import_map.netlify_cms
plugin.expires
middleware for 0
values.deno_graph
and std
.deno.json
file.imagick
.netlify_cms
.expires
middleware to add the Expires
header to responses.cache_busting
middleware to include the assets version identifier in the path.redirects
middleware to configure custom redirects.mergedKeys
data key to configure how some keys will be merged.lume/plugins/date/locale
bare import to the import_map.lume import-map
command creates a deno.json
file (in addition to import_map.json
)
to automatically link the import map to Deno,
meaning that you no longer need to specify the import map file in the command line
(lume -- --import-map=import_map.json
) because it's automatically detected.deno.json
file not only includes the importMap
key with the "import_map.json"
value but also a couple of tasks (build and serve) to run Lume using Deno tasks
(deno task build
and deno task serve
).1.20.1
.inline
plugin adds the id
and class
attributes
from the removed <img>
to the inlined <svg>
.lume init
. You can use a deno.json
file with the importMap
key.--file
option to lume import-map
.std
, esbuild
, postcss
, parcel_css
and liquid
.lume import-map
doesn't update the lume version._data
reloading in watching mode.console.log()
.deno.json
file detection.https://lumeland.github.io
to https://lume.land
#175.std
, postcss
, liquid
and parcel_css
to the latest version.site.loadData()
is optional
and use textLoader
by default.parcel_css
plugin.<style>
.deno_graph
, liquidjs
and parcel_css
..DS_Store
files (macOS).parcel_css
plugin
(the most recent version of every browser).@import
.sass
.languages
to codeHighlight
plugin #169.std/http
modules to create the local server./about/
instead of /about/index.html
.std
, esbuild
, deno_graph
, markdown_it
, liquidjs
, parcel_css
and postcss
.page.data.url
after change any page.dest
value.search
helper converts undefined
and null
values.
Previously, only true
and false
values were converted.1.5.0
that makes that some pages doesn't have the url
value.esbuild
.parcel_css
.Watcher
in the core, with support for events.lume import-map
to create/update import maps files #164.1.18.1
.core/utils.ts
.deno.json
and import_map.json
by default.Event
interface to SiteEvent
.searchByExtension
function in core/utils.ts
because it's not needed anymore.--only
for lume init
.page.document
must return undefined
if the page is not a HTML page #163.liquidjs
, deno_graph
and std
.liquid
, std
, deno_dom
and deno_graph
.This version of Lume has a big internal code refactor but maintaining the public API,
so your sites should work without changes (unless you depend on internal undocumented features).
The only important change is the removal of metrics
feature but probably you are not using it.
_components
that you can use in your template engines.
It's compatible with any engine (nunjucks, js/ts modules, jsx, liquid, pug, etc).site.loadComponents()
to set up more components loaders.
For example: site.loadComponents([".jsx"], moduleLoader, jsxEngine)
.date
plugin to change the helpers' name #150.pug
plugin registers the pug
filter.njk
, pug
, liquid
...)
can access to shared data (like search
, paginate
etc)site.process("*", processFunction)
.layout
values
and when include templates using the template engine syntax (ex: {% include "./template.njk" %}
).site.includes()
to define different directories for specific extensions.
For example: site.includes([".css"], "_styles")
;extensions
option of some plugins allows to define different extensions
for different purposes. For example:
{ pages: [".tmpl.js"], data: [".js"], components: [".comp.js"]}
.search.page()
to return the first page found instead an array with all pages.1.x
there are many interface (like: Site
)
independent of the implementation (like: LumeSite implements Site
).
This was not easy to maintain and it makes hard to explore the Lume code in VSCode
because everything is linked to the interfaces instead of the code.
So I decided to remove these generic interfaces.2022-12-05_pagename.md
)
use UTC timezone for consistency with the dates defined in the front matter.metrics
feature was removed. It was not very useful and I think maybe it can be implemented in better ways in the future.std
, deno_dom
, deno_graph
, liquid
, pug
, liquid
and postcss
to the latest version.1.x
you have to load .windi.css
before .css
to prevent conflict. This was fixed in 2.x
..git
directory are no longer detected by the watcher.Renderer
exposes the extraData
property.Engine
interface has a new method renderSync
.url
plugin to change the helpers' name #149.sourceMap
of postcss
plugin accepts the same options as postcss
library #147.
Note: Previously, sourceMap: true
created a .map
file.
Now it inlines the source map in the css file (because it's the default behavior of postcss
).
Set the value to sourceMap: { inline: false }
to keep the old behavior.jsx
elements have the toString()
function to render to html automatically.std/hash
dependency and use Web Crypto API.std
, postcss
, postcss-nesting
, deno_dom
and deno_graph
.on_demand
to implement page rendering on demand.beforeRenderOnDemand
.watcher
to configure the watcher of the live reload
(the debounce interval and a list of ignored paths).lume init
has the option --only
to initialize only
the config file (lume init --only=config
)
or VSCode (lume init --only=vscode
).--
. For example: lume --serve -- --import-map="import_map.json"
.
Note: This supersedes flags feature that is no longer available (use env variables for that).scopedUpdates
to define independent scopes and avoid to rebuild the entire site on update.options
argument to addEventListener
:once
To remove the listener after the first execution.signal
To provide an AbortSignal
to remove the listener at any time.1.16.1
.core.ts
.Renderer
to render the site pages. This allows to create your own renderer to replace the default one.Emitter
to emit the site pages and static files (save them in _site folder). This allows to create your own emitter to replace the default one.beforeBuild
, beforeSave
, beforeUpdate
returns false
the build/update process is stopped.deno.land/std/io/util.ts
dependency because it's not needed anymore.flags
options. Use env variables to pass arbitrary data.
For example, use domain=example.com lume
instead of lume -- example.com
.deno_dom
, cliffy
, deno_graph
, liquid
and svgo
dependencies.any
instead of unknown
for the Helper
type for more flexibility.postcss-nesting
, liquid
, std
, deno_graph
and cliffy
to their latest version.url
option for paginate
helper.liquid
to use the Liquid template engine.search
and paginate
plugins. Now you can configure the helpers names.lume/plugins.ts
that exports all available plugins.search
plugin to paginate
and search
plugins for coherence
(both are enabled by default).--quiet
is more quiet on ci.ts
#139.postcss
, deno_graph
and std
.dest
folder if it's inside src
and doesn't start with _
or .
.lume --serve --experimental
or lume --watch --experimental
).cli/watch.ts
and cli/server.ts
from Site
.
These modules no longer require a Site
instance to work, only the necessary options.svgo
, std
, cliffy
, postcss
and terser
.base_path
plugin may not be executed if the location
option is changed later.resolve_urls
that transform links with source files to final urls.
For example: /posts/post-1.md -> /post/post-1/
.
This allows to write markdown files that are navigable in GitHub.modify_urls
that allows to edit the urls of HTML pages.
It's used internally by other plugins like relative_urls
, base_path
or resolve_urls
..jsx
pages can export a JSX element as default (previously only a function was accepted).https://deno.land/x/lume/
in addition to lume/
.
This allows to use the _config.js
file with or without import maps.keepDefaultPlugins
to postcss
and markdown
.
Set to true
append your plugins instead override the defaults.json
and module
plugins.lume init
can configure VS Code.server.page404
option works also with pretty urls (ex: /404/
)lume init
and convert it to an interactive command._data
files and folders in the same directory is now merged.
Previously it was overriden, causing inconsistencies.301
response for folders without trailing slash.
For example: /about-us -> /about-us/
.resolve_links
plugin.entries
argument of bundler
plugin.
(sorry, it was a bad idea)_data
files no more are converted to plain object.inline
plugin.//
are not normalized because they are absolute urls
For example: //domain.com
std
, deno_dom
.data
of the pages is now enumerable.
This makes pages compatible with some filters of Nunjucks.bundler
plugin:entries
array items dont't need to start with /
.options.bundler
is undefined
.includes
option for bundler
plugin.
They are detected and included automatically now!bundler
plugin with the following additions:entries
to only emit some files.includes
to download and include external dependencies.Deno.EmitOptions.bundle
to emit a single file with all dependencies.std
, terser
and svgo
.react
to include typings._data
to save arbitrary values in the pages internally.
Used by (pre)processors.1.13.1
(from 1.12.2
).std/http/server
and std/ws
.bundler
plugin:.ts
, .tsx
and .jsx
extensions with .js
.
This fixes the import errors.std
, cliffy
and deno_dom
.No changes.
1.12.2
..js
files.
Use the .ts
extension to import Lume modules.install.js
, ci.js
and cli.js
(with the .js
extension)
no longer exists.
Use the .ts
extension (install.ts
, ci.ts
and cli.ts
).--plugins
option of lume init
.search.pages("url!=/")
.std
, cliffy
, postcss
, highlight.js
and markdown-it
.Source.getOrCreateDirectory()
a private method._data
files and folders.
This opens the door to implement
DPR
in Lume.PluginOption
argument typing of the lume()
function.yaml
loader should return an empty object instead of undefined
on empty files.std
and cliffy
.Engine
is converted to a TypeScript interface.Site
, Page
, Directory
, Source
, Metrics
, etc.core/
directory.types.ts
to core.ts
.highlight.js
and eta
.date
accepts now
as a value to format the current time.Metrics
class,
so it’s decoupled from the CLI.site.options.cwd
.--quiet
mode is now even quieter._config.ts
file automatically if _config.js
does not exist.site.includes()
method since it’s not consistent with custom includes.lume init
command
provided completions for the plugins enabled by default.includes
configuration for plugins is not correctly resolved
if the root
is different to Deno.cwd()
.bundler
on Windows.postcss
with multiple includes.import lume from "lume";
in your config file
(instead of import lume from "lume/mod.ts";
).options
configuration key to the eta
plugin to configure Eta..ts
extension.
You should edit your config file to import .ts
files instead of .js
.svg
to svgo
.std
, terser
and markdown-it
.-w
/--watch
option to watch changes without starting a web server.
#109._includes
directory configurable: #115.includes
option for site and the eta
, nunjucks
and pug
pluginssite.includes()
method, similar to site.src()
.options
configuration value to the pug
plugin
to set options to the pug
compiler.lume completions
to generate shell completions for Lume.--no-check
option to lume upgrade
, install.js
and ci.js
to reduce the execution time.build
command. Use lume
instead of lume build
.lume -V
or lume --version
instead of lume -v
(in lowercase).--verbose
option with --quiet
.import_map.json
file because it’s not used.
It was kept only for backward compatibility of lume upgrade
from old versions.--verbose
option. Use --quiet
for the same behavior as --verbose=1
.inline
plugin.slugify_urls
plugin produced empty path segments
(for example, x/@/y
now becomes x/-/y
and not x//y
as before).lume --metrics
to show the metrics in the CLI
or lume --metrics=filename.json
to save the data in a file.
You can also configure it in the config file.--verbose
option to configure the level of details logged:0
: only important things1
: normal details (the default option)2
: high details (for debugging purposes)src.path
value.relative_urls
plugin should ignore data URLs. #107.search.pages()
without arguments.slugify_urls
plugin.page.search()
.
This allows to insert spaces in the values.
For example: page.search("'tag with spaces' title='Title with spaces'")
.slugify_urls
plugin.attributes
is disabled by default.slugifyUrls
option. Use the slugify_urls
plugin for that.url
variable.terser
dependency with a Deno version.std
and postcss
.afterRender
and beforeSave
.site.addHelper()
to register different types of helpers.addFilter()
method with more generic addHelper()
that allows to register not only filters but also custom tags
and other features supported by some engines, like Nunjucks.image
. Moved to another repository.Page
and Directory
classes always have the src
object.postcss
and eta
.limit
to search.pages()
.--location
.std
.postcss
to support Deno 1.11.0.deno run <script>
accepts several scripts at the same time.deno run <script>
.The CLI options are applied before lume()
returns the site instance.
This allows to access these options in _config.js
.
For example, after running lume --dev
,
you can include conditions in the _config.js
file like this:
const site = lume();
if (site.options.dev) {
// Development stuff
}
Previously,
these overrides were applied after _config.js
exports the site instance.
Source
cache.search.pages()
with no arguments
returns pages with other extensions than .html
.nunjucks
(a new fork) and highlight.js
.ci.js
and the command lume init
on Windows.base_path
to automatically search and fix all URLs in the HTML
by adding the path prefix of the location
option.
This reduces the need to use the url
filter everywhere.search.pages()
helper allows multiple values to sort by.url
variable of the pages must start with /
, ./
or ../
.url
filter shouldn’t add the path prefix if it’s already added.search.pages()
must return only HTML pages.
(Previously, it also returned assets.)import_map.json
to not break upgrades from older versions.postcss
and terser
filters. #97.--plugins
argument to lume init
, so you can load and use plugins.
Example: lume init --plugins=postcss,terser,pug
.document
to Page
that returns the parsed HTML.code_highlight
to automatically highlight all code
inside pre code
. Previously, it was part of the Markdown plugin.
Now it’s decoupled, so it can be used by any template engine.extensions
and attribute
options to the inline
plugin.--dev
(or -d
) for lume upgrade
to upgrade to the latest development version..html
files by default.loadPages
and loadAssets
is now optional,
and the text loader is used by default.templateEngine
in a layout.code_highlight
plugin.ws.js
..markdown
extension.
Use .md
or configure the Markdown plugin to enable it.site.engine()
. Use the third argument of site.loadPages()
.
For example: site.loadPages([".html"], textLoader, nunjucksEngine)
.dom
.
It’s no longer needed because pages can easily return the parsed HTML.
For example: site.process([".html"], (page) => modify(page.document))
.std
, postcss
, deno_dom
, date_fns
and highlight.js
(to 11.x
)./bin/bash
or PowerShell.exe
executable.
This adds support for more features, like pipes, etc.pug
.nunjucks
,
when the src
is in a subdirectory.install.js
for easy installation.install
from the CLI.pretty
and slugify
for the url
page variable
to override the corresponding prettyUrls
and slugifyUrls
site options
in particular pages. #95.import_map.json
to the installation process. This allows to import Lume
in the _config.js
file with import lume from "lume/mod.js";
.lume install
to install Lume easily using the import map.ci.js
to execute the CLI in a CI environment
(without installing it or defining the import map).--import-map
for the lume init
command
to enable or disable the import map in the _config.js
file.
By default, it’s enabled.1.10.0
.prettyUrls
to not apply to the url
page variable
if it’s a string. To generate a custom pretty URL: #95.{ path: /about-me }
)/about-me/
)/about-me/index.html
).url
values to not assume that the page is HTML.
This means the .html
extension won’t be added by default. #95.lume init
to generate a _config.js
file using the import map.
Use lume init --import-map=false
to use the old URLs.ext
from the url
page variable,
because path
now includes it. #95.lume update
. It’s not needed thanks to import maps.std
dependency.url
page variable supports an object with path
and ext
properties
to fully customize the output filename. #83.relative_urls
to convert all URLs to relative. #85.slugifyUrls
setting: #94.lowercase
: to enable/disable lowercase conversion (true
by default)alphanumeric
: to convert all characters to ASCII (true
by default)separator
: to customize the separator (-
by default)replace
: an object to replace some special characters.includes
to customize the path (or paths)
used to resolve the @import
ed files in the postcss
plugin.
Use includes: false
to disable it.autoprefixer
is included by default in the postcss
plugin.paginate
helper to relative: ./page-${page}
.200,000*7
becomes 200-000-7
and not 2000007
!2 / 3%
becomes 2/3
and not -2-/-3-
Who is?.txt
becomes who-is.txt
and not who-is-.txt
.permalink
variable in pages. Use url
instead.njk
filter didn’t work with async filters. #93.page.html.md
). #83.inline
plugin.no
and not No
)../
or ../
,
so URLs like .foo
, ..foo
or .../foo
are interpreted correctly._data/*/*
files weren’t updated correctly on --serve
.postcss
and postcss_import
dependencies.lume()
function
to configure the default plugins. #45.search
helper: #69.~=
with *=
.<
, <=
, >
and >=
operators.OR
operator with pipes,
like tag1|tag2
or title=value1|value2
.date("ATOM")
filter uses Z
instead of +00:00
. #64.hljs
class from the blocks of unhighlighted code. #71.2021-04-24-18-00_post.md
.-o
/--open
to open the browser automatically
when running lume --serve
. #62..html.js
and .html.ts
introduced in 0.17.0.
They can be confusing because not all templates must generate HTML pages,
so .tmpl.js
/.tmpl.ts
are more agnostic and fit all cases.postcss
version to fix source maps.postcss_import
version to fix the @charset
at-rule.lume --serve
. #55..html.js
and .html.ts
are processed as pages
(in order to replace to .tmpl.js
and .tmpl.ts
that will be removed in the future).search
. #57.permalink
page variable. Use url
instead. #46.permalink
variable in the paginate
helper that uses sprintf
.
Now it accepts only the url
option that must be a function.slugifyUrls
to disable the slugifier introduced in 0.16.0. #44.only rebuild the site if it's needed
due to regression issues.permalink
to generate it dynamically.permalink
value can have a relative path
(must start with ./
or ../
) that will be resolved to the directory name.url
filter allows URLs starting with ~
to reference to source files
that will be automatically resolved to the final URL.lume --serve
,
some ignored files weren’t correctly filtered.lume --serve
to only rebuild the site if it’s needed.image
to resize images automatically.renderOrder
to control the rendering order of the pages.-s
for --serve
.--serve
).date
plugin accepts strings or integer arguments
(they will be converted to a Date
with the new Date(value)
constructor).cli.js
to set a site directly.extends
were cached indefinitely. #39.--root
CLI argument.search.pages("header.categories=my-category")
.search.pages("header.categories=my-category", "my.custom.order.field")
.search.data()
to return the data assigned to any page or directory.lume --run
.search.tags()
.
Replaced with a filter like the one in search.pages()
.search.directory()
to return a directory instance.
Use search.data()
.file
to sort the results of search.pages()
. Use url
instead.inline
plugin when the site is located in a subdirectory.Page
class:page.data.tags
(they were previously contained by a Set
in page.tags
).page.fullData
property. page.data
contains the merged data.--
) to commands:lume --upgrade
to lume upgrade
lume --update
to lume update
lume --init
to lume init
lume --run=<script>
to lume run <script>
.lume run --help
.cwd
:
instead of lume path/to/site
, use lume --root=path/to/site
.--help
. #32.1.7.0
.lume --run
doesn’t return the proper exit code until
a bug in Deno is resolved.lume --update
to update the Lume version
used by any _config.js
file to the same installed globally in CLI.search
helper to return the original array instead a clone,
so it can be modified outside.njk
registered by the nunjucks
plugin.url
filter to a plugin that also creates
an additional filter htmlUrl
to search and fix URLs in HTML code.date
to format date and time values using the library
date-fns.search.pages()
accepts any key
(in addition to date
and file
).attributes
and classname
to the new attributes
plugin
that’s enabled by default.url
filter with null
values.search.pages()
by implementing a cache system.css
to postcss
and renamed some of its options:map
to sourceMap
postcssPlugins
to plugins
.beforeUpdate
and afterUpdate
got a property files
with the names of all changed files.postcssPlugins
: an array of the PostCSS plugins #26.map
: set true
to generate source maps.paginate
helper didn’t always return the latest page.false
if the script fails.--location
option being unknown.TypeError
on reloading the server..ts
, .js
) and fixed some issues.data
filter is disabled by default..html
extension to files with a subextension.
For example scripts.js.njk
should be saved as scripts.js
instead of scripts.js.html
. #13.lume --upgrade
.<pre>
elements in Markdown.search.previousPage()
and search.nextPage()
.<dl>
) in Markdown.404
error page.
Now it displays a list of files and subdirectories.templateEngine
to configure the template engine
used for every page. #11/index.html
.url
filter in Markdown.url
filter to handle hashes and queries
(such as #hashid
and ?query=value
)css
plugin uses only the postcss-import
and postcss-nesting
plugins
because the others fail on Deno.lume --upgrade
error.--upgrade
command.lume.script()
along with CLI commands.--src
and --dest
to override the corresponding options.site.flags
that saves all arguments after double dash,
like the ones in lume --serve -- flag1 flag2
.dev.jspm.io
with jspm.dev
for dependencies.denopkg.com
with cdn.jsdelivr.net
for dependencies. #8.highlight.js
to 10.x
.lume --init
.&&
and &
. #7.attr
filter.server
to configure the local server,
having properties port
and page404
.lume -v
.lume -v
.--upgrade
.--version
shortcut -V
to -v
.denjucks
installation. #6.@import
CSS of the css()
plugin, using _includes
as fallback.script()
to execute scripts like a task runner.404.html
in the built-in server to handle the 404 responses.node_modules
directory by default.cwd
is not a directory.attr
filter by default.ignore()
to ignore files and directories.lume --version
.loadAssets()
to register asset loaders._config.js
file.load()
to loadPages()
and removed the asset
parameter.data()
to loadData()
.helper()
to data()
.beforeUpdate
and afterUpdate
(instead of beforeBuild
and afterBuild
).import
URL in the _config.js
file
generated with --init
.try
…catch
to prevent death on error.prettyUrls
option. #1.beforeBuild
and afterBuild
.paginate()
.site.process()
.prettyUrls
, which is true
by default.site.beforeRender()
and site.afterRender()
.
Use site.process()
instead, which is an equivalent to afterRender
.url
filter with non-string values.search.pages()
to sort pages alphabetically.--help
and aliases -h
and -V
for CLI.eta
to support the Eta
template engine.helper()
to register global helpers
that can be used in templates.path
and recursive
in search.pages()
.url
filter with relative paths.version
variable.pathPrefix
and url
with location
.url
filter bugs.search.folder()
.--dev
to build in development mode.url
filter.beforeRender
transformers are executed only once.svg
to optimize SVG files.dom
to manipulate HTML using the DOM API.classname
to manipulate CSS classes.attributes
to manipulate HTML attributes.explorer
to search
.server.js
to avoid reading problems.lume --version
.lume --init
to create a _config.js
file.postcss
and stylecow
plugins in the new css
plugin.The first version.