Compare commits
No commits in common. "f0e0bf16dabdece3c26aea13da5abcd56fafbfbb" and "50152e4abf8bf5d12deae30b56ed3943a02f59da" have entirely different histories.
f0e0bf16da
...
50152e4abf
3 changed files with 2 additions and 22 deletions
15
README.md
15
README.md
|
@ -1,16 +1,3 @@
|
||||||
# perc
|
# perc
|
||||||
|
|
||||||
Better Werc
|
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
5
app.rb
|
@ -147,17 +147,14 @@ class Sidebar
|
||||||
end
|
end
|
||||||
|
|
||||||
$sidebar = Sidebar.new
|
$sidebar = Sidebar.new
|
||||||
$files_cache = {}
|
|
||||||
def pview(file)
|
def pview(file)
|
||||||
body = ""
|
body = ""
|
||||||
cont = File.read(file) or return "Not found"
|
cont = File.read(file) or return "Not found"
|
||||||
if (file =~ /\.erb$/)
|
if (file =~ /\.erb$/)
|
||||||
# We can't cache erb
|
|
||||||
tp = ERB.new(cont)
|
tp = ERB.new(cont)
|
||||||
body = tp.result(binding)
|
body = tp.result(binding)
|
||||||
elsif (file =~ /\.md$/)
|
elsif (file =~ /\.md$/)
|
||||||
# But we can cache markdown
|
body = $markdown.render cont
|
||||||
body = ($files_cache[file] ||= $markdown.render cont)
|
|
||||||
end
|
end
|
||||||
put_in_layout(body)
|
put_in_layout(body)
|
||||||
end
|
end
|
||||||
|
|
4
deploy
4
deploy
|
@ -1,4 +0,0 @@
|
||||||
#!/usr/bin/sh
|
|
||||||
|
|
||||||
|
|
||||||
RUBY_YJIT_ENABLE=1 rackup
|
|
Loading…
Add table
Add a link
Reference in a new issue