From efca683b6ff330acf19523f873d5da2151b56a9b Mon Sep 17 00:00:00 2001 From: Laurence de Bruxelles Date: Wed, 17 Aug 2022 15:08:15 +0100 Subject: [PATCH] Add deprecation warning for govuk_assets_path Setting govuk_assets_path should no longer be necessary, and to keep the code simple it will no longer have any effect. This commit lets users know about this change in case it causes them some surprise. --- lib/govuk_tech_docs.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/govuk_tech_docs.rb b/lib/govuk_tech_docs.rb index 4cacd978..8c2f2752 100644 --- a/lib/govuk_tech_docs.rb +++ b/lib/govuk_tech_docs.rb @@ -24,12 +24,24 @@ require "govuk_tech_docs/api_reference/api_reference_extension" module GovukTechDocs + class GovukTechDocsExtension < Middleman::Extension + def after_configuration + if app.config[:govuk_assets_path] + warn "Warning: setting govuk_assets_path in config.rb is no longer necessary, and will have no effect." + end + end + end + + ::Middleman::Extensions.register(:govuk_tech_docs, GovukTechDocsExtension) + # Configure the tech docs template # # @param options [Hash] # @option options [Hash] livereload Options to pass to the `livereload` # extension. Hash with symbols as keys. def self.configure(context, options = {}) + context.activate :govuk_tech_docs + context.activate :sprockets context.sprockets.append_path File.join(__dir__, "../node_modules/govuk-frontend/")