Script to automatically inject hreflang tags and snippets into all pages into your Webflow or Squarespace website
node >=10
-
Clone repo
git clone https://github.com/weglot/integration-hooks.git
-
Install dependencies
yarn
ornpm i
-
Fill global options from
config.js
apiKey
: Weglot API Key from your dashboard setuporiginalHost
: your public website URL (eg. https://www.example.com)translatedHost
: your public website URL withLANG_CODE
instead of language code (eg. https://LANG_CODE.example.com)originalLanguage
: your original language (eg. 'en')languages
: array of your languages (eg. ['fr', 'de', 'es'])
-
Fill specific options from your platform:
wflogin
/wfsession
: In your Webflow admin page, open Chrome devtools (right click "inspect") > Application tab > Cookies > webflow.com, get content from wflogin (eg. 10101894633456) and wfsession (long random strings) cookiesprojectName
: Slug from webflow admin. Go to webflow admin page > Design mode > get current URL and remove https://webflow.com/design/ first part, you should get something asmy-first-project-a898b8
user
: Squarespace admin emailpassword
: Squarespace admin passwordprojectName
: Slug from Squarespace admin. Go to Squarespace admin page and get first piece of current URL: https://GET-THIS.squarespace.com/config/... eg.lobster-bear-t9h1
When you are ready, run node squarespace/hook.js
or node webflow/hook.js