`page.data.url` disappears when `page.addData` is called
See original GitHub issueDescription of the bug
When you set processor or preprocessor to call page.addData
, page.data.url
will be lost.
Reproduction procedure
- Create
index.md
at the root directory of the project. - Create
_config.ts
as following:
import lume from "lume/mod.ts";
import { Page, Site } from "lume/core.ts";
const site = lume();
site.use((site: Site) => site.process([".html"], (page: Page) => page.addData({ foo: "bar" })));
// OR: site.use((site: Site) => site.preprocess([".html"], (page: Page) => page.addData({ foo: "bar" })));
site.use((site: Site) => site.addEventListener("afterBuild", () => site.pages.forEach((page) => console.log(page.data))));
export default site;
- You’ll get the following result:
{ tags: [], content: "index\n", date: 2022-01-10T09:35:35.019Z, foo: "bar" }
Commenting out the processor registration, or passing a function with no side effect as a processor will create the desired output:
{ tags: [], content: "index\n", date: 2022-01-10T09:35:35.019Z, url: "/" }
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Appended content disappears after the change of URL
I am hoping for this behaviour - somewhere on the page there is a div, after clicking #button , the content changes and...
Read more >Data URLs - HTTP - MDN Web Docs - Mozilla
Data URLs, URLs prefixed with the data: scheme, allow content creators to embed small files inline in documents. They were formerly known as ......
Read more >Printer option disappears when printer is selected in AutoCAD
When selecting a printer name from the plot dialog box drop-down, the printer name disappears. The option reverts to "none."
Read more >** Troubleshooting ** Message "Please wait, loading the ... - IBM
Cause. Internet Explorer settings/configuration is blocking access to the required Report Server website/components. There are several potential ...
Read more >Data variables - SAP AppGyver Documentation
A data variable is essentially the same a page variable that exists in ... and disappears if the page is removed from the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s public because it’s used by an external class the
Source
class but prepending with_
is a good idea.Nice work! Thanks 👍