commit ecad77fcc146c283940fd8ac8f56472c3170ed63
parent 7bccc5a7bf5abd5d21f9afd1a2031cf49a376972
Author: Hugo Soucy <hugo@soucy.cc>
Date: Wed, 21 Apr 2021 20:50:03 -0400
Add a method to test if a file is a html
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/satelito/file.lua b/satelito/file.lua
@@ -94,6 +94,11 @@ function file.is_markdown(filepath)
return (mimetypes.guess(filepath) == 'text/x-markdown')
end
+-- Check if the file is HTML
+function file.is_html(filepath)
+ return (mimetypes.guess(filepath) == 'text/html')
+end
+
-- Check if the file is index.md
function file.is_index(filepath)
return (file.get_basename(filepath) == 'index.md')