diff --git a/.gitignore b/.gitignore index 0ec4f62a64..1b57cc72a6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,8 @@ app/site/_includes/js !app/site/img/.keep .vscode/ scripts/metricsLib/__pycache__ +node_modules + # Files/Dirs ignored because they're secret/internal only id_rsa secrets_repo/ diff --git a/app/.eleventy.js b/app/.eleventy.js index bb5510e861..a790c6964b 100644 --- a/app/.eleventy.js +++ b/app/.eleventy.js @@ -89,7 +89,7 @@ module.exports = function (eleventyConfig) { "stroke-width": 2, }) - const pathPrefix = process.env.NODE_ENV.includes("production") ? "/metrics" : "" + const pathPrefix = process.env.ELEVENTY_ENV.includes("production") ? "/metrics" : "" return { dir: { diff --git a/app/package.json b/app/package.json index cacb07c4dc..23316a5e0e 100644 --- a/app/package.json +++ b/app/package.json @@ -4,16 +4,16 @@ "description": "", "main": ".eleventy.js", "scripts": { - "start": "NODE_ENV=development run-p -l start:*", + "start": "ELEVENTY_ENV=development run-p -l start:*", "start:eleventy": "eleventy --serve", "start:rollup": "rollup --config rollup.config.mjs -w", "start:postcss": "postcss ./src/css -d ./site/_includes/css -w", - "prod": "NODE_ENV=test-production run-s -l prod:*", + "prod": "ELEVENTY_ENV=test-production run-s -l prod:*", "prod:clean": "rm -rf dist", "prod:rollup": "rollup --config rollup.config.mjs --bundleConfigAsCjs", "prod:postcss": "postcss ./src/css -d ./site/_includes/css", "prod:eleventy": "eleventy --serve", - "build": "NODE_ENV=production run-s -l build:*", + "build": "ELEVENTY_ENV=production run-s -l build:*", "build:clean": "rm -rf dist", "build:rollup": "rollup --config rollup.config.mjs --bundleConfigAsCjs", "build:postcss": "postcss ./src/css -d ./site/_includes/css", diff --git a/app/postcss.config.js b/app/postcss.config.js index 81de268979..57ee3fa634 100644 --- a/app/postcss.config.js +++ b/app/postcss.config.js @@ -2,7 +2,7 @@ module.exports = { plugins: [ require("postcss-import"), require("autoprefixer"), - ...(process.env.NODE_ENV.includes("production") + ...(process.env.ELEVENTY_ENV.includes("production") ? [ require("cssnano"), require("@fullhuman/postcss-purgecss")({ diff --git a/app/rollup.config.mjs b/app/rollup.config.mjs index 627beb0670..3c7a01d284 100644 --- a/app/rollup.config.mjs +++ b/app/rollup.config.mjs @@ -14,7 +14,7 @@ export default [ resolve(), babel(), commonjs(), - ...(process.env.NODE_ENV.includes("production") ? [terser()] : []), + ...(process.env.ELEVENTY_ENV.includes("production") ? [terser()] : []), ], }, ] diff --git a/app/site/_data/site.js b/app/site/_data/site.js index 5d74e4ba3f..78beef2313 100644 --- a/app/site/_data/site.js +++ b/app/site/_data/site.js @@ -1,10 +1,10 @@ -const isProduction = process.env.NODE_ENV.includes("production") -const isTest = process.env.NODE_ENV.includes("test") +const isProduction = process.env.ELEVENTY_ENV.includes("production") +const isTest = process.env.ELEVENTY_ENV.includes("test") const host = (isProduction && !isTest) ? "https://dsacms.github.io" : "http://localhost:8080" // For modifying the tag -const baseurl = isProduction ? "/metrics" : "" +const baseurl = isProduction ? "/metrics" : "" module.exports = { name: "CMS Metrics Website", diff --git a/app/site/_includes/banner.liquid b/app/site/_includes/banner.liquid index fbfd6f2bc4..baeb781c43 100644 --- a/app/site/_includes/banner.liquid +++ b/app/site/_includes/banner.liquid @@ -6,7 +6,7 @@ class="usa-link usa-link--external" rel="noreferrer" target="_blank" - href="https://github.com/DSACMS/metrics/issues/new" + href="https://{{ site.baseurl }}/{{ org }}/metrics/issues/new" >give us feedback.

diff --git a/app/site/_includes/modal-content.liquid b/app/site/_includes/modal-content.liquid index 74a422062e..e69998b2ec 100644 --- a/app/site/_includes/modal-content.liquid +++ b/app/site/_includes/modal-content.liquid @@ -29,7 +29,7 @@ data-close-modal > diff --git a/app/site/_layouts/org-report.liquid b/app/site/_layouts/org-report.liquid index b999e35bb3..cd1711d3a4 100644 --- a/app/site/_layouts/org-report.liquid +++ b/app/site/_layouts/org-report.liquid @@ -8,7 +8,7 @@ layout: base

Report for - {{ org }} + {{ org }} Organization Avatar

-
{% if organization %}

Organization Stats

-
-
-
-

- - - {% lucide "folder-git-2" %} - - - Repositories -

+
+
+
+
+

+ + + {% lucide "folder-git-2" %} + + + Repositories +

+
+

{{ organization.repo_count }}

-

{{ organization.repo_count }}

-
-
-
-

- - - {% lucide "users-2" %} - - - Followers -

+
+
+

+ + + {% lucide "users-2" %} + + + Followers +

+
+

{{ organization.followers_count }}

-

{{ organization.followers_count }}

{% else %} diff --git a/app/site/_layouts/repo-report.liquid b/app/site/_layouts/repo-report.liquid index 6c973c5aae..636e4273ec 100644 --- a/app/site/_layouts/repo-report.liquid +++ b/app/site/_layouts/repo-report.liquid @@ -23,7 +23,7 @@ layout: base

Report for - {{ repo }} + {{ repo }}

@@ -170,7 +170,24 @@ layout: base

{{ project.pull_requests_count }}

-
+
+
+

+ + + {% lucide "calendar" %} + + + Project Creation Date +

+
+

{{ project.created_at | date: '%B %d, %Y' }}

+
+

@@ -182,26 +199,20 @@ layout: base {% lucide "calendar" %} - Project Creation Date - + Age of Project

-

- - {{ project.created_at | date: '%B %d, %Y' }} - -

+ {% comment %} takes project created + todays date and turns it into seconds {% endcomment %} + {% assign created_date = project.created_at | date: '%s' | plus: 0 %} + {% assign current_date = 'now' | date: '%s' | plus: 0 %} - {% assign age_seconds = current_date | minus: created_date %} + {% assign age_seconds = current_date | minus: created_date %} - {% comment %} divide by how many seconds are in a day to convert back into days {% endcomment %} - {% assign age_days = age_seconds | divided_by: 86400.0 | round %} + {% comment %} divide by how many seconds are in a day to convert back into days {% endcomment %} + {% assign age_days = age_seconds | divided_by: 86400.0 | round %} - {{ age_days }} day{% if age_days != 1 %}s{% endif %} - + {{ age_days }} day{% if age_days != 1 %}s{% endif %}

diff --git a/app/site/organizations.liquid b/app/site/organizations.liquid index 88d1f55c27..ec8a6cecea 100644 --- a/app/site/organizations.liquid +++ b/app/site/organizations.liquid @@ -8,8 +8,7 @@ layout: base

The Centers for Medicare and Medicaid Services is comprised of many GitHub Organizations.