-
Notifications
You must be signed in to change notification settings - Fork 968
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
Allow for meta definition in the HTML head #82
Comments
I would like to change the meta tag. For this I add a
Is it possible to do that? |
Same thing for me, I would like to add this for Outlook 2013-2016 in the to avoid Times New Roman font when using custom font-family:
|
It's in the mid term roadmap for MJML, you check it here : https://github.com/mjmlio/mjml/projects/1#card-635717 @Marvin256 It's an other issue but it shouldn't fallback to Times New Roman when using a custom font. Did you try to set default font-family attribute with |
Thank you for your answer @iRyusa, mj-all isn't working for this particular issue. See this post from Litmus for more information : https://litmus.com/community/discussions/982-outlook-overrides-font-to-times-new-roman Just tried to add a mj-raw in the mj-container and Outlook is aplying the good font. Here's the code for those having the issue :
|
@Marvin256 It should, I just tried with Ubuntu : https://mjml.io/try-it-live/BJP0kzzWg and it renders as Arial on Outlook. It only fallbacks to Times when custom font are imported. In MJML we're excluding every custom fonts imported for outlook with conditionnal comment to avoid this behaviour, so |
@debiasej I was able to do it, though quite painfully and poorly
And then inside the head I added
For Grunt users: works with grunt-mjml if you put that code before |
You should add a |
@iRyusa |
Quick hack for this:
v3.3.0 and above
<mj-style>
</style>
<meta ....>
<meta ....>
</mj-style>
Kind Regards,
:----------------------------:
Dale McConnell
…On 4 April 2017 at 03:49, Dimitar Nestorov ***@***.***> wrote:
@iRyusa <https://github.com/iRyusa>
Thanks for the heads up.
I looked at the result though. Has a </head> even though I missed it 😅
In that case, you've made on hell of a framework!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#82 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKxLOELkio-eomqTP3asF9Fao0yDgzbGks5rsaHDgaJpZM4HfgM_>
.
|
We had been using the above A hack to the hack is to perform the same pattern but on the title tag:
which doesn't seem to break the parser in the same way as the original hack. Hopefully helps anyone wanting to use this before the |
Hi @matiasm you can now use mj-raw in the mj-head so this hack isn't needed anymore in the new release mjml4.2-beta, which you can install with npm install mjml |
With 4.3 I still have the error
So still need a hack to realize a meta-tag in the head (#1338). |
You most likely have some version conflicts, try a clean install of mjml first |
Sorry, no change after removing and adding mjml again. |
Just tried with a clean install of mjml and it works just fine. Can you detail a bit your setup ( do you have mjml installed globally ? ), node version, npm/yarn versions, os, the way you compile mjml files ? |
I just got the same with 4.3, it used to work with 4.2:
I call project-local mjml like this:
In my
and I install mjml with And I am attaching a relevant part of my |
Oh nvm you're right, it shows the message but it still rendered properly ➜ mjmltest yarn mjml test.mjml
yarn run v1.12.3
$ /Users/maximebrazeilles/mjmltest/node_modules/.bin/mjml test.mjml
Line 3 of /Users/maximebrazeilles/mjmltest/test.mjml (mj-raw) — mj-raw cannot be used inside mj-head, only inside: mj-attributes, mj-body, mj-column, mj-group, mj-section, mj-wrapper
Line 6 of /Users/maximebrazeilles/mjmltest/test.mjml (mj-text) — mj-text cannot be used inside mj-body, only inside: mj-attributes, mj-column, mj-hero
<!-- FILE: test.mjml -->
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title>
</title>
<!--[if !mso]><!-- -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
#outlook a {
padding: 0;
}
.ReadMsgBody {
width: 100%;
}
.ExternalClass {
width: 100%;
}
.ExternalClass * {
line-height: 100%;
}
body {
margin: 0;
padding: 0;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
table,
td {
border-collapse: collapse;
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
border: 0;
height: auto;
line-height: 100%;
outline: none;
text-decoration: none;
-ms-interpolation-mode: bicubic;
}
p {
display: block;
margin: 13px 0;
}
</style>
<!--[if !mso]><!-->
<style type="text/css">
@media only screen and (max-width:480px) {
@-ms-viewport {
width: 320px;
}
@viewport {
width: 320px;
}
}
</style>
<!--<![endif]-->
<!--[if mso]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if lte mso 11]>
<style type="text/css">
.outlook-group-fix { width:100% !important; }
</style>
<![endif]-->
<!--[if !mso]><!-->
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet" type="text/css">
<style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700);
</style>
<!--<![endif]-->
<style type="text/css">
</style>
<------------------- HELLO FROM RAW ---------------->
</head>
<body>
... |
What's even weirder is that I propose changing dependencies of mjml to include exact component version, so that mjml 4.2.0 will always fetch 4.2.0 version of all components (and if I want eg. 4.2.1, it is up to me to have |
This problem has been fixed in 4.3, now all the inner mjml dependencies versions will be exact 👍 |
@iRyusa In my case I'm calling mjml like this:
(asking it to write to output file instead of writing to stdout) and the output file isn't created, I only get this message:
so my problem is worse - templates that worked in 4.2.0 stopped rendering in 4.3.0. |
Yeap, for now just remove the strict validation, we'll fix it tomorrow with 4.3.1. |
Ok, thanks! |
Yeah! I also encountered this problem for earlier versions.
Nice, thanks! |
Following up on issue #19, we want to provide MJML users with a way to define meta information in the HTML
head
section. The idea here is to discuss openly here and to settle on a final implementation by the end of the week.In the new
mj-head
tag introduced (see #78), the behaviour ofmj-raw
tags will be to output its content in the final rendered HTML. No validation is done here by the MJML rendering engine.The text was updated successfully, but these errors were encountered: