Adds Google Translate to a web page.
Add the following to your Jekyll website's Gemfile
:
group :jekyll_plugins do
gem 'jekyll_google_translate'
end
And then execute:
$ bundle
Copy demo/assets/css/jekyll_google_translate.css
to your Jekyll web site's CSS directory,
and update your layout accordingly.
The {% google_translate_html %} tag must be called to insert HTML into the page, then the {% google_translate_javascript %} tag must be called to insert Javascript into the page. For example:
<!DOCTYPE html>
<html lang="{{ site.lang | default: "en-US" }}">
<head>
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: nowMillis }}" type="text/css">
<link rel="stylesheet" href="{{ '/assets/css/jekyll_google_translate.css?v=' | append: nowMillis }}" type="text/css">
</head>
<body>
<nav id="sidebar">
{% google_translate_html %}
</nav>
</body>
{% google_translate_javascript %}
</html>
The above is usually incorporated into a layout, for example, _layouts/default.html
.
After checking out this git repository, install dependencies by typing:
$ bin/setup
You should do the above before running Visual Studio Code.
$ bundle exec rake test
The following will allow you to experiment:
$ bin/console
To install this gem onto your local machine, type:
$ bundle exec rake install
To create a git tag for the new version, push git commits and tags, and push the new version of the gem to https://rubygems.org, type:
$ bundle exec rake release
Bug reports and pull requests are welcome at https://github.com/mslinn/jekyll_google_translate.
The gem is available as open source under the terms of the MIT License.