jekyll-s3-yearofmoo 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
@@ -71,12 +71,24 @@ cloudfront_distribution_id: YOUR_CLOUDFRONT_DIST_ID (OPTIONAL)
|
|
71
71
|
paths
|
72
72
|
end
|
73
73
|
|
74
|
+
def find_matching_content_type(file)
|
75
|
+
ext = File.extname(file).downcase
|
76
|
+
if ext == '.html' || ext == '.xview'
|
77
|
+
return 'text/html'
|
78
|
+
end
|
79
|
+
return nil
|
80
|
+
end
|
81
|
+
|
74
82
|
def customize_file_metadata(file)
|
75
83
|
data = { :access => 'public-read' }
|
76
84
|
expiry = find_matching_expires_header(file)
|
77
85
|
if expiry
|
78
86
|
data[:expires] = expiry
|
79
87
|
end
|
88
|
+
content_type = find_matching_content_type(file)
|
89
|
+
if content_type
|
90
|
+
data['Content-Type'] = content_type
|
91
|
+
end
|
80
92
|
data
|
81
93
|
end
|
82
94
|
|