improve seo tagging, update nginx config file
This commit is contained in:
@@ -121,7 +121,7 @@ class Post < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def seo_tags
|
def seo_tags
|
||||||
@seo_tags ||= humanized_essential_tag_string.gsub(/[^a-z0-9]+/, "-").gsub(/(^-+)|(-+$)/, "")
|
@seo_tags ||= humanized_essential_tag_string.gsub(/[^a-z0-9]+/, "-").gsub(/(?:^-+)|(?:-+$)/, "").gsub(/-{2,}/, "-")
|
||||||
end
|
end
|
||||||
|
|
||||||
def preview_file_url
|
def preview_file_url
|
||||||
|
|||||||
@@ -396,6 +396,7 @@ module Danbooru
|
|||||||
def addthis_key
|
def addthis_key
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# include essential tags in image urls (requires nginx/apache rewrites)
|
||||||
def enable_seo_post_urls
|
def enable_seo_post_urls
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,11 +14,17 @@ server {
|
|||||||
expires max;
|
expires max;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#location /ssd {
|
||||||
|
# rewrite ^/ssd(.*)$ $1;
|
||||||
|
#}
|
||||||
location /data {
|
location /data {
|
||||||
valid_referers none __hostname__;
|
# if you want to block hotlinking
|
||||||
|
# valid_referers none __hostname__ ~\.google\. ~\.bing\. ~\.yahoo\.;
|
||||||
if ($invalid_referer) {
|
if ($invalid_referer) {
|
||||||
return 403;
|
return 403;
|
||||||
}
|
}
|
||||||
|
rewrite ^/data/sample/--.+?--(.+) /data/sample/$1 last;
|
||||||
|
rewrite ^/data/--.+?--(.+) /data/$1 last;
|
||||||
expires max;
|
expires max;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user