Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
69 lines (46 sloc) 2.29 KB
Customize Templates

Customize Templates

Default templates are cool and fine, but in many cases you will want to customize them, especially the home page (though it would be awesome if you advertise for Peach 🍻).

To do that, you need first copy over default template files to custom directory in your project directory:

$ cp -r templates custom
$ tree custom/templates
├── 404.html
├── base.html
├── disqus.html
├── docs.html
├── footer.html
├── home.html
├── navbar.html
└── search.html

0 directories, 8 files

You now can edit those files to fit your needs. Generally, you only need to edit home.html and footer.html these two files.


Peach uses Go Pongo2 v3 as its templating engine, which uses using Django HTML, and syntax is most compatible with Django 1.7.

UI Framework

By default, Peach is using Semantic UI as its UI framework.

If you're familiar with it, awesome! But it is not a requirement.

You can change it and use Bootstrap as your UI framework because you have full control of how templates are defined. Of course, you need first import all the static resources you need to the custom directory.

See example of go-ini/ini package which uses Material Design for Bootstrap as its UI Framework.


Peach uses Macaron's i18n middleware for localization, here is an example how to translate a string in the template:

<h2>{{Tr(Lang,"hello %s","world")}}!</h2>

And a quick example for how to organize your custom locale files (there three supported languages in the example below):

$ tree custom/locale
├── locale_en-US.ini
├── locale_fr-FR.ini
└── locale_zh-CN.ini

0 directories, 3 files

Case Studies

In case you are interested in how other projects customize their templates and locale files: