Skip to content

Instantly share code, notes, and snippets.

@markbrown4
Created August 28, 2012 10:12
Show Gist options
  • Save markbrown4/3496883 to your computer and use it in GitHub Desktop.
Save markbrown4/3496883 to your computer and use it in GitHub Desktop.
refinerycms thoughts

Make key views overridden by default and have less unnecessary partials

Application layout should look more like this and be in a new project so you can instantly see what is happening.

  <!DOCTYPE html>
  <html lang="en">
  <% site_bar = render('/refinery/site_bar', :head => true) -%>
  <head>
  <meta charset='<%= Rails.application.config.encoding %>'>
  <title><%= browser_title(yield(:title)) %></title>
  <%= raw %(<meta name="description" content="#{@meta.meta_description}" />) if @meta.meta_description.present? -%>
  <%= raw %(<meta name="keywords" content="#{@meta.meta_keywords}">) if @meta.meta_keywords.present? -%>
  <%= raw %(<link rel="canonical" content="#{@canonical}" />) if @canonical.present? -%>
  <%= csrf_meta_tags if Refinery::Core.authenticity_token_on_frontend -%>
  <%= yield :meta %>
  <%= stylesheet_link_tag "application" %>
  <%= yield :stylesheets %>
  <%= render '/refinery/google_analytics' %>
  </head>
  <body>
  <%= site_bar -%>
  <div id="wrapper">
    <div id="header">
      <h1 id="logo"><%= link_to Refinery::Core.site_name, '/' %></h1>
    </div>
    <div id="aside">
      <%= render(:partial => "/refinery/menu") %>
      <%= render(:partial => "/refinery/search_form") %>
    </div>
    <div id="content">
      <%= render(:partial => "/refinery/breadcrumbs") %>
      <%= yield %>
    </div>
    <div id="footer">
      <p>&copy; <%= Time.now.year %> <%= Refinery::Core.site_name %></p>
    </div>
  </div>
  <%= render '/refinery/javascripts' %>
  </body>
  </html>

Search and breadcrumbs should be default components that can be deleted from the template if not needed.

View Templates should be enabled by default as it's such a core part of skinning any site. home and show should be there but simplified to this, is _content_page really needed?

  <h1><%= @page.title %></h1>
  <%=raw @page.content_for(:body) %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment