Mailgo in React / Angular / Vue / Hugo
#
React#
First way (recommended)Install mailgo through
or
and then
and then you can call
to initialize mailgo.
You can customize mailgo installation with an optional config parameter. See Configuration section to use config object. Just pass it as a parameter of mailgo
function.
BREAKING CHANGES from version 0.10.*: you can also use
but then you have to call
#
Second wayInstall mailgo through
or
and then just
or
in App.js
, index.js
or any other root component.
No configurations are allowed directly, except for Configuration in window.
#
React examplesYou can see a React complete example of using mailgo (in particular using create-react-app
) in this repository: https://github.com/manzinello/create-react-mailgo-app, and here a create-react-app
example deployed called create-react-mailgo-app
: https://create-react-mailgo-app.mailgo.dev.
#
Next.jsSee the detail in Next.js section
#
AngularInstall mailgo through
or
then add mailgo to your .angular-cli.json
in this way
#
VueInstall mailgo
or
and then import mailgo
into main.js, and then you can call
to initialize mailgo.
#
Vue examplesHere a repository of a project created through vue-cli
using mailgo: https://github.com/manzinello/vue-mailgo
Here the same example deployed: https://vue-mailgo.mailgo.dev
#
HugoStandard installation methods are supported. The simplest solution is to install mailgo into one of your content files (a post or page) using the CDN method since anything added in the content markdown file is included in the content page body on site generation.
#
Hugo 0.60.0 and higherHugo changed its default markdown library to Goldmark in its 0.60.0 release. The use of inline HTML is no longer supported by default. You must update your site config for mailgo to function as an inline HTML element.
config.toml
sample - more info on the Hugo blog
#
Partial templates and shortcodesIn Hugo, you can create a partial template for mailgo to include it in the head of every page, or you can write a custom shortcode for insertion into individual content pages.
Here is a sample use of a custom shortcode that includes the mailgo icon - original gist
layouts/shortcodes/mailgo.html
content/posts/mypost.md
Adding mailgo in a partial or shortcode avoids using inline HTML in your markdown files. With this method, you are not required to update your site config file as shown in the section above.