From a11f43e51a4299b5db1e0e69135adbc0ee8aac0c Mon Sep 17 00:00:00 2001 From: hexagoncircle Date: Fri, 28 Jul 2023 12:39:58 -0700 Subject: [PATCH 1/2] Remove mentions and links to retired Jamstack discord --- src/site/_data/github.js | 54 +++++++++++++++++++---------------- src/site/code-of-conduct.njk | 22 +++++++++------ src/site/community.njk | 55 +++++------------------------------- src/site/glossary-pages.njk | 12 ++++---- src/site/index.njk | 2 +- src/site/why-jamstack.njk | 4 +-- 6 files changed, 58 insertions(+), 91 deletions(-) diff --git a/src/site/_data/github.js b/src/site/_data/github.js index 9db2517cc..a721847d4 100644 --- a/src/site/_data/github.js +++ b/src/site/_data/github.js @@ -1,4 +1,4 @@ -require('dotenv').config(); +require("dotenv").config(); const CacheAsset = require("@11ty/eleventy-cache-assets"); const fastglob = require("fast-glob"); @@ -30,7 +30,7 @@ async function githubRequest(user, repo) { issues: "", }; - if(process.env.ELEVENTY_ENV == 'dev' || !process.env.GITHUB_READ_TOKEN) { + if (!process.env.GITHUB_READ_TOKEN) { return errorData; } @@ -55,22 +55,22 @@ async function githubRequest(user, repo) { const fetchOptions = { method: "POST", headers: { - "Authorization": `bearer ${process.env.GITHUB_READ_TOKEN}` + Authorization: `bearer ${process.env.GITHUB_READ_TOKEN}`, }, - body: JSON.stringify({ query }) + body: JSON.stringify({ query }), }; const opts = { duration: "1401m", // 23.5 hours type: "json", - fetchOptions + fetchOptions, }; let req; try { req = await CacheAsset(url, opts); - if(req.errors && req.errors.length) { - console.log( "GitHub Data Source Error from API", req.errors ); - if(req.errors.filter(e => e.type === "RATE_LIMITED").length > 0) { + if (req.errors && req.errors.length) { + console.log("GitHub Data Source Error from API", req.errors); + if (req.errors.filter((e) => e.type === "RATE_LIMITED").length > 0) { throw new Error("Failing the build due to GitHub API rate limiting."); } return errorData; @@ -80,9 +80,9 @@ async function githubRequest(user, repo) { stars: req.data.repository.stargazers.totalCount, forks: req.data.repository.forks.totalCount, issues: req.data.repository.issues.totalCount, - } - } catch(e) { - console.log( "GitHub Data Source Error", e ); + }; + } catch (e) { + console.log("GitHub Data Source Error", e); return errorData; } @@ -90,21 +90,21 @@ async function githubRequest(user, repo) { async function getReposFromMarkdown(glob) { // Starters - let ssgs = await fastglob(glob, { - caseSensitiveMatch: false + let ssgs = await fastglob(glob, { + caseSensitiveMatch: false, }); let repos = []; - for(let ssg of ssgs) { + for (let ssg of ssgs) { let matter = graymatter.read(ssg); let fullRepo = matter.data.repo; - if(fullRepo) { + if (fullRepo) { let split = fullRepo.split("/"); let user = split[0]; let repo = split[1]; - - if(!matter.data.repohost || matter.data.repohost === "github") { - if(matter.data.disabled) { + + if (!matter.data.repohost || matter.data.repohost === "github") { + if (matter.data.disabled) { continue; } repos.push({ user, repo }); @@ -115,18 +115,24 @@ async function getReposFromMarkdown(glob) { return repos; } -module.exports = async function() { +module.exports = async function () { let data = {}; let ssgRepos = await getReposFromMarkdown("./src/site/generators/*.md"); - for(let entry of ssgRepos) { - data[`${entry.user}/${entry.repo}`] = await githubRequest(entry.user, entry.repo); + for (let entry of ssgRepos) { + data[`${entry.user}/${entry.repo}`] = await githubRequest( + entry.user, + entry.repo + ); } let cmsRepos = await getReposFromMarkdown("./src/site/headless-cms/*.md"); - for(let entry of cmsRepos) { - data[`${entry.user}/${entry.repo}`] = await githubRequest(entry.user, entry.repo); + for (let entry of cmsRepos) { + data[`${entry.user}/${entry.repo}`] = await githubRequest( + entry.user, + entry.repo + ); } return data; -}; \ No newline at end of file +}; diff --git a/src/site/code-of-conduct.njk b/src/site/code-of-conduct.njk index 672482d8e..98aacc898 100644 --- a/src/site/code-of-conduct.njk +++ b/src/site/code-of-conduct.njk @@ -20,7 +20,7 @@ layout: layouts/base.njk We are a diverse, global community. We have members from every gender, sexuality, gender expression, race, ethnicity, tribal background, religious affiliation, citizenship and nationality, age, physical ability, educational background, experience level that you can think of - and want everyone to feel welcome!

- Whether it is contributing to our website, connecting in our Discord, or attending conferences and independently organized meetings, it's not only our hope, but our expectation, that you'll abide by these three basic ground rules: + Whether it is contributing to our website or attending conferences and independently organized meetings, it's not only our hope, but our expectation, that you'll abide by these three basic ground rules:

-
+{#

Discord Code of Conduct

  • Written communication is easy to misinterpret. Ask for clarification before jumping to conclusions.
  • @@ -79,7 +79,7 @@ layout: layouts/base.njk
  • Limit your use of `@channel` and `@here` as this notifies everyone across global timezones.
  • Select the most appropriate channel for your conversation and avoid reposting the same messages across many channels in ways which may feel spammy.
-
+
#}

Group Meeting Code of Conduct

@@ -106,11 +106,17 @@ layout: layouts/base.njk

+ \ No newline at end of file diff --git a/src/site/community.njk b/src/site/community.njk index 747966827..ca9e577e5 100644 --- a/src/site/community.njk +++ b/src/site/community.njk @@ -10,29 +10,11 @@ layout: layouts/base.njk

Join the global community

Our community members gather in many channels, online and in-person around the world, to learn about modern web development techniques and emerging technologies. Join the community to exchange ideas, find new opportunities and help build a better web.

- -
- {{ zinger.cta( - "Join the Discord", - "https://jamstack.org/discord", - "bg-gradient-card-sunrise card-shadow hover:card-shadow-sunrise", - "#logo-discord" - ) - }} - {{ zinger.cta( - "JamstackConf Twitter", - "https://twitter.com/jamstackconf", - "bg-gradient-card-blue-seafoam card-shadow hover:card-shadow-blue-seafoam", - "#logo-twitter" - ) - }} -

To participate in our community channels, it’s important to read and follow our Code of Conduct

-

Community Mission

@@ -46,28 +28,6 @@ layout: layouts/base.njk

-{% if meetups.length > 0 %} -
-

Upcoming Events

- - - - - - - - - - - {% for meetup, data in meetups %} - {% set item = meetup %} - {% include "components/meetup-link.njk" %} - {% endfor %} - -
-
-{% endif %} -

Find a Local User Group

@@ -81,7 +41,7 @@ layout: layouts/base.njk @@ -95,12 +55,12 @@ layout: layouts/base.njk %} {%- for item in community | sort(false, false, 'name') %} - {# chose a pseudorandom theme based on the city name #} - {% set theme = item.name.length % 4 %} -
  • - {{ meetup.card( item.name, item.link, themes[theme] ) }} -
  • + {{ meetup.card( item.name, item.link, themes[theme] ) }} + {%- endfor %}
    @@ -112,5 +72,4 @@ layout: layouts/base.njk Don’t see a group near you? We love to support new user group leaders and help grow the community. We can connect you with other user group leaders to share content ideas, provide stickers and swag, and get you listed on the user group page.

    Learn how to get started -
    - + \ No newline at end of file diff --git a/src/site/glossary-pages.njk b/src/site/glossary-pages.njk index 51a632d52..29a46b70c 100644 --- a/src/site/glossary-pages.njk +++ b/src/site/glossary-pages.njk @@ -14,20 +14,18 @@ eleventyComputed: --- -

    Glossary

    -

    A collection of terms often used when talking about Jamstack and associated web technologies.

    +

    + A collection of terms often used when talking about Jamstack and associated web technologies.

    {{ item.term }}

    - {% markdown %} + {% markdown %} {{- item.definition | safe }} - {% endmarkdown %} + {% endmarkdown %}

    You can help us to expand and improve this glossary by creating an issue.

    -
    - -{% include "components/join-the-movement.njk" %} + \ No newline at end of file diff --git a/src/site/index.njk b/src/site/index.njk index a58a4651a..e5c903461 100644 --- a/src/site/index.njk +++ b/src/site/index.njk @@ -61,4 +61,4 @@ layout: layouts/base.njk See more videos and resources - + \ No newline at end of file diff --git a/src/site/why-jamstack.njk b/src/site/why-jamstack.njk index 2deca2034..cf0d7a749 100644 --- a/src/site/why-jamstack.njk +++ b/src/site/why-jamstack.njk @@ -66,6 +66,4 @@ layout: layouts/base.njk

    Jamstack sites can be built with a wide variety of tools. They do not depend on the proprietary technologies or exotic and little known frameworks. Instead, they build on widely available tools and conventions. As a result, it's not hard to find enthusiastic and talented developers who have the right skills to build with the Jamstack. Efficiency and effectiveness can prosper.

    - - -{% include "components/join-the-movement.njk" %} + \ No newline at end of file From a7b79ef179978d12845fbbaa81963fb3fc055356 Mon Sep 17 00:00:00 2001 From: hexagoncircle Date: Mon, 7 Aug 2023 07:50:22 -0700 Subject: [PATCH 2/2] Revert changes to file --- src/site/_data/github.js | 54 ++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/src/site/_data/github.js b/src/site/_data/github.js index a721847d4..9db2517cc 100644 --- a/src/site/_data/github.js +++ b/src/site/_data/github.js @@ -1,4 +1,4 @@ -require("dotenv").config(); +require('dotenv').config(); const CacheAsset = require("@11ty/eleventy-cache-assets"); const fastglob = require("fast-glob"); @@ -30,7 +30,7 @@ async function githubRequest(user, repo) { issues: "", }; - if (!process.env.GITHUB_READ_TOKEN) { + if(process.env.ELEVENTY_ENV == 'dev' || !process.env.GITHUB_READ_TOKEN) { return errorData; } @@ -55,22 +55,22 @@ async function githubRequest(user, repo) { const fetchOptions = { method: "POST", headers: { - Authorization: `bearer ${process.env.GITHUB_READ_TOKEN}`, + "Authorization": `bearer ${process.env.GITHUB_READ_TOKEN}` }, - body: JSON.stringify({ query }), + body: JSON.stringify({ query }) }; const opts = { duration: "1401m", // 23.5 hours type: "json", - fetchOptions, + fetchOptions }; let req; try { req = await CacheAsset(url, opts); - if (req.errors && req.errors.length) { - console.log("GitHub Data Source Error from API", req.errors); - if (req.errors.filter((e) => e.type === "RATE_LIMITED").length > 0) { + if(req.errors && req.errors.length) { + console.log( "GitHub Data Source Error from API", req.errors ); + if(req.errors.filter(e => e.type === "RATE_LIMITED").length > 0) { throw new Error("Failing the build due to GitHub API rate limiting."); } return errorData; @@ -80,9 +80,9 @@ async function githubRequest(user, repo) { stars: req.data.repository.stargazers.totalCount, forks: req.data.repository.forks.totalCount, issues: req.data.repository.issues.totalCount, - }; - } catch (e) { - console.log("GitHub Data Source Error", e); + } + } catch(e) { + console.log( "GitHub Data Source Error", e ); return errorData; } @@ -90,21 +90,21 @@ async function githubRequest(user, repo) { async function getReposFromMarkdown(glob) { // Starters - let ssgs = await fastglob(glob, { - caseSensitiveMatch: false, + let ssgs = await fastglob(glob, { + caseSensitiveMatch: false }); let repos = []; - for (let ssg of ssgs) { + for(let ssg of ssgs) { let matter = graymatter.read(ssg); let fullRepo = matter.data.repo; - if (fullRepo) { + if(fullRepo) { let split = fullRepo.split("/"); let user = split[0]; let repo = split[1]; - - if (!matter.data.repohost || matter.data.repohost === "github") { - if (matter.data.disabled) { + + if(!matter.data.repohost || matter.data.repohost === "github") { + if(matter.data.disabled) { continue; } repos.push({ user, repo }); @@ -115,24 +115,18 @@ async function getReposFromMarkdown(glob) { return repos; } -module.exports = async function () { +module.exports = async function() { let data = {}; let ssgRepos = await getReposFromMarkdown("./src/site/generators/*.md"); - for (let entry of ssgRepos) { - data[`${entry.user}/${entry.repo}`] = await githubRequest( - entry.user, - entry.repo - ); + for(let entry of ssgRepos) { + data[`${entry.user}/${entry.repo}`] = await githubRequest(entry.user, entry.repo); } let cmsRepos = await getReposFromMarkdown("./src/site/headless-cms/*.md"); - for (let entry of cmsRepos) { - data[`${entry.user}/${entry.repo}`] = await githubRequest( - entry.user, - entry.repo - ); + for(let entry of cmsRepos) { + data[`${entry.user}/${entry.repo}`] = await githubRequest(entry.user, entry.repo); } return data; -}; +}; \ No newline at end of file