bodyclass helper

By default the body is assigned the class std
    if some define <% content_for :bodyclass do%>clear<%done%>
    then the class of body is changed to clear, making it easy to
    switch style in css
This commit is contained in:
Yann Esposito (Yogsototh) 2011-07-11 11:27:12 +02:00
parent be636cbabe
commit e0bfeb11c7
21 changed files with 47 additions and 47 deletions

View file

@ -6,6 +6,7 @@ menupriority: 1
<% content_for :title do %>
<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=436268354&mt=8">Get it! &raquo;</a>
<% end %>
<% content_for :bodyclass do %>clear<% end %>
<div id="secure" class="slideshow">
<img src="/img/main/iPhone pw.jpg" class="clean" alt="Main Password View" class="leftimage" />

View file

@ -6,6 +6,7 @@ menupriority: 1
<% content_for :title do %>
<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=436268354&mt=8">Get it! &raquo;</a>
<% end %>
<% content_for :bodyclass do %>clear<% end %>
<div id="secure" class="slideshow">
<img src="/img/main/iPhone pw.jpg" class="clean" alt="Main Password View" class="leftimage" />

View file

@ -48,7 +48,7 @@
</head>
<body lang="<%= language %>">
<body lang="<%= language %>" class="<%=bodyclass%>">
<header>
<div id="choixrss"><%= choixrss %></div>
<div id="choixlang"><%= choixlang %></div>

View file

@ -39,7 +39,7 @@
</head>
<body lang="<%= language %>" class="bp">
<body lang="<%= language %>" class="<%=bodyclass%>">
<div id="container">
<header>
<div id="prelinks">

View file

@ -31,6 +31,14 @@ def choixlang
end.join()
end
def bodyclass
if @item[:content_for_bodyclass].nil?
"std"
else
@item[:content_for_bodyclass]
end
end
def page_title
if @item[:content_for_title].nil?
h2text=@item[:title]
@ -52,3 +60,4 @@ end
def last_modified_tag
return %{#{tradOf(:last_modified)}: <time>#{gitmtime.strftime(@config[:dateFormat][@conf.language.intern])}</time>}
end

View file

@ -142,7 +142,7 @@ module Nanoc3::Filters
identifiers :multicorps
def run(content, params={})
content.gsub(/^.*newcorps.*$/) do
%{\n</div>\n\n<div class="corps">\n}
%{\n</article>\n\n<article>\n}
end.gsub(/^.*begindiv\((.*)\).*$/) do
%{\n<div class="#{$1}">\n}
end.gsub(/^.*enddiv.*$/) do

View file

@ -6,6 +6,7 @@ menupriority: 1
<% content_for :title do %>
<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=436268354&mt=8">Get it! &raquo;</a>
<% end %>
<% content_for :bodyclass do %>clear<% end %>
<div id="secure" class="slideshow">
<img src="/img/main/iPhone pw.jpg" class="clean" alt="Main Password View" class="leftimage" />

View file

@ -48,7 +48,7 @@
</head>
<body lang="en">
<body lang="en" class="std">
<header>
<div id="choixrss"><a id="rss" href="http://feeds.feedburner.com/ypasswordespozitocomen">Subscribe</a></div>
<div id="choixlang"><a href="/Scratch/fr/blog/2011-05-05-Screenshots/" onclick="setLanguage('fr')">en Français</a></div>

View file

@ -3,8 +3,8 @@
<id>http://ypassword.espozito.com/</id>
<title>Yogsototh's last blogs entries</title>
<updated>2011-05-05T09:27:11Z</updated>
<link rel="alternate" href="http://ypassword.espozito.com/"/>
<link rel="self" href="http://feeds.feedburner.com/yannespositocomen"/>
<link href="http://ypassword.espozito.com/" rel="alternate"/>
<link href="http://feeds.feedburner.com/yannespositocomen" rel="self"/>
<author>
<name>Yann Esposito</name>
<uri>http://yannesposito.com</uri>
@ -14,11 +14,7 @@
<title type="html">Screenshots</title>
<published>2011-05-05T09:27:11Z</published>
<updated>2011-05-05T09:27:11Z</updated>
<author>
<name>Yann Esposito</name>
<uri>yannesposito.com</uri>
</author>
<link rel="alternate" href="http://ypassword.espozito.com/Scratch/en/blog/2011-05-05-Screenshots/"/>
<link href="http://ypassword.espozito.com/Scratch/en/blog/2011-05-05-Screenshots/" rel="alternate"/>
<content type="html">
&lt;div class="intro"&gt;

View file

@ -39,7 +39,7 @@
</head>
<body lang="en" class="bp">
<body lang="en" class="std">
<div id="container">
<header>
<div id="prelinks">

View file

@ -39,7 +39,7 @@
</head>
<body lang="en" class="bp">
<body lang="en" class="clear">
<div id="container">
<header>
<div id="prelinks">

View file

@ -39,7 +39,7 @@
</head>
<body lang="en" class="bp">
<body lang="en" class="std">
<div id="container">
<header>
<div id="prelinks">

View file

@ -48,7 +48,7 @@
</head>
<body lang="fr">
<body lang="fr" class="std">
<header>
<div id="choixrss"><a id="rss" href="http://feeds.feedburner.com/ypasswordespozitocomfr">s'abonner</a></div>
<div id="choixlang"><a href="/Scratch/en/blog/2011-05-05-Screenshots/" onclick="setLanguage('en')">in English</a></div>

View file

@ -3,8 +3,8 @@
<id>http://ypassword.espozito.com/</id>
<title>Yogsototh's last blogs entries</title>
<updated>2011-05-05T09:27:11Z</updated>
<link rel="alternate" href="http://ypassword.espozito.com/"/>
<link rel="self" href="http://feeds.feedburner.com/yannespositocomfr"/>
<link href="http://ypassword.espozito.com/" rel="alternate"/>
<link href="http://feeds.feedburner.com/yannespositocomfr" rel="self"/>
<author>
<name>Yann Esposito</name>
<uri>http://yannesposito.com</uri>
@ -14,11 +14,7 @@
<title type="html">Captures d'&#233;cran</title>
<published>2011-05-05T09:27:11Z</published>
<updated>2011-05-05T09:27:11Z</updated>
<author>
<name>Yann Esposito</name>
<uri>yannesposito.com</uri>
</author>
<link rel="alternate" href="http://ypassword.espozito.com/Scratch/fr/blog/2011-05-05-Screenshots/"/>
<link href="http://ypassword.espozito.com/Scratch/fr/blog/2011-05-05-Screenshots/" rel="alternate"/>
<content type="html">
&lt;div class="intro"&gt;

View file

@ -39,7 +39,7 @@
</head>
<body lang="fr" class="bp">
<body lang="fr" class="std">
<div id="container">
<header>
<div id="prelinks">

View file

@ -39,7 +39,7 @@
</head>
<body lang="fr" class="bp">
<body lang="fr" class="clear">
<div id="container">
<header>
<div id="prelinks">

View file

@ -39,7 +39,7 @@
</head>
<body lang="fr" class="bp">
<body lang="fr" class="std">
<div id="container">
<header>
<div id="prelinks">

View file

@ -2,35 +2,46 @@
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
<url>
<loc>http://ypassword.espozito.com/Scratch/fr/blog/2011-05-05-Screenshots/</loc>
<lastmod>2011-05-16</lastmod>
</url>
<url>
<loc>http://ypassword.espozito.com/Scratch/fr/blog/</loc>
<lastmod>2011-05-16</lastmod>
</url>
<url>
<loc>http://ypassword.espozito.com/Scratch/en/support/</loc>
<lastmod>2011-07-11</lastmod>
</url>
<url>
<loc>http://ypassword.espozito.com/Scratch/en/blog/feed/feed.xml</loc>
<lastmod>2011-05-04</lastmod>
</url>
<url>
<loc>http://ypassword.espozito.com/Scratch/fr/support/</loc>
<lastmod>2011-07-11</lastmod>
</url>
<url>
<loc>http://ypassword.espozito.com/Scratch/en/</loc>
<lastmod>2011-07-11</lastmod>
</url>
<url>
<loc>http://ypassword.espozito.com/Scratch/en/blog/2011-05-05-Screenshots/</loc>
<lastmod>2011-05-16</lastmod>
</url>
<url>
<loc>http://ypassword.espozito.com/Scratch/sitemap.xml</loc>
<lastmod>2011-05-04</lastmod>
</url>
<url>
<loc>http://ypassword.espozito.com/Scratch/fr/blog/feed/feed.xml</loc>
<lastmod>2011-05-04</lastmod>
</url>
<url>
<loc>http://ypassword.espozito.com/Scratch/en/blog/</loc>
<lastmod>2011-05-16</lastmod>
</url>
<url>
<loc>http://ypassword.espozito.com/Scratch/fr/</loc>
<lastmod>2011-07-11</lastmod>
</url>
</urlset>

View file

@ -66,6 +66,7 @@ hgroup#maintitle {
background-image: -webkit-linear-gradient(top, #60646c, #51555c);
background-image: -moz-linear-gradient(top, #60646c, #51555c);
background-image: -o-linear-gradient(top, #60646c, #51555c);
background-image: -ms-linear-gradient(top, #60646c, #51555c);
background-image: linear-gradient(top, #60646c, #51555c);
}
/* line 67, ../src/main.sass */
@ -92,6 +93,7 @@ hgroup#maintitle h2 {
background-image: -webkit-linear-gradient(top, #60646c, #51555c);
background-image: -moz-linear-gradient(top, #60646c, #51555c);
background-image: -o-linear-gradient(top, #60646c, #51555c);
background-image: -ms-linear-gradient(top, #60646c, #51555c);
background-image: linear-gradient(top, #60646c, #51555c);
}
/* line 82, ../src/main.sass */
@ -350,7 +352,7 @@ h1, h2 {
}
/* line 214, ../src/main.sass */
.slideshow {
body.std #main > article, .slideshow {
padding: 3em;
margin: 3em;
background-color: #e3e5ed;
@ -366,21 +368,11 @@ h1, h2 {
border-radius: 5px;
}
/* line 120, ../src/main.sass */
.slideshow > * {
body.std #main > article > *, .slideshow > * {
padding: 20px;
}
/* line 219, ../src/main.sass */
.slideshow .inner img {
margin: 0 3em;
}
/* line 221, ../src/main.sass */
.slideshow .inner h3 {
font-size: 2.5em;
font-weight: bold;
color: #b4b8c5;
}
/* line 226, ../src/main.sass */
/* line 219, ../src/main.sass */
.center {
margin: 0 auto;
text-align: center;

View file

@ -39,7 +39,7 @@
</head>
<body lang="en" class="bp">
<body lang="en" class="clear">
<div id="container">
<header>
<div id="prelinks">

View file

@ -211,17 +211,10 @@ $navWidth: 600px
width: $stdWidth
margin: 0 auto
.slideshow
body.std #main > article, .slideshow
padding: 3em
margin: 3em
+innerblock
.inner
img
margin: 0 3em
h3
font-size: 2.5em
font-weight: bold
color: $ycolor1
.center
margin: 0 auto