Compare commits

..

No commits in common. "f0e0bf16dabdece3c26aea13da5abcd56fafbfbb" and "50152e4abf8bf5d12deae30b56ed3943a02f59da" have entirely different histories.

3 changed files with 2 additions and 22 deletions

View file

@ -1,16 +1,3 @@
# perc
Better Werc
# TODO
- [ ] Documentation
- [ ] Adding expiry to cache files.
- [ ] Adding support for [Slim](https://slim-template.github.io/) Template
- [ ] Support for dirrent layout files for subdirectory.
- [ ] Adding search. From what I can find, there are several good tools aviable that
index the site, e.g. [sphinix](https://sphinxsearch.com/), [Apache
Lucene](https://lucene.apache.org/), and [Xapian](https://xapian.org/)

5
app.rb
View file

@ -147,17 +147,14 @@ class Sidebar
end
$sidebar = Sidebar.new
$files_cache = {}
def pview(file)
body = ""
cont = File.read(file) or return "Not found"
if (file =~ /\.erb$/)
# We can't cache erb
tp = ERB.new(cont)
body = tp.result(binding)
elsif (file =~ /\.md$/)
# But we can cache markdown
body = ($files_cache[file] ||= $markdown.render cont)
body = $markdown.render cont
end
put_in_layout(body)
end

4
deploy
View file

@ -1,4 +0,0 @@
#!/usr/bin/sh
RUBY_YJIT_ENABLE=1 rackup