aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorB Mathis <brandon@imathis.com>2009-11-07 23:02:55 -0600
committerB Mathis <brandon@imathis.com>2009-11-07 23:02:55 -0600
commitbc9dd41b84705d06440d0073b95bff33d89cf6c6 (patch)
treed446a267d40d918dbe76cf9524e96df5162554ca /source
parentc27f5f8e5a4e35eecadf5c1565ab6e76a5a688e8 (diff)
downloadmy_new_personal_website-bc9dd41b84705d06440d0073b95bff33d89cf6c6.tar.xz
my_new_personal_website-bc9dd41b84705d06440d0073b95bff33d89cf6c6.zip
updated atom feed to use full_url passed from yaml for post urls
Diffstat (limited to '')
-rw-r--r--source/_helpers.rb4
-rw-r--r--source/atom.haml14
2 files changed, 9 insertions, 9 deletions
diff --git a/source/_helpers.rb b/source/_helpers.rb
index 0c767f70..4f7dbf6c 100644
--- a/source/_helpers.rb
+++ b/source/_helpers.rb
@@ -174,8 +174,8 @@ module Helpers
end
end
- def absolute_url(input)
- input.gsub(/(href|src)(\s*=\s*)(["'])(\/.*?)\3/) { $1 + $2 + $3 + "http://brandonmathis.com" + $4 + $3 }
+ def absolute_url(input, url)
+ input.gsub(/(href|src)(\s*=\s*)(["'])(\/.*?)\3/) { $1 + $2 + $3 + url + $4 + $3 }
end
def rp(input)
diff --git a/source/atom.haml b/source/atom.haml
index bcb370f6..a3999a3d 100644
--- a/source/atom.haml
+++ b/source/atom.haml
@@ -3,23 +3,23 @@ layout: nil
author: Your Name
email: author@domain.com
blog_title: My Octopress Blog
-root_url: http://yoursite.com
+full_url: http://yoursite.com
---
!!! XML
%feed(xmlns="http://www.w3.org/2005/Atom")
%title= page.blog_title
- %link(href="#{page.root_url}/atom.xml" rel="self")
- %link(href="#{page.root_url}")
+ %link(href="#{page.full_url}/atom.xml" rel="self")
+ %link(href="#{page.full_url}")
%updated= Time.now.xmlschema
- %id=page.root_url
+ %id=page.full_url
%author
%name= page.author
%email= page.email
- site.posts[0..14].each do |post|
%entry
%title= rp(post.title)
- %link(href="#{page.root_url}#{post.url}")
+ %link(href="#{page.full_url}#{post.url}")
%updated=post.date.xmlschema
- %id= "#{page.root_url}#{post.id}"
+ %id= "#{page.full_url}#{post.id}"
%content(type="html")
- = h(absolute_url(rp(post.content))) \ No newline at end of file
+ = h(absolute_url(rp(post.content), page.full_url)) \ No newline at end of file