Skip to content

Unable to use fonts locally and webfonts #1079

Description

@TheoOliveira
  • Maizzle Version: latest
  • Node.js Version: 20.8.0

on my tailwind config i've setup like this

monteserrat: ["'Monteserrat'", 'ui-serif', 'Georgia', 'Cambria', '"Times New Roman"', 'Times', 'serif'], gotham: ['Gotham', 'Arial', 'sans-serif']

on my config file like this

/** @type {import('@maizzle/framework').Config} */

module.exports = {
  shorthandCSS: true,
  build: {
    templates: {
      source: 'src/templates',
      destination: {
        path: 'build_local',
      },
      assets: {
        source: ['src/images', 'src/fonts'],
        destination: 'assets',
      },
    },
  },
}

on my main file like this:

<!DOCTYPE {{{ page.doctype || 'html' }}}>
<html
  lang="{{ page.language || 'pt-br' }}"
  xmlns:v="urn:schemas-microsoft-com:vml"
>
  <head>
    <meta charset="{{ page.charset || 'utf-8' }}" />
    <meta name="x-apple-disable-message-reformatting" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta
      name="format-detection"
      content="telephone=no, date=no, address=no, email=no, url=no"
    />
    <meta name="color-scheme" content="light dark" />
    <meta name="supported-color-schemes" content="light dark" />

    <!--[if mso]>
      <noscript>
        <xml>
          <o:OfficeDocumentSettings
            xmlns:o="urn:schemas-microsoft-com:office:office"
          >
            <o:PixelsPerInch>96</o:PixelsPerInch>
          </o:OfficeDocumentSettings>
        </xml>
      </noscript>
      <style>
        td,
        th,
        div,
        p,
        a,
        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
          font-family: "Segoe UI", sans-serif;
          mso-line-height-rule: exactly;
        }
      </style>
    <![endif]-->
    <if condition="page.title">
      <title>{{{ page.title }}}</title>
    </if>
    <!-- Google Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link
      href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;500;700&display=swap"
      rel="stylesheet"
    />
    <style>
         @font-face {
        font-family: 'Gotham';
        font-style: normal;
        font-weight: 900;
        src: url("assets/gotham-black.otf") format('otf');
      }
        {{{ page.css }}}
    </style>
    <stack name="head" />
  </head>
  <body
    class="m-0 p-0 w-full [word-break:break-word] [-webkit-font-smoothing:antialiased] {{ page.bodyClass || '' }}"
  >
    <if condition="page.preheader">
      <div class="hidden">
        {{{ page.preheader }}}
        <each loop="item in Array.from(Array(150))"
          >&#8199;&#65279;&#847;
        </each>
      </div>
    </if>
    <div
      role="article"
      aria-roledescription="email"
      aria-label="{{{ page.title || '' }}}"
      lang="{{ page.language || 'en' }}"
    >
      <content />
    </div>
  </body>
</html>

yet the asset is not loaded at all nor i can't access the usage of montserrat

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions