Skip to content

Commit

Permalink
Added content for home page, resource documents, pricing, contact us,…
Browse files Browse the repository at this point in the history
… and others...
  • Loading branch information
jamesthebrooks committed Nov 15, 2024
1 parent fbffc32 commit 539b276
Show file tree
Hide file tree
Showing 22 changed files with 1,027 additions and 47 deletions.
79 changes: 76 additions & 3 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,16 +97,16 @@ 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);
});

// 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
Expand Down Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions _data/support-packages.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
- package_name: Platform <br>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: <h3>$0.00/year</h3>
hours: Limited to platform issues
image: basic-support.svg
- package_name: Basic <br>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: <h3>$2,500/year</h3>
hours: 10 hours per year
image: supplemental-support.svg
- package_name: Premium <br>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: <h3>$12,500/year</h3>
hours: 50 hours per year
image: premium-support.svg
- package_name: Supplemental<br/>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: <h3>$250/hour</h3>
Expand Down
4 changes: 2 additions & 2 deletions _includes/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand Down
30 changes: 15 additions & 15 deletions _includes/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@
<header class="usa-header usa-header--extended" role="banner">
<div class="usa-navbar">
{% if navigation == "pages" %}
{% include "pages/logo.html" %}
{% include "pages/logo.html" %}
{% else %}
{% include "logo.html" %}
{% include "logo.html" %}
{% endif %}
<button class="usa-menu-btn">Menu</button>
</div>
<nav
id="menu-navigation"
aria-label="Menu navigation"
role="navigation"
class="usa-nav"
id="menu-navigation"
aria-label="Menu navigation"
role="navigation"
class="usa-nav"
>
<div class="usa-nav__inner">
<button class="usa-nav__close">
{% image "./node_modules/@uswds/uswds/dist/img/usa-icons/close.svg" "close" %}
</button>
<ul class="usa-nav__primary usa-accordion">
{% for nav_item in primary_navigation %}
{% unless nav_item.children %}
{% unless nav_item.children %}
{% assign basedir = page.url | remove_first: '/' | split: '/' | first |
lstrip %} {% assign linkdir = nav_item.url | replace: "/", "" | lstrip
%}
<li class="usa-nav__primary-item">
<a
class="usa-nav__link{% if basedir == linkdir %} usa-current{% endif %}"
href="{{ nav_item.url | url }}"
><span>{{ nav_item.name | escape }}</span></a
class="usa-nav__link{% if basedir == linkdir %} usa-current{% endif %}"
href="{{ nav_item.url | url }}"
><span>{{ nav_item.name | escape }}</span></a
>
</li>
{% else %}
Expand All @@ -47,17 +47,17 @@

<li class="usa-nav__primary-item">
<button
class="usa-accordion__button usa-nav__link{% if is_current %} usa-current{% endif %}"
aria-expanded="false"
aria-controls="{{ nav_id }}"
class="usa-accordion__button usa-nav__link{% if is_current %} usa-current{% endif %}"
aria-expanded="false"
aria-controls="{{ nav_id }}"
>
<span>{{ nav_item.name | escape }}</span>
</button>
<ul id="{{ nav_id }}" class="usa-nav__submenu">
{% for subnav_item in nav_item.children %}
<li class="usa-nav__submenu-item">
<a href="{{ subnav_item.url | url }}"
>{{ subnav_item.name | escape }}</a
>{{ subnav_item.name | escape }}</a
>
</li>
{% endfor %}
Expand All @@ -70,7 +70,7 @@
{% for nav_item in secondary_navigation %}
<li class="usa-nav__secondary-item">
<a href="{{ nav_item.url | url }}"
>{{ nav_item.name | escape }}</a
>{{ nav_item.name | escape }}</a
>
</li>
{% endfor %}
Expand Down
39 changes: 39 additions & 0 deletions content/contact/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
permalink: contact/
layout: layouts/docs
sidenav: true
title: Contact
redirect_from:
- /help
- /contact/
- /docs/help/
---

### Want to use cloud.gov?

If you're interested in using cloud.gov, email [{{site.email}}]({{site.inquiries_email}}). We’ll schedule a call to answer your questions and help you [get started]({{ site.baseurl }}/sign-up/).

If you have a U.S. federal government email address, you can [get access to a free sandbox space]({{ site.baseurl }}/pricing/free-limited-sandbox).

### Support for people who use cloud.gov

Email [**{{site.support_email_address}}**]({{site.support_email}}). See our [customer service objectives page]({{ site.baseurl }}/overview/customer-service-objectives) for information about our support availability.

If you need help with an application security incident, the request should come from the System Owner or Org Manager, to help us validate the request. For an active incident, refer to our
standard [security.txt]({{ site.baseurl }}/.well-known/security.txt) file.

You should not include any passwords or sensitive environment variables in your email (we don't need them to help you, and you should keep them protected).

### Report a vulnerability

We welcome vulnerability reports [according to our vulnerability disclosure policy](https://www.gsa.gov/vulnerability-disclosure-policy), which includes how to best contact us for this kind of information.

### Questions from the public and industry

If you have a question that isn't on behalf of a U.S. government organization (such as if you're a member of the public or representing a company), we invite you to post your question [publicly as an issue on GitHub]({{site.github_url}}/issues/new) (requires a free GitHub account), so that we can write an answer available to everyone. If you prefer not to post publicly, you can email [{{site.email}}](mailto:{{site.email}}).

If you are part of a company asking a question to help prepare a response to a RFI/RFQ/RFP (or a similar proposal process), we will ask you to post your question [publicly as an issue on GitHub]({{site.github_url}}/issues/new) (requires a free GitHub account). We want to answer publicly so that our answer is available to all companies competing in that process.

### Interested in working on cloud.gov?

Check out [joining TTS](https://join.tts.gsa.gov/) if you'd like to join cloud.gov or another TTS program.
Loading

0 comments on commit 539b276

Please sign in to comment.