5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-05-17 04:40:48 +00:00

feat: agregar una descripción corta a la licencia

que es lo que usan las plantillas como aviso de licencia
This commit is contained in:
f 2023-03-25 13:46:30 -03:00
parent d01f4ae5e2
commit 42b2549f09
3 changed files with 23 additions and 1 deletions

View file

@ -113,7 +113,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
slug: Jekyll::Utils.slugify(I18n.t('activerecord.models.licencia')),
lang: lang,
title: site.licencia.name,
description: site.licencia.description,
description: site.licencia.short_description,
content: CommonMarker.render_html(site.licencia.deed)
}
)

View file

@ -0,0 +1,16 @@
# frozen_string_literal: true
# Agrega descripciones cortas a las licencias
class AddShortDescriptionToLicencias < ActiveRecord::Migration[6.1]
def up
add_column :licencias, :short_description, :string
YAML.safe_load_file('db/seeds/licencias.yml').each do |licencia|
Licencia.find_by_icons(licencia['icons']).update licencia
end
end
def down
remove_column :licencias, :short_description
end
end

View file

@ -1,6 +1,8 @@
---
- name_en: 'Peer Production License'
name_es: 'Licencia de Producción de Pares'
short_description_en: "This work is licensed under a Peer Production License"
short_description_es: "Esta obra está bajo una Licencia de Producción de Pares"
icons: "/images/ppl.png"
url_en: 'https://wiki.p2pfoundation.net/Peer_Production_License'
url_es: 'https://endefensadelsl.org/ppl_es.html'
@ -100,6 +102,8 @@
hacerlo es enlazar a esta página.
- icons: "/images/by.png"
short_description_en: "This work is licensed under a Creative Commons Attribution 4.0 International License."
short_description_es: "Esta obra está bajo una Licencia Creative Commons Atribución 4.0 Internacional."
name_en: 'Creative Commons Attribution 4.0 International (CC BY 4.0)'
description_en: "This license gives everyone the freedom to use,
adapt, and redistribute the contents of your site by requiring
@ -194,6 +198,8 @@
- icons: "/images/sa.png"
name_en: "Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)"
name_es: "Creative Commons Atribución-CompartirIgual 4.0 Internacional (CC BY-SA 4.0)"
short_description_en: "This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License."
short_description_es: "Esta obra está bajo una Licencia Creative Commons Atribución-CompartirIgual 4.0 Internacional."
url_en: 'https://creativecommons.org/licenses/by-sa/4.0/'
url_es: 'https://creativecommons.org/licenses/by-sa/4.0/deed.es'
description_en: "This license is the same as the CC-BY 4.0 but it adds