add nanoc-related files

This commit is contained in:
0x1eef 2022-10-31 15:32:08 -03:00
parent 8c4646ca5b
commit d948a12453
2 changed files with 76 additions and 0 deletions

49
Rules Normal file
View file

@ -0,0 +1,49 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
LOCALES = %w[ar en]
##
# /<locale>/<surahno>/index.html
compile "/surah.html" do
1.upto(114) do |surahno|
LOCALES.each { write(File.join("/", _1, surahno.to_s, "index.html")) }
end
end
##
# /<locale>/<surahno>/surah.json
1.upto(114) do |surahno|
LOCALES.each { passthrough "/#{_1}/#{surahno}/surah.json" }
end
##
# /js/main.js
compile "/js/pages/TheSurahPage.tsx" do
filter :webpack, exe: "./node_modules/webpack/bin/webpack.js"
write "/js/pages/surah.js"
end
##
# CSS
compile("/css/_*.scss") { write(nil) }
compile "/css/*.scss" do
filter :sass, syntax: :scss, style: :compact
filter :rainpress
write item.identifier.without_ext + ".css"
end
##
# Fonts
compile "/fonts/*" do
write(item.identifier.to_s)
end
##
# Images
compile "/images/*" do
write(item.identifier.to_s)
end
compile("/**/*") { write(nil) }
layout('**/*', :erb)

27
nanoc.yaml Normal file
View file

@ -0,0 +1,27 @@
# A list of file extensions that Nanoc will consider to be textual rather than
# binary. If an item with an extension not in this list is found, the file
# will be considered as binary.
text_extensions: [
'adoc', 'asciidoc', 'atom', 'coffee', 'css', 'erb', 'haml',
'handlebars', 'hb', 'htm', 'html', 'js', 'less', 'markdown',
'md', 'ms', 'mustache', 'php', 'rb', 'rdoc', 'sass', 'scss',
'slim', 'tex', 'txt', 'xhtml', 'xml', 'tsx'
]
prune:
auto_prune: true
output_dir: build/al-quran/
data_sources:
- type: filesystem
encoding: utf-8
content_dir: src/
layouts_dir: src/layouts
deploy:
local:
user: www
group: www
src: build/al-quran/.
dest: /var/www/htdocs/al-quran.0x1eef.test/