1
0
Fork
You've already forked brut
0

Expose mustache partials #33

Merged
robinmetral merged 7 commits from partials into main 2024年08月09日 06:24:14 +02:00
robinmetral commented 2024年08月09日 06:15:15 +02:00 (Migrated from github.com)
Copy link

Closes #28, #32

This exposes mustache partials to users. Any file saved under a new partials directory (defaults to /partials, configurable) will be loaded and passed to the mustache engine at build time. Partials can be referenced in pages by their slugs, e.g. /partials/nav.html 👉 {{ > nav }}.

It also comes with a breaking change for templates. Instead of saving template files anywhere and referencing them by their path (e.g. template: /templates/default.html), templates now must be saved to a new templates directory (defaults to /templates, configurable). They can be referenced in frontmatter by their slugs, e.g. /templates/default.html 👉 template: default. Besides aligning the templates and partials APIs, one major benefit of this is that brut can load all templates once at the beginning of the build, instead of having to load them on the fly as their path is read from frontmatter. I expect significant build time improvements.

Closes #28, #32 This exposes mustache partials to users. Any file saved under a new partials directory (defaults to `/partials`, configurable) will be loaded and passed to the mustache engine at build time. Partials can be referenced in pages by their slugs, e.g. `/partials/nav.html` :point_right: `{{ > nav }}`. It also comes with a breaking change for templates. Instead of saving template files anywhere and referencing them by their path (e.g. `template: /templates/default.html`), templates now must be saved to a new templates directory (defaults to `/templates`, configurable). They can be referenced in frontmatter by their slugs, e.g. `/templates/default.html` :point_right: `template: default`. Besides aligning the templates and partials APIs, one major benefit of this is that brut can load all templates once at the beginning of the build, instead of having to load them on the fly as their path is read from frontmatter. I expect significant build time improvements.
cloudflare-workers-and-pages[bot] commented 2024年08月09日 06:15:17 +02:00 (Migrated from github.com)
Copy link

Deploying brut with Cloudflare Pages Cloudflare Pages

Latest commit: 159d02c
Status: Deploy successful!
Branch Preview URL: https://partials.brut.pages.dev

View logs

## Deploying brut with &nbsp;<a href="https://pages.dev"><img alt="Cloudflare Pages" src="https://user-images.githubusercontent.com/23264/106598434-9e719e00-654f-11eb-9e59-6167043cfa01.png" width="16"></a> &nbsp;Cloudflare Pages <table><tr><td><strong>Latest commit:</strong> </td><td> <code>159d02c</code> </td></tr> <tr><td><strong>Status:</strong></td><td>&nbsp;✅&nbsp; Deploy successful!</td></tr> <tr><td><strong>Preview URL:</strong></td><td> <a href='https://6b154789.brut.pages.dev'>https://6b154789.brut.pages.dev</a> </td></tr> <tr><td><strong>Branch Preview URL:</strong></td><td> <a href='https://partials.brut.pages.dev'>https://partials.brut.pages.dev</a> </td></tr> </table> [View logs](https://dash.cloudflare.com/?to=/:account/pages/view/brut/6b154789-0985-4961-a6c1-ca7ac04c5867)
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
robinmetral/brut!33
Reference in a new issue
robinmetral/brut
No description provided.
Delete branch "partials"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?