mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 12:41:41 +00:00
Merge branch 'issue-14946' into 'rails'
Issue 14946 See merge request sutty/sutty!236
This commit is contained in:
commit
2c35ffe502
1 changed files with 9 additions and 1 deletions
|
@ -6,7 +6,7 @@ class MetadataPath < MetadataTemplate
|
|||
#
|
||||
# @return [String]
|
||||
def default_value
|
||||
File.join(site.path, "_#{lang}", "#{date}-#{slug}#{ext}")
|
||||
File.join(site.path, "_#{lang}", "#{limited_name}#{ext}")
|
||||
end
|
||||
|
||||
# La ruta del archivo según Jekyll
|
||||
|
@ -46,4 +46,12 @@ class MetadataPath < MetadataTemplate
|
|||
def date
|
||||
post.date.value.strftime('%F')
|
||||
end
|
||||
|
||||
# Limita el nombre de archivo a 255 bytes, de forma que siempre
|
||||
# podemos guardarlo
|
||||
#
|
||||
# @return [String]
|
||||
def limited_name
|
||||
"#{date}-#{slug}".mb_chars.limit(255 - ext.length)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue