From f5abdcbfb4c38a864399375f56ab7acf7eb0fee0 Mon Sep 17 00:00:00 2001 From: Ahad Birang Date: Thu, 19 Sep 2019 17:12:44 +0430 Subject: [PATCH] fix: do not add `.amp` posix to page layout BREAKING CHANGE: with introducing `ampLayout` there no need to force '.amp` posix foa layouts. --- lib/amp/plugin.js | 2 +- test/plugin.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/amp/plugin.js b/lib/amp/plugin.js index 99740f79..c173f225 100644 --- a/lib/amp/plugin.js +++ b/lib/amp/plugin.js @@ -153,5 +153,5 @@ const createCustomLayout = (originalLayout, ampLayout) => function customLayout if (typeof layout === 'function') { layout = layout.call(this, ctx) } - return ctx.app.$isAMP ? layout + '.amp' : layout + return layout } diff --git a/test/plugin.test.js b/test/plugin.test.js index af996285..2f16c88d 100644 --- a/test/plugin.test.js +++ b/test/plugin.test.js @@ -95,7 +95,7 @@ describe('Plugin', () => { return 'custom.amp.layout' } Plugin.default(ctx, inject) - expect(route.matched[0].components.default.options.layout(ctx)).toEqual('custom.amp.layout.amp') + expect(route.matched[0].components.default.options.layout(ctx)).toEqual('custom.amp.layout') }) it('Evaluate layout option (non AMP)', () => {