/
config.rb
132 lines (108 loc) · 3.78 KB
/
config.rb
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
require 'uglifier'
require 'time'
require 'active_support/all'
activate :i18n
Time.zone = 'Europe/Istanbul'
helpers ActiveSupport::NumberHelper
helpers ActiveSupport::Inflector
activate :syntax
set :markdown_engine, :redcarpet
set :markdown, fenced_code_blocks: true,
smartypants: true,
tables: true,
autolink: true,
strikethrough: true,
superscript: true,
highlight: true,
footnotes: true,
quote: true,
underline: true
config[:js_dir] = 'public/js'
config[:css_dir] = 'public/css'
config[:images_dir] = 'public/images'
config[:site_url] = 'https://ugur.ozyilmazel.com'
config[:meta_author_name] = 'Uğur “vigo” Özyılmazel'
set :meta_description, {
tr: "Kişisel blogum.",
en: "My personal blog.",
}
activate :autoprefixer do |prefix|
prefix.browsers = "last 2 versions"
end
set :date_format_long, {
tr: "%d %B %Y, %A %H:%M",
en: "%A, %B %-d, %Y, %-I:%M %p",
}
set :date_format_short, {
tr: "%d %B %Y, %A",
en: "%A, %B %-d, %Y",
}
page '/*.xml', layout: false
page '/*.json', layout: false
page '/*.txt', layout: false
# With alternative layout
# page '/path/to/file.html', layout: 'other_layout'
# Helpers
# Methods defined in the helpers block are available in templates
# https://middlemanapp.com/basics/helper-methods/
# helpers do
# def some_helper
# 'Helping'
# end
# end
# Proxy pages
# https://middlemanapp.com/advanced/dynamic-pages/
# proxy(
# '/this-page-has-no-template.html',
# '/template-file.html',
# locals: {
# which_fake_page: 'Rendering a fake page with a local variable'
# },
# )
proxy "/blog/tr/index.html", "/pages/tr/blog-index.html", locals: {locale: "tr"}, ignore: true
proxy '/blog/en/index.html', '/pages/en/blog-index.html', locals: {locale: "en"}, ignore: true
proxy "/sayfa/tr/sunumlar/index.html", "/pages/tr/sunumlar.html", locals: {locale: "tr"}, ignore: true
proxy "/en/index.html", "/pages/en/index.html", locals: {locale: "en"}, ignore: true
proxy "/page/en/about/index.html", "/pages/en/about.html", locals: {locale: "en"}, ignore: true
activate :blog do |blog|
blog.name = "turkish"
blog.prefix = "blog/tr/"
blog.permalink = "{year}/{month}/{day}/{title}/index.html"
blog.sources = "{year}-{month}-{day}-{title}.html"
blog.taglink = "etiket/{tag}/index.html"
blog.year_link = "yil/{year}/index.html"
blog.paginate = true
blog.per_page = 10
blog.page_link = "sayfa/{num}"
blog.summary_separator = /READ_MORE/
blog.summary_length = nil
blog.layout = "tr/layout-blog-detail"
blog.tag_template = "templates/tr/blog-tag.html"
blog.calendar_template = "templates/tr/blog-calendar.html"
end
activate :blog do |blog|
blog.name = "english"
blog.prefix = "blog/en/"
blog.permalink = "{year}/{month}/{day}/{title}/index.html"
blog.sources = "{year}-{month}-{day}-{title}.html"
blog.taglink = "tag/{tag}/index.html"
blog.year_link = "year/{year}/index.html"
blog.paginate = true
blog.per_page = 10
blog.page_link = "page/{num}"
blog.summary_separator = /READ_MORE/
blog.summary_length = nil
blog.layout = "en/layout-blog-detail"
blog.tag_template = "templates/en/blog-tag.html"
blog.calendar_template = "templates/en/blog-calendar.html"
end
activate :directory_indexes
page "/blog/tr/feed.xml", layout: false
page "/blog/en/feed.xml", layout: false
configure :build do
activate :minify_css
activate :minify_javascript, compressor: -> { Uglifier.new(:mangle => false, :harmony => true) }
end
configure :development do
activate :livereload, host: '127.0.0.1'
end