5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 08:26:23 +00:00

archivos faltantes :$

This commit is contained in:
f 2020-05-26 19:26:19 -03:00
parent 6b03f71e53
commit 0af59fa625
5 changed files with 48 additions and 0 deletions

1
.gitignore vendored
View file

@ -25,6 +25,7 @@
/_sites/*
/_deploy/*
/data/*
/_storage/*
.env

View file

@ -0,0 +1,27 @@
# frozen_string_literal: true
# Los valores de este metadato son artículos en otros idiomas
class MetadataLocales < MetadataTemplate
def default_value
[]
end
# Todos los valores posibles para cada idioma disponible
#
# TODO: Optimizar?
#
# @return { lang: { title: uuid } }
def values
@values ||= site.locales.map do |locale|
{
locale.to_sym => site.posts(lang: locale).map do |post|
{ post.title.value => post.uuid.value }
end.inject(:merge)
}
end.inject(:merge)
end
def to_param
{ name => [] }
end
end

View file

@ -0,0 +1,3 @@
# frozen_string_literal: true
class MetadataMarkdown < MetadataText; end

View file

@ -0,0 +1,9 @@
# frozen_string_literal: true
class MetadataMarkdownContent < MetadataContent
# Renderizar a HTML
def to_s
CommonMarker.render_doc(value, %i[FOOTNOTES SMART],
%i[table strikethrough autolink]).to_html
end
end

View file

@ -0,0 +1,8 @@
.form-group.markdown-content
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
= text_area_tag "post[#{attribute}]", metadata.value,
dir: dir, lang: locale,
**field_options(attribute, metadata, class: 'content')
.editor.mt-1
= render 'posts/attribute_feedback',
post: post, attribute: attribute, metadata: metadata