-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
A little issue with template inheritiance. #375
Comments
You forgot to add a |
hi, sorry i didn't pay attention, i have added |
So this seems to help a little: diff --git a/templates/index.html b/templates/index.html
index ed3df67..33945ad 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -1,4 +1,5 @@
-<!DOCTYPE html>
+{% extends "layout.html" %}
+!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" /> Otherwise, your repo is very broken -- numerous files appear to still be missing or in an inconsistent state, and there's a bunch of code that's broken for reasons unrelated to Askama. I suggest you read Askama's documentation section on template inheritance (if you haven't already). I'm happy to answer specific questions or diagnose minimally reproduced issues. If you just want me to write the code for you, you can hire me as on a freelance basis to do that too. |
Hello @djc , I really like the project and want to contribute as much as possible. I think a little bug cleaning is required :) . Thanks, |
@grv07 thanks! I don't have much to suggest, maybe @vallentin has some ideas? If you're up for a bigger project, a handlebars-compatible frontend would be very interesting. |
@grv07 If it doesn't specifically have to be a bug, then there's a few things in #427, which might be relatively straight forward to implement, e.g. I'm just writing a quick comment, so I might know a few bugs, but don't really recall any right now. One thing that comes to mind, and I'm not even sure whether it's something we can prevent. Is that if you incorrectly do: {{ "foo" + "bar" }} Then the compiler will suggest using error[E0369]: cannot add `&str` to `&str`
--> askama\examples\example.rs:23:10
|
23 | #[derive(Template)]
| ^^^^^^^^ `+` cannot be used to concatenate two `&str` strings
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with
-Z macro-backtrace for more info)
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
23 | #[derive(Template.to_owned())]
| ^^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0369`.
error: could not compile `askama` due to previous error |
I'm trying to implement a template inheritance with askama which is very handy in template. however i have found myself in few errors, where i'm confused on how to implement the template inheritance.
this is the project repo for the structure.. however, i'm getting the following errors.
The text was updated successfully, but these errors were encountered: