-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.php
113 lines (93 loc) · 4.31 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
return [
// Replace with the baseUrl of your site. For example, https://jigsaw-clean-blog.netlify.com
'baseUrl' => 'http://recipes.test/',
'production' => false,
'contactFormUrl' => 'https://formspree.io/f/mjvqjkvl',
'collections' => [
// Posts collection sorted by date and in descending order (latest post at the top)
'posts' => [
'path' => [
'web' => '/recipe/{filename}',
'api' => '/api/recipe/{filename}',
],
'sort' => '-date',
'api' => function ($page) {
return json_encode([
'title' => $page->title,
'link' => $page->getApiUrl(),
'date' => $page->date,
'excerpt' => $page->excerpt,
'subtitle' => $page->subtitle,
'thumbnail' => $page->getApiThumbnail(),
'body' => $page->getBody(),
'englishSearchTerm' => str_replace('-', ' ', $page->getFilename()),
'categories' => $page->categories ?? []
]);
},
]
],
// Number of collection items to show per page
'perPage' => 7,
// Number of links in the pagination section, should be a odd number greater than or equals to 3
'paginatationLinkNumber' => 5,
// The email address to send the https://formspree.io/ contact form submissions to
'email' => '[email protected]',
// The name of the site. This is used in the nav and footer
'siteName' => 'সহজ রেসিপি',
// The description of the site. This is used in for the site's default metadata
'siteDescription' => 'রান্না করা খুব কঠিন কোন কাজ না, আমি যেহেতু পারছি, পারবেন আপনিও...',
// The name of the site Author. Your name! This is used when building the rss feed
'siteAuthor' => 'মিলন',
// Social media links/icons that are used in the footer, add as many as you like!
'socials' => [
'twitter' => [
'link' => 'https://twitter.com/to_milon',
'icon' => 'fab fa-twitter',
],
'facebook' => [
'link' => 'https://www.facebook.com/sohoj.recipes',
'icon' => 'fab fa-facebook-f',
],
'rss' => [
'link' => '/feed.xml',
'icon' => 'fas fa-rss',
]
],
// Google Analytics Tracking Id. For example, UA-123456789-1
'gaTrackingId' => 'UA-162769200-1',
'getApiUrl' => function($page) {
return rightTrimPath($page->baseUrl) . "/api/recipe/{$page->getFilename()}.json";
},
'getApiThumbnail' => function($page) {
return rightTrimPath($page->baseUrl) . $page->metaImage;
},
'getBody' => function($page) {
return str_replace(
'/assets/images',
$page->baseUrl . '/assets/images',
$page->getContent()
);
},
'banglaDate' => function ($page, $date) {
// format date
$str = date("F j, Y", strtotime($date));
// translate number
$str = $page->translateNumber($str);
// translate day
$enDay = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
$enShortDay = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
$bnDay = ['জানুয়ারি', 'ফেব্রুয়ারি', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'];
$str = str_replace($enDay, $bnDay, $str);
return str_replace($enShortDay, $bnDay, $str);
},
'translateNumber' => function($page, $number) {
$enNum = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
$bnNum = ['০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯'];
return str_replace($enNum, $bnNum, $number);
},
'randomBackground' => function ($page) {
$random = rand(1, 10);
return "/assets/images/backgrounds/bg-$random.jpg";
},
];