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