mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 01:21:42 +00:00
el id del sitio puede contener puntos
This commit is contained in:
parent
b3a7e3c2ea
commit
4c50eb786e
2 changed files with 4 additions and 9 deletions
|
@ -56,20 +56,15 @@ class Site
|
|||
|
||||
# Obtener el nombre del sitio
|
||||
def name
|
||||
@name ||= @jekyll.config['source'].split('/').last
|
||||
@name ||= File.basename(@jekyll.config['source'])
|
||||
end
|
||||
alias :id :name
|
||||
alias :to_s :name
|
||||
|
||||
def name_with_i18n(lang)
|
||||
[name, lang].join('/')
|
||||
end
|
||||
|
||||
# El id es el sitio sin puntos, para no confundir al routeador de
|
||||
# rails
|
||||
def id
|
||||
@id ||= name.tr('.', '-')
|
||||
end
|
||||
alias :to_s :id
|
||||
|
||||
def read
|
||||
@jekyll.read
|
||||
end
|
||||
|
|
|
@ -9,7 +9,7 @@ Rails.application.routes.draw do
|
|||
|
||||
get '/sites/:site_id/public/:type/:basename', to: 'sites#send_public_file'
|
||||
|
||||
resources :sites, only: [ :index, :show ] do
|
||||
resources :sites, only: [:index, :show], constraints: { site_id: /[^\/]+/, id: /[^\/]+/ } do
|
||||
resources :posts
|
||||
resources :templates
|
||||
|
||||
|
|
Loading…
Reference in a new issue