From 539b2761c7d18fa6092f004d40018a8fe9faf1c3 Mon Sep 17 00:00:00 2001 From: Regular James Date: Fri, 15 Nov 2024 13:14:44 -0500 Subject: [PATCH] Added content for home page, resource documents, pricing, contact us, and others... --- .eleventy.js | 79 ++++- _data/support-packages.yaml | 8 +- _includes/layouts/base.html | 4 +- _includes/menu.html | 30 +- content/contact/index.md | 39 +++ content/index.liquid | 305 +++++++++++++++++- content/pricing/free-limited-sandbox.md | 52 +++ content/pricing/index.liquid | 225 +++++++++++++ content/pricing/quotas.md | 49 +++ ...ntingency-plan-exercise-template.docx.html | 5 + ...ontingency-plan-exercise-template.pdf.html | 5 + content/redirects/casestudy-fec.html | 5 + .../redirects/cloud.gov-CIS-Worksheet.html | 5 + content/redirects/cloudgov-customers.html | 5 + content/redirects/cloudgov-overview-2018.html | 5 + .../redirects/cloudgov_cost_estimator.html | 5 + .../cloudgov_cost_estimator.xlsx.html | 5 + content/sign-up/index.md | 107 ++++++ content/support-packages/index.liquid | 107 ++++++ index.html | 21 -- styles/_theme.scss | 6 + styles/styles.scss | 2 +- 22 files changed, 1027 insertions(+), 47 deletions(-) create mode 100644 content/contact/index.md create mode 100644 content/pricing/free-limited-sandbox.md create mode 100644 content/pricing/index.liquid create mode 100644 content/pricing/quotas.md create mode 100644 content/redirects/Contingency-plan-exercise-template.docx.html create mode 100644 content/redirects/Contingency-plan-exercise-template.pdf.html create mode 100644 content/redirects/casestudy-fec.html create mode 100644 content/redirects/cloud.gov-CIS-Worksheet.html create mode 100644 content/redirects/cloudgov-customers.html create mode 100644 content/redirects/cloudgov-overview-2018.html create mode 100644 content/redirects/cloudgov_cost_estimator.html create mode 100644 content/redirects/cloudgov_cost_estimator.xlsx.html create mode 100644 content/sign-up/index.md create mode 100644 content/support-packages/index.liquid delete mode 100644 index.html diff --git a/.eleventy.js b/.eleventy.js index aba42b5..ce2ceee 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -13,6 +13,72 @@ const pluginMermaid = require("@kevingimbel/eleventy-plugin-mermaid"); const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight"); const inspect = require("util").inspect; const striptags = require("striptags"); +const path = require("path"); +const matter = require('gray-matter'); + + +// Helper function to synchronously determine if a file exists +function fileExists(filePath) { + return fs.existsSync(filePath); +} + +function loadConfig(filePath) { + try { + const resolvedPath = path.resolve(filePath); + return require(resolvedPath); + } catch (error) { + return false; + } +} + +// Helper function to retrieve all files in a folder by a given type +function getFilesByTypes(directoryPath, fileTypes) { + const files = fs.readdirSync(directoryPath); + const matchingFiles = []; + for (const file of files) { + const filePath = path.join(directoryPath, file); + const fileStat = fs.statSync(filePath); + if (fileStat.isFile() && fileTypes.includes(path.extname(file).toLowerCase())) { + matchingFiles.push(file); + } + } + return matchingFiles; +} + +// Retrieves front matter data from content files synchronously. General purpose function, but specifically used for dynamic sidenav generation +function getFrontMatterSync(filePath) { + try { + const fileContent = fs.readFileSync(filePath, 'utf8'); + const parsed = matter(fileContent); + return { + data: parsed.data, // Front matter as an object + content: parsed.content, // Content without front matter + }; + } catch (error) { + console.error(`Error reading file: ${error.message}`); + return null; + } +} + +// Returns page metadata from 11ty +function getPageData(filePath) { + const pageData = {}; // Default structure + + // Try to resolve Eleventy page metadata (if available) + try { + const eleventyPage = require(filePath); // Simulate page loading + if (eleventyPage) { + pageData.url = eleventyPage.url; + pageData.fileSlug = eleventyPage.fileSlug; + pageData.outputPath = eleventyPage.outputPath; + } + } catch (error) { + console.warn(`Could not load 11ty page data for: ${filePath}`, error); + } + + return pageData; +} + module.exports = function (config) { // Set pathPrefix for site @@ -31,6 +97,7 @@ module.exports = function (config) { './node_modules/anchor-js/anchor.min.js': 'assets/js/anchor.min.js' }); + // Strips HTML content. Good for general use if needed, but specifically used on paginated areas for description content. config.addFilter("striptags", (content) => { return striptags(content); }); @@ -38,9 +105,8 @@ module.exports = function (config) { // Prepare content for table of contents, at time of writing used on the docs.html layout config.addFilter("prepTOCContent", (content) => { const toc = config.getFilter("toc"); - const strip = config.getFilter("strip"); - const strip_newlines = config.getFilter("strip_newlines") - return strip_newlines(strip(toc(content))); + const striptags = config.getFilter("striptags"); + return striptags(toc(content)); }); // Determine if the table of contents should be shown, at time of writing used on the docs.html layout @@ -87,6 +153,13 @@ module.exports = function (config) { return DateTime.fromJSDate(dateObj, {zone: 'utc'}).toFormat('yyyy-LL-dd'); }); + config.addFilter('getSideNav', (collections=[], sidenavIdentifier="") => { + const sideNav = collections.find(x => x.sidenav === sidenavIdentifier); + return !!sideNav?.categories ? sideNav.categories.sort((a, b) => { + return a.weight - b.weight; + }) : []; + }); + // Get the first `n` elements of a collection. config.addFilter('head', (array, n) => { if (!Array.isArray(array) || array.length === 0) { diff --git a/_data/support-packages.yaml b/_data/support-packages.yaml index 6041049..8778196 100644 --- a/_data/support-packages.yaml +++ b/_data/support-packages.yaml @@ -1,22 +1,22 @@ -- package_name: Platform
Support +- package_name: Platform Support description: > If you run into any issues with the underlying cloud.gov platform, we will resolve them at no additional cost. If you run into technical problems with your application, we can point you to useful resources but cannot devote meaningful time on your applications. price:

$0.00/year

hours: Limited to platform issues image: basic-support.svg -- package_name: Basic
Support +- package_name: Basic Support description: > This is the default support level for new cloud.gov agreements. This package includes all services provided in Platform Support, plus 10hrs of support time that our engineers can devote to resolving issues with your specific applications. price:

$2,500/year

hours: 10 hours per year image: supplemental-support.svg -- package_name: Premium
Support +- package_name: Premium Support description: > This package includes all services provided in Platform Support, plus 50hrs of support time that our engineers can devote to resolving issues with your specific applications. You will also have the option for a bi-weekly standing meeting with our engineers. price:

$12,500/year

hours: 50 hours per year image: premium-support.svg -- package_name: Supplemental
Support +- package_name: Supplemental Support description: > This package includes all services provided in Platform Support, plus the number of hours that you choose which best supports your team (at the rate of $250/hour) that our engineers can devote to resolving issues with your specific applications. price:

$250/hour

diff --git a/_includes/layouts/base.html b/_includes/layouts/base.html index 7bdb978..a5f046d 100644 --- a/_includes/layouts/base.html +++ b/_includes/layouts/base.html @@ -16,8 +16,8 @@ {% assign primary_navigation = pages.navigation.primary %} {% assign secondary_navigation = pages.navigation.secondary %} {% else %} - {% assign primary_navigation = site.navigation.primary %} - {% assign secondary_navigation = site.navigation.secondary %} + {% assign primary_navigation = site.primary_navigation %} + {% assign secondary_navigation = site.secondary_navigation %} {% endif %} {% include "menu.html" primary_navigation: primary_navigation secondary_navigation: secondary_navigation %} diff --git a/_includes/menu.html b/_includes/menu.html index 55bb3d2..6f2f8af 100644 --- a/_includes/menu.html +++ b/_includes/menu.html @@ -5,17 +5,17 @@