Skip to content

Instantly share code, notes, and snippets.

@teammixture
Created November 20, 2013 19:51
Show Gist options
  • Save teammixture/7569872 to your computer and use it in GitHub Desktop.
Save teammixture/7569872 to your computer and use it in GitHub Desktop.
Example adding a class dynamically to a body tag based on the url in http://mixture.io
<!doctype html>
<html lang="en">
<head>
<title>{% block title %}Example{% endblock %}</title>
</head>
<body class="{{ mixture.url | slugify }}">
{% block content %}{% endblock %}
</body>
</html>
@teammixture
Copy link
Author

This will slugify the url and add to the body class, example...

/about - will become: about
/about-me - will become: about-me
/about-us/team - will become: about-usteam

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