from django import template register = template.Library() @register.simple_tag def wiki_url(article=""): if article == "": return "https://wiki.archlinux.org/" else: return "https://wiki.archlinux.org/index.php/"+article.replace(' ', '_')