Given that Webflow is not a JavaScript framework, and instead, scripts need to be injected manually into the "before </body>" box for each page we make, we must store our scripts in a separate place to have them handy when we need to edit them externally.
Please don't edit these scripts directly on Webflow without publishing to this repo.
- Go to the dashboard: https://webflow.com/dashboard
- There is only one workspace. So go to Solace main site.
- On the left bar, click on the Page icon.
- Click the gear icon to the right of the page that you wish to edit:
- Go to the last text box with the title
Before </body> tag - Create the tags
<script defer>and</script>if they are not already there - Find the JavaScript code in t he
srcfolder. If it's longer than 10,000 characters, minify the file. - Paste the JavaScript code between the
<script>tags. Make sure it doesn't have these tags already. - Click Save on the top-right of the left section.
- Click Publish on the top-right part of the dashboard
- Select a domain if it's not already selected.
- Click Publish to Selected Domains
Sometimes scripts don't fit due to a max-length 10,000 character limit.
- Install
minifyglobally (yarn global add minify). NPM link: https://www.npmjs.com/package/minify - Run
minify nameOfTheScript.js > nameOfTheScript.min.jswhere the first name is the existing one, and the second one will be created/replaced.
That's it.
