50 lines
1.2 KiB
Ruby
50 lines
1.2 KiB
Ruby
require "roda"
|
|
|
|
require_relative "config/mail"
|
|
require_relative "lib/contact_form"
|
|
require_relative "lib/contact_mailer"
|
|
require_relative "lib/document_renderer"
|
|
|
|
class Netig < Roda
|
|
plugin :render, escape: true
|
|
plugin :public
|
|
plugin :default_headers, "Content-Type" => "text/html; charset=utf-8"
|
|
plugin :sessions, secret: ENV.fetch("SESSION_SECRET")
|
|
plugin :route_csrf, csrf_failure: :empty_403
|
|
plugin :hash_branches
|
|
plugin :flash
|
|
|
|
require_relative "routes/contact"
|
|
|
|
route do |r|
|
|
r.public
|
|
check_csrf!
|
|
r.hash_branches
|
|
|
|
r.root do
|
|
@canonical_url = "https://netig.net/"
|
|
view "index"
|
|
end
|
|
|
|
r.get "statutes" do
|
|
@page_title = "Statuts — NETig"
|
|
@page_description = "Statuts de l'association NETig."
|
|
@canonical_url = "https://netig.net/statutes"
|
|
|
|
@document_html = DocumentRenderer.render(:statutes)
|
|
|
|
view "document"
|
|
end
|
|
|
|
r.get "legal" do
|
|
@page_title = "Mentions légales — NETig"
|
|
@page_description = "Mentions légales de l'association NETig."
|
|
@canonical_url = "https://netig.net/legal"
|
|
|
|
@document_html = DocumentRenderer.render(:legal)
|
|
|
|
view "document"
|
|
end
|
|
end
|
|
end
|