From 9dc532d78d045af3b4e22106102fe25df6fa6132 Mon Sep 17 00:00:00 2001 From: Jeff Dean Date: Fri, 14 Feb 2014 09:13:57 -0700 Subject: [PATCH] improve rendering of code on the index page - style highlighted code blocks with darker background and border - fix whitespace problems / invalid html on code blocks on the homepage - update readme to remove warning about issues --- README.md | 3 --- source/index.html.haml | 10 +++++----- source/stylesheets/app.css.scss | 9 ++++++++- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 35d11d1b..c86e5c20 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,3 @@ for more information about adding dates and tags to each article. ``` 1. (Optional) Rename the blog to something other than the default Heroku name. You can do this via the Heroku console after you log in. - -Note: The styling of code highlighting is a bit broken when the code shows up on the homepage. If you would like to embed code in your -blog posts, let an instructor know. diff --git a/source/index.html.haml b/source/index.html.haml index 75d9e11a..df28cb6b 100644 --- a/source/index.html.haml +++ b/source/index.html.haml @@ -7,11 +7,11 @@ per_page: 10 .twelve.columns - page_articles.each_with_index do |article, i| .panel - %p - %h3 - = link_to article.title, article - %span= article.date.strftime('%b %e') - %p= article.summary + %h3 + = link_to article.title, article + %span= article.date.strftime('%b %e') + = find_and_preserve do + = article.summary .row .six.columns diff --git a/source/stylesheets/app.css.scss b/source/stylesheets/app.css.scss index 16de5066..b5d5adc1 100644 --- a/source/stylesheets/app.css.scss +++ b/source/stylesheets/app.css.scss @@ -52,4 +52,11 @@ /* This beautiful CSS-File has been crafted with LESS (lesscss.org) and compiled by simpLESS (wearekiss.com/simpless) */ @import url(http://fonts.googleapis.com/css?family=PT+Sans:700); -@import url(http://fonts.googleapis.com/css?family=Lustria:400); \ No newline at end of file +@import url(http://fonts.googleapis.com/css?family=Lustria:400); + +pre.highlight { + border: 1px solid #ccc; + padding: 1em; + background: #ddd; + margin: 1em 0; +} \ No newline at end of file