Skip to content

Commit

Permalink
Some more robust JS for link posts and removed comments and category …
Browse files Browse the repository at this point in the history
…info from new post meta data which I never use
  • Loading branch information
jimwhimpey committed Apr 1, 2012
1 parent 5e70c40 commit f0f0e83
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ task :new_post, :title do |t, args|
post.puts "layout: post"
post.puts "title: \"#{title.gsub(/&/,'&')}\""
post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
post.puts "comments: true"
post.puts "categories: "
post.puts "---"
end
end
Expand Down
2 changes: 1 addition & 1 deletion source/javascripts/valhalla.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $(function(){
// If the first line of a post is just a link with nothing else make the
// title of the post become the link.
$("article").each(function(){
if ($(this).find("h2").text() == $(this).find("p:first-child a").text()) {
if (($(this).find("h2").text() == $(this).find("p:first-child a").text()) && $(this).find("p:first-child a").text() != "") {
var title = $(this).find("h2").text();
$(this).find("h2").empty().append("<a href='" + $(this).find("p:first-child a").attr("href") + "'>" + title + "</a>");
$(this).find("p:first-child").remove();
Expand Down

0 comments on commit f0f0e83

Please sign in to comment.