site_template/app/views/layouts/head.rb in staticky-0.2.0 vs site_template/app/views/layouts/head.rb in staticky-0.3.0
- old
+ new
@@ -1,9 +1,9 @@
# frozen_string_literal: true
module Layouts
- class Head < Component
+ class Head < ApplicationComponent
option :title, default: -> { ::Site.title }, reader: false
option :description, default: -> { ::Site.description }, reader: false
def view_template
head do
@@ -42,13 +42,15 @@
meta property: "twitter:title", content: ::Site.title
meta name: "twitter:card", content: "summary"
meta name: "twitter:site", content: ::Site.twitter
meta name: "twitter:creator", content: ::Site.twitter
- vite_client_tag unless ENV["RACK_ENV"] == "production"
javascript_tag "application"
- yield if block_given?
+ if Staticky.env.development?
+ vite_client_tag
+ staticky_live_reload_js if Staticky.config.live_reloading
+ end
end
end
private