add Post#id
This commit is contained in:
parent
4ef3aedb6a
commit
93afa8ca72
|
@ -35,6 +35,10 @@ module AutoBlog
|
||||||
self.dir + self.slug + ".html"
|
self.dir + self.slug + ".html"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def id
|
||||||
|
self.dir + self.slug
|
||||||
|
end
|
||||||
|
|
||||||
def read_yaml(base, name)
|
def read_yaml(base, name)
|
||||||
self.content = File.read(File.join(base, name))
|
self.content = File.read(File.join(base, name))
|
||||||
|
|
||||||
|
@ -76,6 +80,7 @@ module AutoBlog
|
||||||
{ "title" => self.data["title"] || "",
|
{ "title" => self.data["title"] || "",
|
||||||
"url" => self.url,
|
"url" => self.url,
|
||||||
"date" => self.date,
|
"date" => self.date,
|
||||||
|
"id" => self.id,
|
||||||
"content" => self.content }
|
"content" => self.content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue