Skip to content

Commit

Permalink
Merge branch 'main' into experience-decisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
ramboz authored Oct 5, 2023
2 parents 54a8dd4 + 36e3e8d commit 393e978
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 66 deletions.
52 changes: 31 additions & 21 deletions atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@
<feed xmlns="http://www.w3.org/2005/Atom">
<id>https://www.petplace.com/</id>
<title>PetPlace.com articles</title>
<updated>2023-10-02T00:00:00.000Z</updated>
<updated>2023-10-04T00:00:00.000Z</updated>
<generator>News feed generator (GitHub action)</generator>
<link rel="alternate" href="https://www.petplace.com/"/>
<link rel="self" href="https://www.petplace.com/atom.xml"/>
<rights>All rights reserved 2023, Independence America Holdings Corp.</rights>
<entry>
<title type="html"><![CDATA[Adopting a Shelter Dog - PetPlace]]></title>
<id>https://www.petplace.com/article/dogs/pet-care/adopting-a-shelter-dog</id>
<link href="https://www.petplace.com/article/dogs/pet-care/adopting-a-shelter-dog"/>
<updated>2023-10-04T00:00:00.000Z</updated>
<summary type="html"><![CDATA[October is Adopt a Shelter Dog Month. Here are all the tips you’ll need to take care of your new furry family member, including reasons to adopt, ways to build a strong bond, and how to keep them happy and healthy.]]></summary>
<author>
<name>Richard Rowlands</name>
</author>
<category label="Pet Care" term="dog care, Adopting a Pet"/>
</entry>
<entry>
<title type="html"><![CDATA[The Solution for Cleaning Up Pet Hair and Messes - PetPlace]]></title>
<id>https://www.petplace.com/article/general/pet-care/roborock-vacuum-pet-hair-fur-removal</id>
Expand Down Expand Up @@ -118,11 +129,11 @@
<category label="Pet Expenses" term="pet insurance"/>
</entry>
<entry>
<title type="html"><![CDATA[My Dog Keeps Licking Lips — What’s Happening?]]></title>
<title type="html"><![CDATA[Why Does My Dog Keep Licking Lips? Demystify Canine Behavior | PetPlace.com]]></title>
<id>https://www.petplace.com/article/dogs/pet-health/dog-health/my-dog-keeps-licking-his-lips-whats-happening</id>
<link href="https://www.petplace.com/article/dogs/pet-health/dog-health/my-dog-keeps-licking-his-lips-whats-happening"/>
<updated>2023-09-05T00:00:00.000Z</updated>
<summary type="html"><![CDATA[Have you ever wondered why your dog keeps licking lips? Generally, this is normal dog behavior, but it could be a sign of something more.]]></summary>
<summary type="html"><![CDATA[Get answers to why your dog keeps licking lips. Discover the common causes, from anxiety to dental issues, and find out what you can do to help]]></summary>
<author>
<name>Dr. Debra Primovic - DVM</name>
</author>
Expand All @@ -140,7 +151,7 @@
<category label="Pet Behavior and Training" term="behavior training"/>
</entry>
<entry>
<title type="html"><![CDATA[Keeping Caracal as Pets | PetPlace.com]]></title>
<title type="html"><![CDATA[Caracals as Pets: Understanding Behavior, Diet, and Risks | PetPlace.com]]></title>
<id>https://www.petplace.com/article/cats/pet-care/caracals-as-pets</id>
<link href="https://www.petplace.com/article/cats/pet-care/caracals-as-pets"/>
<updated>2023-08-31T00:00:00.000Z</updated>
Expand Down Expand Up @@ -195,7 +206,7 @@
<category label="Pet Wellness and Health" term="pet health"/>
</entry>
<entry>
<title type="html"><![CDATA[Can Cats Eat Grapes? | PetPlace.com]]></title>
<title type="html"><![CDATA[Can Cats Eat Grapes? A Vet-Approved Guide You Shouldn't Ignore | PetPlace.com]]></title>
<id>https://www.petplace.com/article/cats/pet-health/cat-health/cat-diet-nutrition/can-cats-eat-grapes</id>
<link href="https://www.petplace.com/article/cats/pet-health/cat-health/cat-diet-nutrition/can-cats-eat-grapes"/>
<updated>2023-08-30T00:00:00.000Z</updated>
Expand Down Expand Up @@ -1053,11 +1064,11 @@
<category label="Diseases &#x26; Conditions of Cats" term="diseases conditions of cats"/>
</entry>
<entry>
<title type="html"><![CDATA[Doberman Ear Cropping: Is it Necessary? - PetPlace]]></title>
<title type="html"><![CDATA[Doberman Ears Cropping vs. Natural: Which Is Better for Your Dog? | PetPlace.com]]></title>
<id>https://www.petplace.com/article/dogs/breeds/dog-breeds/doberman-ear-cropping-necessary</id>
<link href="https://www.petplace.com/article/dogs/breeds/dog-breeds/doberman-ear-cropping-necessary"/>
<updated>2023-03-21T00:00:00.000Z</updated>
<summary type="html"><![CDATA[Is Doberman ear cropping necessary? We look at the reasons why this procedure is carried out, the legalities, and if you should crop or not. Read more here.]]></summary>
<summary type="html"><![CDATA[Explore the pros and cons of ear cropping vs. natural ears in Dobermans. Learn about the health implications, aesthetics, and what's best for your pet.]]></summary>
<author>
<name>PetPlace Staff</name>
</author>
Expand Down Expand Up @@ -1482,11 +1493,11 @@
<category label="Just For Fun" term="fun stuff"/>
</entry>
<entry>
<title type="html"><![CDATA[How Much Does Veterinary Surgery Cost? - PetPlace]]></title>
<title type="html"><![CDATA[How Much Does Cat and Dog Surgery Cost? What to Expect | PetPlace.com]]></title>
<id>https://www.petplace.com/article/general/pet-insurance/how-much-does-veterinary-surgery-cost</id>
<link href="https://www.petplace.com/article/general/pet-insurance/how-much-does-veterinary-surgery-cost"/>
<updated>2023-01-12T00:00:00.000Z</updated>
<summary type="html"><![CDATA[Veterinary surgery is a scary subject for pet parents, both due to fear for a pet's health &#x26; cost concerns. Here are price ranges for common procedures.]]></summary>
<summary type="html"><![CDATA[Get the real numbers on the cost of cat and dog surgeries, from routine to complex procedures. Here are price ranges for common procedures.]]></summary>
<author>
<name>Richard Rowlands</name>
</author>
Expand Down Expand Up @@ -3539,11 +3550,11 @@
<category label="Pet Wellness and Health" term="pet health"/>
</entry>
<entry>
<title type="html"><![CDATA[Does Medicaid Pay for Pets? - PetPlace]]></title>
<title type="html"><![CDATA[Does Medicaid Cover Pets? What You Need to Know | PetPlace.com]]></title>
<id>https://www.petplace.com/article/general/pet-insurance/does-medicaid-pay-for-pets</id>
<link href="https://www.petplace.com/article/general/pet-insurance/does-medicaid-pay-for-pets"/>
<updated>2022-01-13T00:00:00.000Z</updated>
<summary type="html"><![CDATA[Does Medicaid cover your pets? Unfortunately, it won't pay for your furry friends, but here are options to keep your pet in good health at a low cost.]]></summary>
<updated>2022-01-12T00:00:00.000Z</updated>
<summary type="html"><![CDATA[Find out why Medicaid does not cover pets and review alternatives to keep your pet in good health at a low cost.]]></summary>
<author>
<name>Dr. Debra Primovic - DVM</name>
</author>
Expand Down Expand Up @@ -3814,11 +3825,11 @@
<category label="Pet Care" term="Cat Care"/>
</entry>
<entry>
<title type="html"><![CDATA[Does Your Dog or Cat Need an Ultrasound? - PetPlace]]></title>
<title type="html"><![CDATA[Dog or Cat Ultrasound Needs: Costs, Safety and Preparation - PetPlace]]></title>
<id>https://www.petplace.com/article/general/pet-insurance/does-your-cat-or-dog-need-an-ultrasound</id>
<link href="https://www.petplace.com/article/general/pet-insurance/does-your-cat-or-dog-need-an-ultrasound"/>
<updated>2021-12-03T00:00:00.000Z</updated>
<summary type="html"><![CDATA[Ultrasounds are just as vital for pets as they are for humans. They're a great tool for determining sources of pain and discomfort.]]></summary>
<summary type="html"><![CDATA[Does your dog or cat needs an ultrasound? Learn about the costs, safety measures, and how to prepare your pet for the procedure.]]></summary>
<author>
<name>Jennifer Phillips April</name>
</author>
Expand Down Expand Up @@ -12306,11 +12317,11 @@
<category label="Cat Behavior &#x26; Training" term="cat behavior training"/>
</entry>
<entry>
<title type="html"><![CDATA[Why Don’t Cats Listen When They’re Called?]]></title>
<title type="html"><![CDATA[Why Don’t Cats Listen When They’re Called? | PetPlace.com]]></title>
<id>https://www.petplace.com/article/cats/pet-behavior-training/cat-behavior-training/why-dont-cats-listen-when-theyre-called</id>
<link href="https://www.petplace.com/article/cats/pet-behavior-training/cat-behavior-training/why-dont-cats-listen-when-theyre-called"/>
<updated>2019-10-20T00:00:00.000Z</updated>
<summary type="html"><![CDATA[Cats are mysterious creatures that can be hard for some to understand including why cats don’t listen. Learn about why cats don't come when they are called.]]></summary>
<summary type="html"><![CDATA[Unravel the mysteries of why cats don’t listen and discover practical tips to make yourself heard. Improve your pet's communication today!]]></summary>
<author>
<name>PetPlace Veterinarians</name>
</author>
Expand Down Expand Up @@ -16145,11 +16156,11 @@
<category label="Drug Library" term="cat health"/>
</entry>
<entry>
<title type="html"><![CDATA[Are Rottweilers Good Family Dogs?]]></title>
<title type="html"><![CDATA[Are Rottweilers Good Dogs? Separating Myths from Facts | PetPlace.com]]></title>
<id>https://www.petplace.com/article/dogs/breeds/dog-breeds/rottweilers-good-family-dogs</id>
<link href="https://www.petplace.com/article/dogs/breeds/dog-breeds/rottweilers-good-family-dogs"/>
<updated>2018-02-22T00:00:00.000Z</updated>
<summary type="html"><![CDATA[Are Rottweilers good family dogs? The answer is yes, they can be. A Rottweiler should not automatically be ruled out as a family pet. When correctly trained, socialized and cared for, the Rottweiler can make a wonderful family pet – loyal, loving and calm.]]></summary>
<summary type="html"><![CDATA[Find out if Rottweilers are good dogs. Our article dives deep into the characteristics, temperament, and myths surrounding the breed. Make an informed decision.]]></summary>
<author>
<name>PetPlace Staff</name>
</author>
Expand Down Expand Up @@ -39190,11 +39201,11 @@
<category label="Pet Behavior and Training" term="behavior training"/>
</entry>
<entry>
<title type="html"><![CDATA[How Many Dogs Are Too Many?]]></title>
<title type="html"><![CDATA[Responsible Dog Ownership: How Many Dogs Are Too Many? | PetPlace.com]]></title>
<id>https://www.petplace.com/article/dogs/pet-behavior-training/how-many-dogs-are-too-many</id>
<link href="https://www.petplace.com/article/dogs/pet-behavior-training/how-many-dogs-are-too-many"/>
<updated>2015-08-09T00:00:00.000Z</updated>
<summary type="html"><![CDATA[How Many Dogs Are Too Many?]]></summary>
<summary type="html"><![CDATA[Discover the right number of dogs for your home with our expert guide. Navigate the complexities of responsible dog ownership from time commitment to finances.]]></summary>
<author>
<name>Dr. Nicholas Dodman</name>
</author>
Expand Down Expand Up @@ -107211,7 +107222,6 @@
<author>
<name>PetPlace Staff</name>
</author>
<category label="Cat Behavior &#x26; Training" term="cat behavior training"/>
</entry>
<entry>
<title type="html"><![CDATA[Complete List of Dog Names: Unusual and Fun Names for Your Dog]]></title>
Expand Down
52 changes: 29 additions & 23 deletions blocks/ad/ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ function parseAdSizes(rawSizes) {
return null;
}

function getAdSizes(ad) {
function getAdSizes(el, ad) {
if (!ad) {
return [];
}
const widths = parseAdSizes(ad.Width);
const heights = parseAdSizes(ad.Height);
const sizes = [];
widths.forEach((width, i) => {
if (heights.length > i) {
if (heights.length > i && width <= el.clientWidth) {
sizes.push([width, heights[i]]);
}
});
Expand Down Expand Up @@ -134,29 +134,35 @@ export default async function decorate(block) {
console.error('Unknown ad type', block.dataset.adid);
return;
}
const sizes = getAdSizes(data);

block.classList.add('skeleton');
block.style.width = `${sizes[0][0]}px`;
block.style.minHeight = `${sizes[0][1]}px`;
window.googletag.cmd.push(() => {
const adSlot = window.googletag
.defineSlot(data.Path, sizes, id)
.addService(window.googletag.pubads());

const targets = getAdTargets(data);
if (targets) {
adSlot.setTargeting(...targets);
}
});
// Enable SRA and services.
window.googletag.cmd.push(() => {
window.googletag.pubads().enableSingleRequest();
window.googletag.pubads().enableLazyLoad();
window.googletag.enableServices();
});

window.googletag.cmd.push(() => {
window.googletag.display(block.id);
// Defer ad configuration until the block is rendered and we have a valid
// width to check against
window.setTimeout(() => {
const sizes = getAdSizes(block, data);
block.style.width = `${sizes[0][0]}px`;
block.style.minHeight = `${sizes[0][1]}px`;
window.googletag.cmd.push(() => {
const adSlot = window.googletag
.defineSlot(data.Path, sizes, id)
.addService(window.googletag.pubads());

const targets = getAdTargets(data);
if (targets) {
adSlot.setTargeting(...targets);
}
});
// Enable SRA and services.
window.googletag.cmd.push(() => {
window.googletag.pubads().enableSingleRequest();
window.googletag.pubads().enableLazyLoad();
window.googletag.enableServices();
});

window.googletag.cmd.push(() => {
window.googletag.display(block.id);
});
});

loadedObserver.observe(block, { attributes: true });
Expand Down
13 changes: 13 additions & 0 deletions blocks/pagination/pagination.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { decorateIcons } from '../../scripts/lib-franklin.js';

function createRelLink(rel, param) {
const link = document.createElement('link');
link.setAttribute('rel', rel);
link.setAttribute('href', `${window.location.pathname}?${param}`);
return link;
}

function renderContent(block) {
const usp = new URLSearchParams(window.location.search);
const limit = Number(usp.get('limit') || block.dataset.limit || 25);
Expand Down Expand Up @@ -28,6 +35,12 @@ function renderContent(block) {
${cards?.childElementCount >= limit ? `<li><a href="${window.location.pathname}?${nextParams}" aria-label="Next page"><span class="icon icon-chevron-wide"></span></a></li>` : ''}
</ul>
</nav>`;
if (page > 1 && !document.head.querySelector('link[rel="prev"]')) {
document.head.append(createRelLink('prev', prevParams));
}
if (cards?.childElementCount >= limit && !document.head.querySelector('link[rel="next"]')) {
document.head.append(createRelLink('next', nextParams));
}
decorateIcons(block);
}

Expand Down
Loading

0 comments on commit 393e978

Please sign in to comment.