Skip to content

Instantly share code, notes, and snippets.

View theodesp's full-sized avatar
🦄
Jumping over Rainbows...

Theofanis Despoudis theodesp

🦄
Jumping over Rainbows...
View GitHub Profile
brew install hugo
➜ hugo version
Hugo Static Site Generator v0.53/extended darwin/amd64 BuildDate: unknown
➜ hugo new site phraseapp-hugo-i18n
➜ cd phraseapp-hugo-i18n
git clone https://github.com/josephhutch/aether.git themes/aether
echo 'theme = "aether"' >> config.toml
....
DefaultContentLanguage = "en"
[languages]
[languages.en]
title = "My New Hugo i18n Site"
languageName = "English"
weight = 1
[languages.gr]
➜ cp -R themes/aether/exampleSite/content content/
hugo server -D
{{ if eq $.Site.Params.phraseAppEnabled true }}
<script>
window.PHRASEAPP_CONFIG = {
projectId: "<projectId>"
};
(function() {
var phraseapp = document.createElement('script'); phraseapp.type = 'text/javascript'; phraseapp.async = true;
phraseapp.src = ['https://', 'phraseapp.com/assets/in-context-editor/2.0/app.js?', new Date().getTime()].join('');
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(phraseapp, s);
})();
<h1 class="post-title">{{ i18n (printf $.Site.Params.phraseapp_key .Title) }}</h1>
[params]
phraseAppEnabled = true
phraseapp_key = "{{__phrase_%s__}}"
defaultContentLanguageInSubdir = true