Skip to content

Commit

Permalink
Merge pull request #240 from cagov/fix-build-meta
Browse files Browse the repository at this point in the history
Fix problems with site build
  • Loading branch information
xjensen authored Dec 28, 2023
2 parents 2116efe + 426fc19 commit 01f292b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.exports = function (eleventyConfig) {
const FolderNamePages = "wordpress-pages";
let output = [];

collection.getAll().forEach((item) => {
collection.getAll().forEach(async (item) => {
item.data.domain = 'innovation.ca.gov';
if (item.inputPath.includes(FolderNamePosts)) {
item.outputPath = item.outputPath.replace(`/${FolderNamePosts}`, "");
Expand Down Expand Up @@ -122,9 +122,15 @@ module.exports = function (eleventyConfig) {
item.data.tags = jsonData.tags;

// WordPress will lazy load everything and you have to put php code in your theme to override it. We don't want to lazy load our featuref image
item.template.frontMatter.content = item.template.frontMatter.content.replace('loading="lazy" class="cagov-featured-image','class="cagov-featured-image');
//item.template.frontMatter.content = item.template.frontMatter.content.replace('loading="lazy" class="cagov-featured-image','class="cagov-featured-image');

let html = await item.template.read().then(t => {
return t.content
});

let html = item.template.frontMatter.content;
// WordPress will lazy load everything and you have to put php code in your theme to override it. We don't want to lazy load our featuref image
html = html.replace('loading="lazy" class="cagov-featured-image','class="cagov-featured-image');

// Temporary rewrite of feature card h2 tag to h1. This is fixed in newer version of Gutenberg blocks plugin still under review so can be deleted when this no longer comes through as h2 causing a11y test failures
if (html.indexOf('cagov-featured-sidebar') > -1) {
const {
Expand Down

0 comments on commit 01f292b

Please sign in to comment.