Skip to content

Instantly share code, notes, and snippets.

@revelt
Created January 15, 2015 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save revelt/fee006fbec6f4e603be7 to your computer and use it in GitHub Desktop.
Save revelt/fee006fbec6f4e603be7 to your computer and use it in GitHub Desktop.
Hexo Body with conditional classes
<body class="<% if(is_home()){ %>body-front-page<% } %><% if(is_post()){ %>body-single-page<% } %><% if(is_archive()){ %>body-archive<% } %><% if(is_year()){ %>body-year<% } %><% if(is_month()){ %>body-month<% } %><% if(is_category()){ %>body-category<% } %><% if(is_tag()){ %>body-tag<% } %>">
@revelt
Copy link
Author

revelt commented Jan 15, 2015

Here I used all conditional page type queries from http://hexo.io/docs/helpers.html

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