Sha256: db9d99134a987f3782134583f6e8db189df45b012674f2dc19abc0d95bcde330

Contents?: true

Size: 994 Bytes

Versions: 15

Compression:

Stored size: 994 Bytes

Contents

# frozen_string_literal: true

say_status :turbo, "Installing Turbo..."

run("yarn add @hotwired/turbo")

say_status :turbo, 'Adding Turbo to "frontend/javascript/index.js"...', :magenta

javascript_import do
  <<~JS
    import * as Turbo from "@hotwired/turbo"

    // Uncomment the line below to add transition animations when Turbo navigates.
    // We recommend adding <meta name="turbo-cache-control" content="no-preview" />
    // to your HTML head if you turn on transitions. Use data-turbo-transition="false"
    // on your <main> element for pages where you don't want any transition animation.
    //
    // import "./turbo_transitions.js"
  JS
end

copy_file in_templates_dir("turbo_transitions.js"), "frontend/javascript/turbo_transitions.js"

say_status :turbo, "Turbo successfully added!", :magenta
say_status :turbo, "Take a look in your index.js file for optional animation setup.", :blue
say_status :turbo, 'For further reading, check out "https://turbo.hotwired.dev/"', :blue

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
bridgetown-core-1.3.0.beta1 lib/bridgetown-core/configurations/turbo.rb
bridgetown-core-1.2.0 lib/bridgetown-core/configurations/turbo.rb
bridgetown-core-1.2.0.beta5 lib/bridgetown-core/configurations/turbo.rb
bridgetown-core-1.2.0.beta4 lib/bridgetown-core/configurations/turbo.rb
bridgetown-core-1.2.0.beta3 lib/bridgetown-core/configurations/turbo.rb
bridgetown-core-1.2.0.beta2 lib/bridgetown-core/configurations/turbo.rb
bridgetown-core-1.2.0.beta1 lib/bridgetown-core/configurations/turbo.rb
bridgetown-core-1.1.0 lib/bridgetown-core/configurations/turbo.rb
bridgetown-core-1.1.0.beta3 lib/bridgetown-core/configurations/turbo.rb
bridgetown-core-1.1.0.beta2 lib/bridgetown-core/configurations/turbo.rb
bridgetown-core-1.1.0.beta1 lib/bridgetown-core/configurations/turbo.rb
bridgetown-core-1.0.0 lib/bridgetown-core/configurations/turbo.rb
bridgetown-core-1.0.0.beta3 lib/bridgetown-core/configurations/turbo.rb
bridgetown-core-1.0.0.beta2 lib/bridgetown-core/configurations/turbo.rb
bridgetown-core-1.0.0.beta1 lib/bridgetown-core/configurations/turbo.rb