Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using block fragments as part of larger template #1049

Closed
eliasgranse opened this issue May 16, 2024 · 4 comments
Closed

Using block fragments as part of larger template #1049

eliasgranse opened this issue May 16, 2024 · 4 comments

Comments

@eliasgranse
Copy link

I am trying to use the feature called "block fragments" as described in the book, section "Block Segments". The block fragment I am trying to create is part of a larger template and the Rust code looks like this:

#[derive(Template)]
#[template(path = "pages/index.html", block = "my_block")]
pub struct MyTemplate {}

However the line #[derive(Template)] stops on the error:

unsupported attribute key Ident { ident: "block", span: #0 bytes(16214..16219) } found

Looking at the Docs.rs documentation this feature is not documented which makes me think this is not supported for some reason.

Anyways, I cannot seem to figure out what I am doing wrong. Thanks!

@djc
Copy link
Owner

djc commented May 16, 2024

The block fragment feature hasn't been released yet. See #1035 for release planning -- you could use main for now.

@djc djc closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
@eliasgranse
Copy link
Author

I see thanks for responding so quickly!

@Astralchroma
Copy link

I've just been tripped up by this as well. Perhaps don't include features in the book that don't actually exist yet, or at least a warning?

@matjazonline
Copy link
Contributor

PR here #1084

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants