diff options
author | Andrew Murrell <merl@neo.andrewdm.me> | 2017-12-26 08:43:24 +0000 |
---|---|---|
committer | Andrew Murrell <merl@neo.andrewdm.me> | 2017-12-26 08:43:24 +0000 |
commit | bc78567716a106042356053d556f57c1ddc13cfc (patch) | |
tree | 0c008bddb47699a9dcd62cdeb2e7131a137f64ee /lib/page_local.rb | |
parent | db410594baa4bb507aaa23ff98bf8853056b0823 (diff) | |
parent | 50830151e8168b8be0100da349ba7e3576054dc3 (diff) |
Merge branch 'master' of https://git.andrewdm.me/www
Diffstat (limited to 'lib/page_local.rb')
-rw-r--r-- | lib/page_local.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/page_local.rb b/lib/page_local.rb index e13fa33..6c70ac3 100644 --- a/lib/page_local.rb +++ b/lib/page_local.rb @@ -9,6 +9,21 @@ require 'pandoc' require 'person' class LocalPage < Page + def self.load(inpath) + case + when Dir::exist?(inpath) + require 'page_index' + return IndexPage::new(inpath) + when [".md", ".org"].include?(File::extname(inpath)) + return LocalPage::new(inpath) + when ".pdf" == File::extname(inpath) + require 'page_pdf' + return PdfPage::new(inpath) + else + return nil + end + end + def initialize(infile) @infile = infile super() |