add metadata to pdf

This commit is contained in:
simon lehericey 2024-03-07 11:56:16 +01:00
parent 77744f510e
commit 76f7222e7a
2 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,14 @@
- content_for :title, @title
- content_for :authors do
- @authors&.map do |author|
%meta{ name: 'author', content: author }
- content_for :description do
- if @description.present?
%meta{ name: 'description', content: @description }
- content_for :keywords do
- @keywords&.map do |keyword|
%meta{ name: 'keywords', content: keyword }
.a4-container{ class: class_names("official-layout": @attestation_template.official_layout?) }
.content
%header.first-header

View file

@ -1,6 +1,12 @@
%html
%html{ lang: 'fr' }
%head
= stylesheet_link_tag 'attestation', media: 'all'
%title= content_for?(:title) ? yield(:title) : 'Attestation'
= yield(:authors)
= yield(:keywords)
= yield(:description)
%meta{ name: 'generator', content: ENV.fetch('APP_HOST') }
%meta{ name: 'dcterms.created', content: Time.zone.now.iso8601 }
%body#attestation
= yield