From e0aa635aec7af254e5f638043c1b57273005c30e Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 17 May 2023 17:01:47 -0500 Subject: [PATCH] Website: Update landing-page generator & /imagine/higher-education (#11751) Changes: - Updated the landing page generator to generate a new .ejs file using the `generateFile()` method instead of using a page template so we can be sure that every landing page generated will have `<%- /* Expose server-rendered data as window.SAILS_LOCALS :: */ exposeLocalsToBrowser() %>`. - Updated /imagine/higher-education to have a `SAILS_LOCALS` variable. --- website/generators/landing-page/index.js | 112 +++++++++++++++++- .../landing-page/templates/page.ejs.template | 100 ---------------- .../views/pages/imagine/higher-education.ejs | 2 +- 3 files changed, 111 insertions(+), 103 deletions(-) delete mode 100644 website/generators/landing-page/templates/page.ejs.template diff --git a/website/generators/landing-page/index.js b/website/generators/landing-page/index.js index ea80187b4c..93d0473279 100644 --- a/website/generators/landing-page/index.js +++ b/website/generators/landing-page/index.js @@ -4,7 +4,7 @@ var path = require('path'); var _ = require('@sailshq/lodash'); -// var generateFile = require('./node_modules/sails-generate/builtins/file'); +var generateFile = require('../../node_modules/sails-generate/lib/builtins/file'); /** * @eashaw/sails-generate-landing-page @@ -162,7 +162,115 @@ module.exports = { targets: { './': ['action'],// << Use underlying default generator - './:newViewRelPath': { template: 'page.ejs.template' }, + './:newViewRelPath': { + exec: function(scope, done){ + return generateFile({ + rootPath: scope.rootPath, + force: scope.force, + contents: +`
+ +
+ +
+
+

A magni, recusandae qui omnis in quod?

+

${_.capitalize(scope.stem.replace(/\-/gim, ' '))}

+

Vitae architecto reiciendis in temporibus consequatur doloremque reprehenderit perferendis? Eaque quod voluptates earum corporis, quo labore reprehenderit libero sint.

+ +
+
+ +
+ +
+
+
+

Culpa ab maiores alias ut, non.

+

Do vero et, voluptatem fugiat consequatur? totam ut dolores ut velit! Sapiente et quasi et voluptas et doloribus quaerat minima saepe enim?

+
+

Necessitatibus qui harum non dolore a quis!

+

Mollitia ipsum dicta hic quidem aut debitis qui iusto.

+

Esse dolor animi nostrum quidem expedita.

+
+
+
+ ${scope.stem} feature image +
+
+ +
+
+ ${scope.stem} feature image +
+
+

Doloribus natus nihil alias earum, eius ducimus.

+

Laboriosam iusto magnam suscipit quasi ut quod, non, exercitationem. Enim aut consectetur repellat nihil pariatur? blanditiis.

+
+

Necessitatibus qui harum non dolore a quis!

+

Mollitia ipsum dicta hic quidem aut debitis qui iusto.

+

Esse dolor animi nostrum quidem expedita.

+
+
+
+ +
+
+

Ex, illum voluptates impedit nulla, et sunt cupiditate quas illo mollitia pariatur?? Tempora et delectus ut atque vel eaque optio, inventore.

+

Similique ea provident ducimus nulla ea debitis sequi nihil.

+
+

Necessitatibus qui harum non dolore a quis!

+

Mollitia ipsum dicta hic quidem aut debitis qui iusto.

+

Esse dolor animi nostrum quidem expedita.

+
+
+
+ ${scope.stem} feature image +
+
+ + + +
+ +
+
+
+

Don’t know osquery?

+

Dedicated support from osquery experts

+

Osquery is the open-source agent that powers Fleet. And we have the most osquery experts around. We’ll help you realize the potential of this tool for your organization.

+
+
+ + +
+ +
+

Open-source device management

+

Think for yourself

+ +
+
+
+
+ A glass city floating on top of fluffy white clouds + A glass city floating on top of fluffy white clouds + A glass city floating on top of fluffy white clouds +
+
+<%- /* Expose server-rendered data as window.SAILS_LOCALS :: */ exposeLocalsToBrowser() %>\n` + }, done); + } + }, './:newStylesheetRelPath': { template: 'stylesheet.less.template' }, './:newPageScriptRelPath': { template: 'page-script.page.js.template' } } diff --git a/website/generators/landing-page/templates/page.ejs.template b/website/generators/landing-page/templates/page.ejs.template deleted file mode 100644 index 5a6303aaf9..0000000000 --- a/website/generators/landing-page/templates/page.ejs.template +++ /dev/null @@ -1,100 +0,0 @@ -
- -
- -
-
-

A magni, recusandae qui omnis in quod?

-

<%= _.capitalize(stem.replace(/\-/gim, ' ')) %>

-

Vitae architecto reiciendis in temporibus consequatur doloremque reprehenderit perferendis? Eaque quod voluptates earum corporis, quo labore reprehenderit libero sint.

- -
-
- -
- -
-
-
-

Culpa ab maiores alias ut, non.

-

Do vero et, voluptatem fugiat consequatur? totam ut dolores ut velit! Sapiente et quasi et voluptas et doloribus quaerat minima saepe enim?

-
-

Necessitatibus qui harum non dolore a quis!

-

Mollitia ipsum dicta hic quidem aut debitis qui iusto.

-

Esse dolor animi nostrum quidem expedita.

-
-
-
- <%= stem %> feature image -
-
- -
-
- <%= stem %> feature image -
-
-

Doloribus natus nihil alias earum, eius ducimus.

-

Laboriosam iusto magnam suscipit quasi ut quod, non, exercitationem. Enim aut consectetur repellat nihil pariatur? blanditiis.

-
-

Necessitatibus qui harum non dolore a quis!

-

Mollitia ipsum dicta hic quidem aut debitis qui iusto.

-

Esse dolor animi nostrum quidem expedita.

-
-
-
- -
-
-

Ex, illum voluptates impedit nulla, et sunt cupiditate quas illo mollitia pariatur?? Tempora et delectus ut atque vel eaque optio, inventore.

-

Similique ea provident ducimus nulla ea debitis sequi nihil.

-
-

Necessitatibus qui harum non dolore a quis!

-

Mollitia ipsum dicta hic quidem aut debitis qui iusto.

-

Esse dolor animi nostrum quidem expedita.

-
-
-
- <%= stem %> feature image -
-
- - - -
- -
-
-
-

Don’t know osquery?

-

Dedicated support from osquery experts

-

Osquery is the open-source agent that powers Fleet. And we have the most osquery experts around. We’ll help you realize the potential of this tool for your organization.

-
-
- - -
- -
-

Open-source device management

-

Think for yourself

- -
-
-
-
- A glass city floating on top of fluffy white clouds - A glass city floating on top of fluffy white clouds - A glass city floating on top of fluffy white clouds -
-
- diff --git a/website/views/pages/imagine/higher-education.ejs b/website/views/pages/imagine/higher-education.ejs index 4db0168e1e..a5a27c2aed 100644 --- a/website/views/pages/imagine/higher-education.ejs +++ b/website/views/pages/imagine/higher-education.ejs @@ -97,4 +97,4 @@ A glass city floating on top of fluffy white clouds - +<%- /* Expose server-rendered data as window.SAILS_LOCALS :: */ exposeLocalsToBrowser() %>