Skip to content

Keyword Mappings of limited value to HTML content #10

@GavinOsborn

Description

@GavinOsborn

Scenario

  • You use the deploy-cli to deploy your custom logon page
  • Your project promotes changes through a series of environments before getting to productioin
  • Each environment has a different CDN for hosting css, images, scripts, etc

Ideally, in this scenario you'd want to be able to build your page to accept a Keyword Mapping to replace the CDN host address during deployment.

Something like this:

<html>
    <head>
   <script src="@@CDN_HOST@@/snazzy-login.js"></script>
   <link href="@@CDN_HOST@@/styles/login.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
      <h1> Logon! </h1>
      <img src="@@CDN_HOST@@/images/company_logo.png" />
    </body>
</html>

With a config file like this:

{
  "AUTH0_DOMAIN": "...",
  "AUTH0_CLIENT_ID": "...",
  "AUTH0_CLIENT_SECRET": "...",
  "AUTH0_KEYWORD_REPLACE_MAPPINGS": {
    "CDN_HOST": "https://prod.cdn.com"
  }
}

Unfortunately this yields extra " in the HTML when deployed eg:

href=""https://prod.cdn.com"/styles/login.css"

I assume this is because the mapping was originally written for building JSON trees like

{
  "host": @@CDN_HOST@@
}

My local testing is consistent, I'm surprised this didn't come up in #3 when @nickcoury was trying something similar?

I'm trying to replace a keyword in an HTML page and for the life of me can't get it to work as the documentation shows.

Am I imagining things?

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