mostrar texto al comienzo y al final de la ficha

This commit is contained in:
f 2018-12-11 14:20:13 -03:00
parent 4c0f2c7ba3
commit 3998ddc5c6
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
2 changed files with 5 additions and 1 deletions

View file

@ -22,7 +22,7 @@ class Post
# datos que no tienen que terminar en el front matter
REJECT_FROM_FRONT_MATTER = %w[date slug ext].freeze
# datos que no traemos del template
REJECT_FROM_TEMPLATE = %w[draft categories layout title ext tags date slug].freeze
REJECT_FROM_TEMPLATE = %w[draft categories layout title ext tags date slug post pre].freeze
DEFAULT_PARAMS = [:title, :date, :content, :slug, :cover,
:layout, :permalink, :dir,
{ lang: {} }, { tags: [] }, { categories: [] }]

View file

@ -17,6 +17,8 @@
- else
- url = site_post_path(@site, @post, lang: @lang)
- method = :patch
- if pre = @post.template.get_front_matter('pre')
= render 'layouts/help', help: CommonMarker.render_doc(pre).to_html
= form_tag url, method: method, class: 'form', novalidate: true, multipart: true do
= hidden_field_tag 'template', params[:template]
.form-group
@ -123,3 +125,5 @@
.invalid-feedback= t('posts.invalid')
.form-group
= submit_tag t('posts.save'), class: 'btn btn-success submit-post'
- if post = @post.template.get_front_matter('post')
= render 'layouts/help', help: CommonMarker.render_doc(post).to_html