Corrected some HTML bugs, works without article

This commit is contained in:
Yann Esposito (Yogsototh) 2011-05-02 16:23:59 +02:00
parent a40b33d18d
commit 3cb64cda76
12 changed files with 183 additions and 86 deletions

View file

@ -32,28 +32,23 @@ Last <%= number_of_articles %> Articles
</div> </div>
<% last_articles.each do |a| %> <% last_articles.each do |a| %>
<h1> <article>
<%= calendar_for( a[:created_at], language ) %> <%= calendar_for( a[:created_at], language ) %>
<%= link_to(a[:title]+%{ <span class="nicer">»</span>}, a) %> <h1> <%= link_to(a[:title]+%{ <span class="nicer">»</span>}, a) %> </h1>
</h1>
<div class="corps"> <div class="content">
<%= repair_html ( excerptize( a.reps[0].compiled_content, {:length => number_of_char_for_resume} ) ) %>
<%
puts "%%%" <div class="flush"></div>
puts excerptize( a.reps[0].compiled_content, {:length => number_of_char_for_resume}) <div>
puts "%%%" <p>
%> <%= link_to(%{Read more <span class="nicer">»</span>}, a) %>
<%= repair_html ( excerptize( a.reps[0].compiled_content, {:length => number_of_char_for_resume} ) ) %> </p>
</div>
<div class="flush"></div>
<div>
<p>
<%= link_to(%{Read more <span class="nicer">»</span>}, a) %>
</p>
</div> </div>
</article>
</div> <hr/>
<% end %> <% end %>
<div class="corps"> <div class="corps">

View file

@ -0,0 +1,18 @@
-----
isHidden: false
menupriority: 1
kind: article
created_at: 2011-05-02T14:56:25+02:00
title: First post
author_name: Yann Esposito
author_uri: yannesposito.com
# tags:
-----
begindiv(intro)
<%= tldr %> This is a first post.
enddiv
Hello guys. This is a first post test.

View file

@ -32,28 +32,23 @@ Les <%= number_of_articles %> derniers articles
</div> </div>
<% last_articles.each do |a| %> <% last_articles.each do |a| %>
<h1> <article>
<%= calendar_for( a[:created_at], language ) %> <%= calendar_for( a[:created_at], language ) %>
<%= link_to(a[:title]+%{ <span class="nicer">»</span>}, a) %> <h1> <%= link_to(a[:title]+%{ <span class="nicer">»</span>}, a) %> </h1>
</h1>
<div class="corps"> <div class="content">
<%= repair_html ( excerptize( a.reps[0].compiled_content, {:length => number_of_char_for_resume} ) ) %>
<%
puts "%%%" <div class="flush"></div>
puts excerptize( a.reps[0].compiled_content, {:length => number_of_char_for_resume}) <div>
puts "%%%" <p>
%> <%= link_to(%{en lire plus <span class="nicer">»</span>}, a) %>
<%= repair_html ( excerptize( a.reps[0].compiled_content, {:length => number_of_char_for_resume} ) ) %> </p>
</div>
<div class="flush"></div>
<div>
<p>
<%= link_to(%{en lire plus <span class="nicer">»</span>}, a) %>
</p>
</div> </div>
</article>
</div> <hr/>
<% end %> <% end %>
<div class="corps"> <div class="corps">

View file

@ -0,0 +1,18 @@
-----
isHidden: false
menupriority: 1
kind: article
created_at: 2011-05-02T14:56:25+02:00
title: First post
author_name: Yann Esposito
author_uri: yannesposito.com
# tags:
-----
begindiv(intro)
<%= tlal %> C'est une premier post.
enddiv
Salut ! C'est le premier article pour tester `nanoc`.

View file

@ -1 +1 @@
./multi/blog/2011-04-20-Now-hosted-on-github.md ./multi/blog/2011-05-02-First-post.md

View file

@ -3,15 +3,19 @@
<% <%
language=@item_rep.path.sub(%r{#{@config[:webprefix]}/},'').sub(/\/.*$/,'') language=@item_rep.path.sub(%r{#{@config[:webprefix]}/},'').sub(/\/.*$/,'')
number_of_char_for_resume=800 number_of_char_for_resume=800
larts = articles.select { |a| a.reps[0].path =~ /\/#{language}\// }
if larts.length>0
%><%= %><%=
# atom_feed( { atom_feed( {
# :articles => articles.select { |a| a.reps[0].path =~ /\/#{language}\// }, :articles => larts,
# :content_proc =>lambda { |a| :content_proc =>lambda { |a|
# repair_html( repair_html(
# excerptize( excerptize(
# a.compiled_content(:snapshot => :pre), a.compiled_content(:snapshot => :pre),
# {:length => number_of_char_for_resume} )) {:length => number_of_char_for_resume} ))
# }, },
# :limit => 40 :limit => 40
# }) })
%><%
end
%> %>

View file

@ -58,7 +58,7 @@
<div id="container"> <div id="container">
<div id="main" role="main"> <div id="main" role="main">
<hgoup> <hgroup>
<h1><%= @item[:content_for_title].nil? ? @item[:title] : @item[:content_for_title] %></h1> <h1><%= @item[:content_for_title].nil? ? @item[:title] : @item[:content_for_title] %></h1>
<% unless @item[:subtitle].nil? and @item[:content_for_subtitle].nil? %> <% unless @item[:subtitle].nil? and @item[:content_for_subtitle].nil? %>
<h2> <h2>

View file

@ -26,7 +26,7 @@ def repair_html( html, debug=false )
end end
else else
depth-=1 depth-=1
if (not debug) and (depth <0) if debug and (depth <0)
puts 'ERROR repair_html: ' puts 'ERROR repair_html: '
puts 'HTML: ' + html puts 'HTML: ' + html
puts '---' puts '---'
@ -40,7 +40,7 @@ def repair_html( html, debug=false )
end end
res=html.sub(/<[^>]*$/m,'') res=html.sub(/<[^>]*$/m,'')
depth -= 1 depth -= 1
if (depth < 0) if debug and (depth < 0)
parents=[] parents=[]
depth=0 depth=0
html.scan( %r{<(/?)(\w*)[^>]*(/?)>} ).each do |m| html.scan( %r{<(/?)(\w*)[^>]*(/?)>} ).each do |m|

View file

@ -36,29 +36,24 @@ fr: Les <%= number_of_articles %> derniers articles
</div> </div>
<% last_articles.each do |a| %> <% last_articles.each do |a| %>
<h1> <article>
<%= calendar_for( a[:created_at], language ) %> <%= calendar_for( a[:created_at], language ) %>
<%= link_to(a[:title]+%{ <span class="nicer">»</span>}, a) %> <h1> <%= link_to(a[:title]+%{ <span class="nicer">»</span>}, a) %> </h1>
</h1>
<div class="corps"> <div class="content">
<%= repair_html ( excerptize( a.reps[0].compiled_content, {:length => number_of_char_for_resume} ) ) %>
<%
puts "%%%" <div class="flush"></div>
puts excerptize( a.reps[0].compiled_content, {:length => number_of_char_for_resume}) <div>
puts "%%%" <p>
%> fr: <%= link_to(%{en lire plus <span class="nicer">»</span>}, a) %>
<%= repair_html ( excerptize( a.reps[0].compiled_content, {:length => number_of_char_for_resume} ) ) %> en: <%= link_to(%{Read more <span class="nicer">»</span>}, a) %>
</p>
<div class="flush"></div> </div>
<div>
<p>
fr: <%= link_to(%{en lire plus <span class="nicer">»</span>}, a) %>
en: <%= link_to(%{Read more <span class="nicer">»</span>}, a) %>
</p>
</div> </div>
</article>
</div> <hr/>
<% end %> <% end %>
<div class="corps"> <div class="corps">

View file

@ -0,0 +1,21 @@
-----
isHidden: false
menupriority: 1
kind: article
created_at: 2011-05-02T14:56:25+02:00
fr: title: First post
en: title: First post
author_name: Yann Esposito
author_uri: yannesposito.com
# tags:
-----
begindiv(intro)
en: <%= tldr %> This is a first post.
fr: <%= tlal %> C'est une premier post.
enddiv
en: Hello guys. This is a first post test.
fr: Salut ! C'est le premier article pour tester `nanoc`.

View file

@ -50,18 +50,22 @@ body > footer {
-o-box-shadow: #888888 0px 1px 5px 0; -o-box-shadow: #888888 0px 1px 5px 0;
box-shadow: #888888 0px 1px 5px 0; box-shadow: #888888 0px 1px 5px 0;
} }
/* line 68, ../src/main.scss */
body > footer a {
color: #2c5490;
}
/* line 72, ../src/main.scss */ /* line 75, ../src/main.scss */
nav { nav {
border-bottom: solid 1px rgba(0, 0, 0, 0.1); border-bottom: solid 1px rgba(0, 0, 0, 0.1);
} }
/* line 75, ../src/main.scss */ /* line 78, ../src/main.scss */
nav ul { nav ul {
list-style-type: none; list-style-type: none;
} }
/* line 78, ../src/main.scss */ /* line 81, ../src/main.scss */
nav ul li { nav ul li {
display: inline-block; display: inline-block;
height: 50px; height: 50px;
@ -72,7 +76,7 @@ nav ul li {
border-right: solid 1px rgba(0, 0, 0, 0.2); border-right: solid 1px rgba(0, 0, 0, 0.2);
} }
/* line 87, ../src/main.scss */ /* line 90, ../src/main.scss */
nav ul li * { nav ul li * {
display: block; display: block;
margin-right: 0px; margin-right: 0px;
@ -82,23 +86,23 @@ nav ul li * {
text-shadow: -1px -1px rgba(0, 0, 0, 0.2), 1px 1px rgba(0, 0, 0, 0.2); text-shadow: -1px -1px rgba(0, 0, 0, 0.2), 1px 1px rgba(0, 0, 0, 0.2);
} }
/* line 95, ../src/main.scss */ /* line 98, ../src/main.scss */
nav ul li span.active { nav ul li span.active {
background-color: #002233; background-color: #002233;
} }
/* line 98, ../src/main.scss */ /* line 101, ../src/main.scss */
nav ul li a { nav ul li a {
color: rgba(255, 255, 255, 0.8); color: rgba(255, 255, 255, 0.8);
} }
/* line 101, ../src/main.scss */ /* line 104, ../src/main.scss */
nav ul li a:hover { nav ul li a:hover {
color: rgba(255, 255, 255, 0.8); color: rgba(255, 255, 255, 0.8);
background-color: rgba(255, 255, 255, 0.1); background-color: rgba(255, 255, 255, 0.1);
} }
/* line 106, ../src/main.scss */ /* line 109, ../src/main.scss */
header #choixrss, header #choixlang { header #choixrss, header #choixlang {
display: block; display: block;
margin-right: 0px; margin-right: 0px;
@ -112,7 +116,7 @@ header #choixrss, header #choixlang {
border-right: solid 1px rgba(0, 0, 0, 0.2); border-right: solid 1px rgba(0, 0, 0, 0.2);
} }
/* line 118, ../src/main.scss */ /* line 121, ../src/main.scss */
header #choixrss a, header #choixlang a { header #choixrss a, header #choixlang a {
color: #bcd0ee; color: #bcd0ee;
display: block; display: block;
@ -122,23 +126,23 @@ header #choixrss a, header #choixlang a {
text-align: center; text-align: center;
} }
/* line 126, ../src/main.scss */ /* line 129, ../src/main.scss */
header #choixrss a:hover, header #choixlang a:hover { header #choixrss a:hover, header #choixlang a:hover {
color: rgba(255, 255, 255, 0.8); color: rgba(255, 255, 255, 0.8);
background-color: rgba(255, 255, 255, 0.1); background-color: rgba(255, 255, 255, 0.1);
} }
/* line 131, ../src/main.scss */ /* line 134, ../src/main.scss */
#main { #main {
margin: 0px auto; margin: 0px auto;
} }
/* line 134, ../src/main.scss */ /* line 137, ../src/main.scss */
#container { #container {
margin: 0px auto; margin: 0px auto;
} }
/* line 138, ../src/main.scss */ /* line 141, ../src/main.scss */
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
font-family: 'Expletus Sans',Futura,sans-serif; font-family: 'Expletus Sans',Futura,sans-serif;
text-shadow: 0px -1px 0px #2233aa, 0px 1px 0px white; text-shadow: 0px -1px 0px #2233aa, 0px 1px 0px white;
@ -147,7 +151,33 @@ h1, h2, h3, h4, h5, h6 {
margin: 48px 0; margin: 48px 0;
} }
/* line 147, ../src/main.scss */ /* line 149, ../src/main.scss */
h1, h2, h3, h4, h5, h6 {
text-align: center;
}
/* line 151, ../src/main.scss */
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover {
text-shadow: 0px -1px 0px #441111, 0px 1px 0px white; text-shadow: 0px -1px 0px #441111, 0px 1px 0px white;
} }
/* line 156, ../src/main.scss */
article article .date {
float: right;
}
/* line 157, ../src/main.scss */
article article h1, article article h2, article article h3, article article h4, article article h5, article article h6 {
text-align: left;
font-size: 25px;
line-height: 30px;
margin: 0;
}
/* line 166, ../src/main.scss */
.intro {
margin-bottom: 24px;
}
/* line 169, ../src/main.scss */
.sc {
font-variant: small-caps;
}

View file

@ -65,6 +65,9 @@ body > footer {
font-size: .9em; font-size: .9em;
text-shadow: 1px 1px #fff; text-shadow: 1px 1px #fff;
@include box-shadow(#888); @include box-shadow(#888);
a {
color: $dark;
}
} }
$menuItemWidth: 6em; $menuItemWidth: 6em;
@ -144,7 +147,25 @@ h1, h2, h3, h4, h5, h6 {
} }
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
text-align: center;
a:hover { a:hover {
text-shadow: 0px -1px 0px $hoverColorShadow, 0px 1px 0px #FFF; text-shadow: 0px -1px 0px $hoverColorShadow, 0px 1px 0px #FFF;
} }
} }
article article {
.date { float: right; }
h1, h2, h3, h4, h5, h6 {
text-align: left;
font-size: 25px;
line-height: 30px;
margin: 0;
}
}
.intro {
margin-bottom: 24px;
}
.sc {
font-variant: small-caps;
}