A campaign to identify and shame people who marched at a bloody right-wing rally in Charlottesville has so far forced two universities to condemn white supremacy – even as the outed students defend their decisions to attend.

Not everyone who went to the weekend rallies was a student, of course. Hundreds of people from all walks of life joined neo-Nazis, Ku Klux Klan members and white nationalists for a weekend event dubbed “Unite the Right.”

As marches and countermarches devolved into violence – culminating Saturday when a man rammed his car into a crowd and killed a woman – the Twitter user @YesYoureRacist asked for help identifying “Nazis marching in Charlottesville.”

The anonymous user linked to copious photos and videos of the rally – swastikas and crowds of shouting white men.

Within minutes, names began to pour in, and consequences began to unfurl in home towns across the country.

The first target was a man spotted in a crowd of tiki-torch wielding marchers, whom Twitter users identified as a cook at a hot dog restaurant in Berkeley, Calif.

By Saturday evening, the restaurant had posted signs in its windows and sent a statement to the San Francisco Chronicle – the cook was no longer employed.

By then, @YesYoureRacist was already on to a new target: Peter Cvjetanovic, 20, whom more than 10,000 petition signers now think should be expelled from the University of Nevada.

“I have received death threats,” Cvjetanovic told the Reno Gazette-Journal after his name got out, but promised to nevertheless “defend tooth and nail my views as a white nationalist.”

He told KTVN News that “I came to this march with the message that white European culture has a right to be here just like every other culture” – and later wrote to the Las Vegas Review-Journal: “I went to honor the heritage of white culture here in the United States.”

These arguments apparently didn’t sit well with the University of Nevada.

“Racism and white supremacist movements have a corrosive effect on our society,” school President Marc Johnson wrote in an open letter. “We denounce any movement that targets individuals due to the color of their skin, their religious beliefs, political beliefs, sexual orientation, ability/disability, or whether they were born in our country.”

Administrators told The Post that Cvjetanovic also had a job on campus, and “the university is still monitoring the situation and reviewing information.”

Cvjetanovic condemned all violence in his interviews and said he left the Charlottesville rally before an alleged Nazi sympathizer was accused of plowing a car into a crowd.

“These last few days have turned into a disaster,” Cvjetanovic told ABC affiliate KOLO. But, he said, “I believe that cultures are being threatened. … Everyone is melding together.”

Cvjetanovic was infamous on campus for that kind of talk, according to Ed Donofrio, a self-described socialist who told The Post he used to shared a dorm with the self-avowed white nationalist.

“I remember having a discussion with him one time about the whole build-the-wall thing,” Donofrio said, referring to President Trump’s plan to wall off the border with Mexico. “He was [a] fan of shooting immigrants coming across.”

Another rally-goer being shamed on Twitter didn’t actually need to be outed, as he had announced his attendance and live-streamed the event for his fans.

All the same, James Allsup’s presence in Virginia caused a scandal back home, where the president of his school, Washington State University, released a statement condemning “racism and Nazism of any kind.”

James Allsup, who leads the College Republicans at the university, later blamed “a handful of Nazi flag-waving morons” for hijacking an otherwise respectable right-wing event.

“I would consider myself paleo-conservative,” Allsup told KREM 2. “More of a right-wing libertarian.”

And indeed, he made sure in his live-stream to disavow prominent racists like David Duke, who was also at Charlottesville.

“I talked to dozens of rally attendees that were uncomfortable and put off by the Nazi imagery. Myself included,” the student wrote on Twitter. “Very, very bad look.”

But when Allsup was at the rally, ranting to Infowars that “low-IQ migrants” were going to destroy the country unless legal immigration was banned, a man beside him interrupted.

“Name international Jewry!” the man said. “That’s who the globalists are.”

Allsup didn’t look so uncomfortable. He grinned and laughed as the marchers around him cheered.