2
.bundle/config
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
---
|
||||||
|
BUNDLE_PATH: ".localgems"
|
2
.gitignore
vendored
|
@ -1,7 +1,7 @@
|
||||||
build/
|
build/
|
||||||
tmp/
|
tmp/
|
||||||
node_modules/
|
node_modules/
|
||||||
.bundle/
|
.localgems/
|
||||||
*.log
|
*.log
|
||||||
.env
|
.env
|
||||||
.idea
|
.idea
|
||||||
|
|
|
@ -177,4 +177,4 @@ DEPENDENCIES
|
||||||
test-cmd.rb (~> 0.3)!
|
test-cmd.rb (~> 0.3)!
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.3.26
|
2.4.10
|
||||||
|
|
|
@ -32,5 +32,12 @@ module Helper
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def erb(partial, local_assigns = {})
|
||||||
|
erb = File.binread File.join(Dir.getwd, "src", "html", "partials", partial)
|
||||||
|
scope = binding
|
||||||
|
local_assigns.each { scope.local_variable_set(_1, _2) }
|
||||||
|
ERB.new(erb).result(scope)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
use_helper Helper
|
use_helper Helper
|
||||||
|
|
19
nanoc/lib/mixins/opengraph.rb
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
use_helper Module.new {
|
||||||
|
require_relative "helper"
|
||||||
|
include Helper
|
||||||
|
|
||||||
|
def opengraph(locale, basename, options = {})
|
||||||
|
erb "opengraph.html.erb", local_assigns(locale, basename, options)
|
||||||
|
end
|
||||||
|
|
||||||
|
def local_assigns(locale, basename, options)
|
||||||
|
case basename
|
||||||
|
when "stream.html.erb"
|
||||||
|
surah_id = options[:surah_id]
|
||||||
|
{ title: t(locale, "TheNobleQuran"),
|
||||||
|
description: t(locale, "meta.stream.description"),
|
||||||
|
url: "https://al-quran.reflectslight.io/#{locale}/#{surah_id}/",
|
||||||
|
image: "https://al-quran.reflectslight.io/images/opengraph/#{surah_id}.png" }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
|
@ -23,3 +23,7 @@ end
|
||||||
compile "/favicon.png" do
|
compile "/favicon.png" do
|
||||||
write(item.identifier.to_s)
|
write(item.identifier.to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
compile "/images/opengraph/*.png" do
|
||||||
|
write(item.identifier.to_s)
|
||||||
|
end
|
||||||
|
|
|
@ -2,11 +2,12 @@
|
||||||
<html lang="<%= locale %>">
|
<html lang="<%= locale %>">
|
||||||
<head>
|
<head>
|
||||||
<title> <%= t(locale, "TheNobleQuran") %>: <%= surah_name %> </title>
|
<title> <%= t(locale, "TheNobleQuran") %>: <%= surah_name %> </title>
|
||||||
|
<%= inline_css('/css/postman.css') %>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="description" content="<%= t(locale, 'meta.stream.description', {surah_name:}) %>">
|
<meta name="description" content="<%= t(locale, 'meta.stream.description') %>">
|
||||||
|
<%= opengraph(locale, "stream.html.erb", {surah_id:}) %>
|
||||||
<link rel="icon" href="/favicon.png">
|
<link rel="icon" href="/favicon.png">
|
||||||
<%= inline_css('/css/postman.css') %>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="postman loader">
|
<div class="postman loader">
|
||||||
|
|
6
src/html/partials/opengraph.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<meta property="og:type" content="website"/>
|
||||||
|
<meta property="og:title" content="<%= title %>"/>
|
||||||
|
<meta property="og:description" content="<%= description %>"/>
|
||||||
|
<meta property="og:url" content="<%= url %>"/>
|
||||||
|
<meta property="og:image" content="<%= image %>"
|
||||||
|
<meta property="og:image:type" content="image/png"/>
|
|
@ -7,7 +7,7 @@
|
||||||
"comma": ",",
|
"comma": ",",
|
||||||
"meta": {
|
"meta": {
|
||||||
"index": {"description": "Read and listen to The Noble Quran."},
|
"index": {"description": "Read and listen to The Noble Quran."},
|
||||||
"stream": {"description": "Read and listen to '%{surah_name}' from The Noble Quran."}
|
"stream": {"description": "Read and listen to The Noble Quran."}
|
||||||
},
|
},
|
||||||
"surahs": {
|
"surahs": {
|
||||||
"names": [
|
"names": [
|
||||||
|
@ -135,8 +135,8 @@
|
||||||
"ayah": "آية",
|
"ayah": "آية",
|
||||||
"comma": "،",
|
"comma": "،",
|
||||||
"meta": {
|
"meta": {
|
||||||
"index": {"description": "اقرأ واستمع إلى القرآن الكريم."},
|
"index": {"description": "اقرأ واستمع إلى القرآن الكريم"},
|
||||||
"stream": {"description": "اقرأ واستمع إلى القرآن الكريم - '%{surah_name}'."}
|
"stream": {"description": "اقرأ واستمع إلى القرآن الكريم"}
|
||||||
},
|
},
|
||||||
"surahs": {
|
"surahs": {
|
||||||
"names": [
|
"names": [
|
||||||
|
|
BIN
src/images/opengraph/1.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
src/images/opengraph/10.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/100.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/101.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/102.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
src/images/opengraph/103.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/104.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
src/images/opengraph/105.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
src/images/opengraph/106.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
src/images/opengraph/107.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/108.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/109.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
src/images/opengraph/11.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
src/images/opengraph/110.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
src/images/opengraph/111.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/112.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
src/images/opengraph/113.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/114.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
src/images/opengraph/12.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
src/images/opengraph/13.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
src/images/opengraph/14.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
src/images/opengraph/15.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/16.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/17.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
src/images/opengraph/18.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/19.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/2.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
src/images/opengraph/20.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/21.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/22.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/23.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
src/images/opengraph/24.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
src/images/opengraph/25.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
src/images/opengraph/26.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
src/images/opengraph/27.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/28.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/29.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/3.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/30.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/31.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/32.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/33.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
src/images/opengraph/34.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/35.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
src/images/opengraph/36.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
src/images/opengraph/37.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/38.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
src/images/opengraph/39.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/4.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/40.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
src/images/opengraph/41.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
src/images/opengraph/42.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/43.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
src/images/opengraph/44.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/45.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
src/images/opengraph/46.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/47.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/48.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/49.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/5.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/50.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
src/images/opengraph/51.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/52.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/53.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
src/images/opengraph/54.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
src/images/opengraph/55.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
src/images/opengraph/56.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/57.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
src/images/opengraph/58.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/59.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/6.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
src/images/opengraph/60.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/61.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/62.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
src/images/opengraph/63.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/64.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/65.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/66.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
src/images/opengraph/67.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
src/images/opengraph/68.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
src/images/opengraph/69.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/7.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
src/images/opengraph/70.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
src/images/opengraph/71.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
src/images/opengraph/72.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/73.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
src/images/opengraph/74.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/images/opengraph/75.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
src/images/opengraph/76.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
src/images/opengraph/77.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/images/opengraph/78.png
Normal file
After Width: | Height: | Size: 28 KiB |