Skip to content

Commit

Permalink
Fix generate scripts for 2021 (#2166)
Browse files Browse the repository at this point in the history
* Fix generate scripts for 2021

* Test commit

* Fixing linting errors

* Remove test change
  • Loading branch information
tunetheweb authored Apr 27, 2021
1 parent 0188967 commit 0380522
Show file tree
Hide file tree
Showing 3 changed files with 279 additions and 7 deletions.
267 changes: 267 additions & 0 deletions src/config/2021.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
{
"settings": [
{
"is_live": false,
"supported_languages": ["en"],
"ebook_languages": []
}
],
"outline": [
{
"part": "I. Page Content",
"part_number": "1",
"chapters": [
{
"part": "I",
"chapter_number": "1",
"title": "CSS",
"slug": "css",
"todo": "true"
},
{
"part": "I",
"chapter_number": "2",
"title": "JavaScript",
"slug": "javascript",
"todo": "true"
},
{
"part": "I",
"chapter_number": "3",
"title": "Markup",
"slug": "markup",
"todo": "true"
},
{
"part": "I",
"chapter_number": "4",
"title": "Fonts",
"slug": "fonts",
"todo": "true"
},
{
"part": "I",
"chapter_number": "5",
"title": "Media",
"slug": "media",
"todo": "true"
},
{
"part": "I",
"chapter_number": "6",
"title": "Third Parties",
"slug": "third-parties",
"todo": "true"
}
]
},
{
"part": "II. User Experience",
"part_number": "2",
"chapters": [
{
"part": "II",
"chapter_number": "7",
"title": "SEO",
"slug": "seo",
"todo": "true"
},
{
"part": "II",
"chapter_number": "8",
"title": "Accessibility",
"slug": "accessibility",
"todo": "true"
},
{
"part": "II",
"chapter_number": "9",
"title": "Performance",
"slug": "performance",
"todo": "true"
},
{
"part": "II",
"chapter_number": "10",
"title": "Privacy",
"slug": "privacy",
"todo": "true",
"hero_dir": "2020"
},
{
"part": "II",
"chapter_number": "11",
"title": "Security",
"slug": "security",
"todo": "true"
},
{
"part": "II",
"chapter_number": "12",
"title": "Mobile Web",
"slug": "mobile-web",
"todo": "true"
},
{
"part": "II",
"chapter_number": "13",
"title": "Capabilities",
"slug": "capabilities",
"todo": "true",
"hero_dir": "2020"
},
{
"part": "II",
"chapter_number": "14",
"title": "PWA",
"slug": "pwa",
"todo": "true"
}
]
},
{
"part": "III. Content Publishing",
"part_number": "3",
"chapters": [
{
"part": "III",
"chapter_number": "15",
"title": "CMS",
"slug": "cms",
"todo": "true"
},
{
"part": "III",
"chapter_number": "16",
"title": "Ecommerce",
"slug": "ecommerce",
"todo": "true"
},
{
"part": "III",
"chapter_number": "17",
"title": "Jamstack",
"slug": "jamstack",
"todo": "true",
"hero_dir": "2020"
}
]
},
{
"part": "IV. Content Distribution",
"part_number": "4",
"chapters": [
{
"part": "IV",
"chapter_number": "18",
"title": "Page Weight",
"slug": "page-weight",
"todo": "true"
},
{
"part": "IV",
"chapter_number": "19",
"title": "Compression",
"slug": "compression",
"todo": "true"
},
{
"part": "IV",
"chapter_number": "20",
"title": "Caching",
"slug": "caching",
"todo": "true"
},
{
"part": "IV",
"chapter_number": "21",
"title": "CDN",
"slug": "cdn",
"todo": "true"
},
{
"part": "IV",
"chapter_number": "22",
"title": "Resource Hints",
"slug": "resource-hints",
"todo": "true"
},
{
"part": "IV",
"chapter_number": "23",
"title": "HTTP/2",
"slug": "http2",
"todo": "true"
}
]
}
],
"teams": {
"analysts": {
"name": "Analysts"
},
"authors": {
"name": "Authors"
},
"designers": {
"name": "Designers"
},
"developers": {
"name": "Developers"
},
"editors": {
"name": "Editors"
},
"leads": {
"name": "Leads"
},
"reviewers": {
"name": "Reviewers"
},
"translators": {
"name": "Translators"
}
},
"contributors": {
"bazzadp": {
"name": "Barry Pollard",
"teams": [
"leads"
],
"avatar_url": "https://avatars3.githubusercontent.com/u/10931297?v=4&s=200",
"website": "https://www.tunetheweb.com",
"github": "bazzadp",
"linkedin": "barry-pollard-developer",
"twitter": "tunetheweb"
},
"obto": {
"name": "David Fox",
"teams": [
"leads"
],
"avatar_url": "https://avatars2.githubusercontent.com/u/684747?v=4&s=200",
"website": "https://www.lookzook.com",
"github": "obto",
"twitter": "theobto"
},
"paulcalvano": {
"name": "Paul Calvano",
"teams": [
"leads"
],
"avatar_url": "https://avatars3.githubusercontent.com/u/7459458?v=4&s=200",
"github": "paulcalvano",
"twitter": "paulcalvano",
"website": "https://paulcalvano.com"
},
"rviscomi": {
"name": "Rick Viscomi",
"teams": [
"leads"
],
"avatar_url": "https://avatars0.githubusercontent.com/u/1120896?v=4&s=200",
"github": "rviscomi",
"twitter": "rick_viscomi"
}
}
}
16 changes: 9 additions & 7 deletions src/tools/generate/generate_chapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,15 @@ const parse_file = async (markdown,chapter) => {
const authors = parse_array(m.authors);
const reviewers = parse_array(m.reviewers);

authors.forEach((author) => {
const author_bio_name = author + '_bio';
const author_bio_value = m[author_bio_name];
if (author_bio_value) {
m[author_bio_name] = convertSimpleMarkdown(author_bio_value);
}
});
if (authors && authors.length > 0) {
authors.forEach((author) => {
const author_bio_name = author + '_bio';
const author_bio_value = m[author_bio_name];
if (author_bio_value) {
m[author_bio_name] = convertSimpleMarkdown(author_bio_value);
}
});
}

let translators;
if (m.translators) {
Expand Down
3 changes: 3 additions & 0 deletions src/tools/scripts/set_lighthouse_urls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ elif [ "${RUN_TYPE}" == "pull_request" ] && [ "${COMMIT_SHA}" != "" ]; then
# Transform the files to http://127.0.0.1:8080 URLs
LIGHTHOUSE_URLS=$(echo "${CHANGED_FILES}" | sed 's/src\/content/http:\/\/127.0.0.1:8080/g' | sed 's/\.md//g' | sed 's/\/base\//\/en\/2019\//g' | sed 's/src\/templates/http:\/\/127.0.0.1:8080/g' | sed 's/index\.html//g' | sed 's/\.html//g' | sed 's/_/-/g' | sed 's/\/2019\/accessibility-statement/\/accessibility-statement/g' )

# Temporarily remove 2021 until ready to test that - TODO remove this
LIGHTHOUSE_URLS=$(echo "${LIGHTHOUSE_URLS}" | grep -v 2021)

# Add base URLs and strip out newlines
LIGHTHOUSE_URLS=$(echo -e "${LIGHTHOUSE_URLS}\n${BASE_URLS}" | sort -u | sed '/^$/d')

Expand Down

0 comments on commit 0380522

Please sign in to comment.