Arthur Sulzberger Jr., chairman of The New York Times Co., speaks during the New York Times DealBook conference in New York.

This hasn't been a good year so far for online publishers.

Digital media stalwarts BuzzFeed, Vice and Verizon Media Group, which includes HuffPo and Yahoo, all recently announced major layoffs. New York Times columnist Farhad Manjoo was so upset about the BuzzFeed layoffs, he wrote that they were "devastating to democracy."

Manjoo noted that these pure-play companies relied heavily on digital distribution platforms controlled by tech companies such as Facebook, Twitter and Google. These companies "have no economic incentive for symbiosis" with the media providers, he said, and instead can rely on user-generated content to attract audiences and advertisers.

Paradoxically, there's at least one company that's actually doing very well in the new digital media era: The New York Times.

On Wednesday, the Times announced Q4 2018 earnings that beat expectations, sending the company's stock up more than 12 percent.

The reason was not a resurgence in print. In fact, print ad revenues dropped 6.5 percent from 2017 to 2018, and total print subscription revenues were up only 3.4 percent for the year.

But the company's digital business is thriving.

The Times said it booked $709 million in digital revenue in 2018, bolstered primarily by 17.7 percent growth in digital subscription revenue for the year. The company added 265,000 digital subscribers during the quarter, for a total of 3.4 million total digital subscribers, up 27 percent from the end of 2017. It's well on its way to reaching its goal of $800 million in digital revenue by 2020 and 10 million digital subscribers by 2025.

A lot of this growth can be attributable to President Donald Trump, whose disdain for the media is well known. The Times saw a big bump in subscriptions after Trump's election, and its often-critical coverage of the president has found a devoted audience.

But there's a larger point at play here, too. The Times was early to buck the business model of most pure-play digital media companies, which was to chase massive audiences by publishing free content that was optimized to go viral through social platforms such as Facebook. This led to a race-to-the-bottom of listicles and slideshows and "The one reason" clickbait headlines. In the meantime, as fast as these publishers grew their audience, all of the ad revenue growth went to the biggest platform aggregators, mostly Facebook and Google.

The Times did cooperate with Facebook on some of its initiatives, such as Instant Articles, which reformatted articles to make them more attractive on Facebook, particularly its mobile site. And longtime media watchers may have noticed that the Times headlines are sometimes a little more risque and catchier than they used to be, a possible concession to the massive competition from online publishers.

But the company's digital business model has always been pretty straightforward: Publish journalism that people want to read, give them a taste for free and then ask them to pay for it.

So far, it seems to be working quite well. And not just at the Times. Amazon CEO Jeff Bezos bought The Washington Post in 2013 and made a number of changes on the back end but also put up a strong paywall. In a 2017 speech, Bezos noted that every time the Post made the paywall stricter, more people paid.

"This industry spent 20 years teaching everyone in the world that news should be free. The truth is, readers are smarter than that. They know high-quality journalism is expensive to produce, and they are willing to pay for it, but you have to ask them. We've tightened our paywall, and every time we've tightened our paywall, subscriptions go up."

Now, digital media publishers are racing to follow the lead of the Times and the Post, with everybody from Bloomberg to Business Insider to Conde Nast instituting paywalls. Consumers may soon reach the burnout point with paywalls, leading to an opportunity for the kind of bundled product that has been so successful for the pay-TV industry.

But the lesson for now is clear. People will pay for quality journalism, if you give them an opportunity.

WATCH: Jon Fortt, Farhad Manjoo and Jeff Jarvis discuss cutting back on social media