data_models: add Google Scholar as a social network (#85)

This commit is contained in:
Sina Atalay 2024-05-29 15:57:10 +03:00
parent 10faf65544
commit b0a5bb4663
1 changed files with 6 additions and 0 deletions

View File

@ -838,6 +838,7 @@ SocialNetworkName = Literal[
"StackOverflow", "StackOverflow",
"ResearchGate", "ResearchGate",
"YouTube", "YouTube",
"Google Scholar",
] ]
available_social_networks = get_args(SocialNetworkName) available_social_networks = get_args(SocialNetworkName)
@ -908,6 +909,7 @@ class SocialNetwork(RenderCVBaseModel):
"StackOverflow": "https://stackoverflow.com/users/", "StackOverflow": "https://stackoverflow.com/users/",
"ResearchGate": "https://researchgate.net/profile/", "ResearchGate": "https://researchgate.net/profile/",
"YouTube": "https://youtube.com/", "YouTube": "https://youtube.com/",
"Google Scholar": "https://scholar.google.com/citations?user=",
} }
url = url_dictionary[self.network] + self.username url = url_dictionary[self.network] + self.username
@ -1018,6 +1020,7 @@ class CurriculumVitae(RenderCVBaseModel):
"Twitter": "\\faTwitter", "Twitter": "\\faTwitter",
"ResearchGate": "\\faResearchgate", "ResearchGate": "\\faResearchgate",
"YouTube": "\\faYoutube", "YouTube": "\\faYoutube",
"Google Scholar": "\\faGraduationCap",
} }
for social_network in self.social_networks: for social_network in self.social_networks:
clean_url = social_network.url.replace("https://", "").rstrip("/") clean_url = social_network.url.replace("https://", "").rstrip("/")
@ -1031,6 +1034,9 @@ class CurriculumVitae(RenderCVBaseModel):
if social_network.network == "StackOverflow": if social_network.network == "StackOverflow":
username = social_network.username.split("/")[1] username = social_network.username.split("/")[1]
connection["placeholder"] = username connection["placeholder"] = username
if social_network.network == "Google Scholar":
connection["placeholder"] = "Google Scholar"
connections.append(connection) connections.append(connection)
return connections return connections