Module: Emjay::Skeleton
- Defined in:
- lib/emjay/skeleton.rb
Class Method Summary collapse
-
.call(options) ⇒ Object
Builds the full HTML document skeleton.
Class Method Details
.call(options) ⇒ Object
Builds the full HTML document skeleton. Port of skeleton.js.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/emjay/skeleton.rb', line 10 def self.call() before_doctype = [:before_doctype] || "" breakpoint = [:breakpoint] || "480px" content = [:content] || "" fonts = [:fonts] || {} media_queries = [:media_queries] || {} head_style = [:head_style] || {} components_head_style = [:components_head_style] || [] head_raw = [:head_raw] || [] title = [:title] || "" style = [:style] || [] force_owa_desktop = [:force_owa_desktop] || false printer_support = [:printer_support] || false inline_style = [:inline_style] || [] lang = [:lang] || "und" dir = [:dir] || "auto" before_doctype_str = before_doctype.empty? ? "" : "#{before_doctype}\n" = Fonts.(content, inline_style, fonts) = MediaQueries.(breakpoint, media_queries, force_owa_desktop: force_owa_desktop, printer_support: printer_support) component_styles = Styles.build_from_components(breakpoint, components_head_style, head_style) tag_styles = Styles.(breakpoint, style) raw = head_raw.compact.join("\n") <<~HTML #{before_doctype_str}<!doctype html> <html lang="#{lang}" dir="#{dir}" 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}</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; } 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]> <noscript> <xml> <o:OfficeDocumentSettings> <o:AllowPNG/> <o:PixelsPerInch>96</o:PixelsPerInch> </o:OfficeDocumentSettings> </xml> </noscript> <![endif]--> <!--[if lte mso 11]> <style type="text/css"> .mj-outlook-group-fix { width:100% !important; } </style> <![endif]--> #{} #{} #{component_styles} #{tag_styles} #{raw} </head> #{content} </html> HTML end |