mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 13:31:42 +00:00
agregar modo de slugificación en el sitio
This commit is contained in:
parent
9dee10bcb9
commit
bfeb513b6b
2 changed files with 9 additions and 1 deletions
|
@ -25,7 +25,7 @@ require 'jekyll/utils'
|
|||
class MetadataSlug < MetadataTemplate
|
||||
# Trae el slug desde el título si existe o una string al azar
|
||||
def default_value
|
||||
title ? Jekyll::Utils.slugify(title) : SecureRandom.uuid
|
||||
title ? Jekyll::Utils.slugify(title, mode: site.slugify_mode) : SecureRandom.uuid
|
||||
end
|
||||
|
||||
def value
|
||||
|
|
8
db/migrate/20220428135113_add_slugify_mode_to_sites.rb
Normal file
8
db/migrate/20220428135113_add_slugify_mode_to_sites.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Permite a los sitios elegir el método de slugificación
|
||||
class AddSlugifyModeToSites < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :sites, :slugify_mode, :string, default: 'default'
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue