Keyword Mappings of limited value to HTML content
See original GitHub issueScenario
- 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?
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Keyword type family | Elasticsearch Guide [8.5]
The wildcard type is optimized for fields with large values or high cardinality. Mapping unstructured content. You can map a field containing unstructured ......
Read more >Keyword Mapping for SEO: 7-Step Guide for Your Website
Keyword mapping is a must-do thing for any SEO or website owner, as it can help you refine your content strategy in the...
Read more >Elasticsearch Mapping: The Basics, Updates & Examples
Keyword fields are only searchable by their exact value. Use keyword data types when you have fields like email addresses, hostnames, status codes,...
Read more >HTML attribute reference - HTML: HyperText Markup Language
Attribute Name Elements Description
accept‑charset List of supported charsets.
align, , , , , , , , , , , , , Specifies the horizontal...
Read more >Autocomplete attribute has valid value | ACT Rule | WAI
This rule checks that the HTML autocomplete attribute has a correct value. ... value of either Image Button (the state) or image (the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@GavinOsborn love that last idea! See this PR: https://github.com/auth0-extensions/auth0-source-control-extension-tools/pull/17
I’ve changed it to just support @@key@@ => JSON replace, ##key## => Literal replace
Just shipped our adoption of this feature. Works a treat! Thanks!