Skip to content

Instantly share code, notes, and snippets.

@Leko
Created July 12, 2015 07:56
Show Gist options
  • Save Leko/66b631ed2d67b5943caa to your computer and use it in GitHub Desktop.
Save Leko/66b631ed2d67b5943caa to your computer and use it in GitHub Desktop.

Revelメモ

知らないから不便に感じるのかも?

複数アプリ開発するときに全部GOPATH以下にやらなきゃいけないの?

ディレクトリを散らかすつもりもないしそういうルールなら別に従うのだけど、
revel newでアプリがGOPATH以下に作られたのでそう見えた。

GOPATHの勉強をしてないのでこの辺よくわかっていない

Goのここがイケてない

なし?

Revelのここがイケてない

デフォルトテンプレート

  • 古いjQuery(1.9)に古いBootstrap(2)がpublic以下に直入れされている。無い方がマシ
  • headタグ内にjQueryの読み込み+moreScriptsの読み込みが入っている
  • debug.htmlの内部にscriptタグが直接書かれておりjQueryを使っているのでこれ以下に移動できない

結果的な対応

  • scriptタグの読み込みをfooter.html(閉じbodyの直前)に移動
  • debug.html内のjsをpublic/js/debug.jsとして外出し
    • debug.html内のscriptタグが書かれていた箇所にappendを記述しmoreScriptsでdebug.jsを読み込むよう修正
  • デフォルトで入っていたjQuery, Bootstrapを削除しBowerで置き換え

多言語対応

  • 言語定義を複数ファイルに分けられるが、別ファイルとキー重複しないことを気にしなければならない
    • 複数ファイルでキーが重複すると上書きが起こる(ファイル名が言語のキーに影響しないため衝突する)

Important note : while it's technically possible to define the same message key in multiple files with the same language, this will result in unpredictable behaviour. When using multiple files per language, take care to keep your message keys unique so that keys will not be overwritten after the files are merged!

http://revel.github.io/manual/i18n-messages.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment