Browse Source

Metadata adjustments (#313)

* Updated Index.html keywords

* Added og properties to contentview elements and keywords

* Groupsview seo adjustments

* Update index.html

* Update index.html

* SEO is now only italian

Try to see if this behaves good

* Removed main properties from index.html

* React-helmet-async usage

Restore of localized seo
Try usage of react-helmet-async

* Restored old index.html

Updated og properties
pull/317/head
Giuseppe Del Campo 3 months ago
committed by GitHub
parent
commit
d7a1816ace
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 102
      package-lock.json
  2. 1
      package.json
  3. 27
      public/index.html
  4. BIN
      public/logo/logo1280x720.png
  5. BIN
      public/logo/preview_logo.png
  6. 58
      src/services/LocalizationService.ts
  7. 27
      src/views/ContentView.tsx
  8. 112
      src/views/GroupsView.tsx
  9. 9
      src/views/MainView.tsx

102
package-lock.json

@ -3422,9 +3422,9 @@
"integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4="
},
"ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg=="
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
},
"ansi-styles": {
"version": "4.3.0",
@ -5063,12 +5063,12 @@
}
},
"color": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/color/-/color-3.1.3.tgz",
"integrity": "sha512-xgXAcTHa2HeFCGLE9Xs/R82hujGtu9Jd9x4NW3T34+OMs7VoPsjwzRczKHvTAHeJwWFwX5j15+MgAppE8ztObQ==",
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz",
"integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==",
"requires": {
"color-convert": "^1.9.1",
"color-string": "^1.5.4"
"color-convert": "^1.9.3",
"color-string": "^1.6.0"
},
"dependencies": {
"color-convert": {
@ -5100,9 +5100,9 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"color-string": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.4.tgz",
"integrity": "sha512-57yF5yt8Xa3czSEW1jfQDE79Idk0+AkN/4KWad6tbdxUmAs3MvjxlWSWD4deYytcRfoZ9nhKyFl1kj5tBvidbw==",
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.6.0.tgz",
"integrity": "sha512-c/hGS+kRWJutUBEngKKmk4iH3sD59MBkoxVapS/0wgpCz2u7XsNloxknyvBhzwEs1IbV36D9PwqLPJ2DTu3vMA==",
"requires": {
"color-name": "^1.0.0",
"simple-swizzle": "^0.2.2"
@ -5680,12 +5680,12 @@
"integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg=="
},
"cssnano": {
"version": "4.1.10",
"resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz",
"integrity": "sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ==",
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.11.tgz",
"integrity": "sha512-6gZm2htn7xIPJOHY824ERgj8cNPgPxyCSnkXc4v7YvNW+TdVfzgngHcEhy/8D11kUWRUMbke+tC+AUcUsnMz2g==",
"requires": {
"cosmiconfig": "^5.0.0",
"cssnano-preset-default": "^4.0.7",
"cssnano-preset-default": "^4.0.8",
"is-resolvable": "^1.0.0",
"postcss": "^7.0.0"
},
@ -5727,9 +5727,9 @@
}
},
"cssnano-preset-default": {
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.7.tgz",
"integrity": "sha512-x0YHHx2h6p0fCl1zY9L9roD7rnlltugGu7zXSKQx6k2rYw0Hi3IqxcoAGF7u9Q5w1nt7vK0ulxV8Lo+EvllGsA==",
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.8.tgz",
"integrity": "sha512-LdAyHuq+VRyeVREFmuxUZR1TXjQm8QQU/ktoo/x7bz+SdOge1YKc5eMN6pRW7YWBmyq59CqYba1dJ5cUukEjLQ==",
"requires": {
"css-declaration-sorter": "^4.0.1",
"cssnano-util-raw-cache": "^4.0.1",
@ -5759,7 +5759,7 @@
"postcss-ordered-values": "^4.1.2",
"postcss-reduce-initial": "^4.0.3",
"postcss-reduce-transforms": "^4.0.2",
"postcss-svgo": "^4.0.2",
"postcss-svgo": "^4.0.3",
"postcss-unique-selectors": "^4.0.1"
}
},
@ -6563,9 +6563,9 @@
"integrity": "sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA=="
},
"electron-to-chromium": {
"version": "1.3.666",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.666.tgz",
"integrity": "sha512-/mP4HFQ0fKIX4sXltG6kfcoGrfNDZwCIyWbH2SIcVaa9u7Rm0HKjambiHNg5OEruicTl9s1EwbERLwxZwk19aw=="
"version": "1.3.868",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.868.tgz",
"integrity": "sha512-kZYCHqwJ1ctGrYDlOcWQH+/AftAm/KD4lEnLDNwS0kKwx1x6dU4zv+GuDjsPPOGn/2TjnKBaZjDyjXaoix0q/A=="
},
"elliptic": {
"version": "6.5.4",
@ -8909,11 +8909,6 @@
"resolved": "https://registry.npmjs.org/hsla-regex/-/hsla-regex-1.0.0.tgz",
"integrity": "sha1-wc56MWjIxmFAM6S194d/OyJfnDg="
},
"html-comment-regex": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz",
"integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ=="
},
"html-dom-parser": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/html-dom-parser/-/html-dom-parser-1.0.1.tgz",
@ -9867,14 +9862,6 @@
"resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz",
"integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ=="
},
"is-svg": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-svg/-/is-svg-3.0.0.tgz",
"integrity": "sha512-gi4iHK53LR2ujhLVVj+37Ykh9GLqYHX6JOVXbLAucaG/Cqw9xwdFOjDM2qeifLs1sF1npXXFvDu0r5HNgCMrzQ==",
"requires": {
"html-comment-regex": "^1.1.0"
}
},
"is-symbol": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
@ -12096,9 +12083,9 @@
}
},
"node-releases": {
"version": "1.1.70",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.70.tgz",
"integrity": "sha512-Slf2s69+2/uAD79pVVQo8uSiC34+g8GWY8UH2Qtqv34ZfhYrxpYpfzs9Js9d6O0mbDmALuxaTlplnBTnSELcrw=="
"version": "1.1.77",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.77.tgz",
"integrity": "sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ=="
},
"node-sass": {
"version": "4.14.1",
@ -14247,11 +14234,10 @@
}
},
"postcss-svgo": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.2.tgz",
"integrity": "sha512-C6wyjo3VwFm0QgBy+Fu7gCYOkCmgmClghO+pjcxvrcBKtiKt0uCF+hvbMO1fyv5BMImRK90SMb+dwUnfbGd+jw==",
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.3.tgz",
"integrity": "sha512-NoRbrcMWTtUghzuKSoIm6XV+sJdvZ7GZSc3wdBN0W19FTtp2ko8NqLsgoh/m9CzNhU3KLPvQmjIwtaNFkaFTvw==",
"requires": {
"is-svg": "^3.0.0",
"postcss": "^7.0.0",
"postcss-value-parser": "^3.0.0",
"svgo": "^1.0.0"
@ -14672,9 +14658,9 @@
}
},
"react-dev-utils": {
"version": "11.0.3",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-11.0.3.tgz",
"integrity": "sha512-4lEA5gF4OHrcJLMUV1t+4XbNDiJbsAWCH5Z2uqlTqW6dD7Cf5nEASkeXrCI/Mz83sI2o527oBIFKVMXtRf1Vtg==",
"version": "11.0.4",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-11.0.4.tgz",
"integrity": "sha512-dx0LvIGHcOPtKbeiSUM4jqpBl3TcY7CDjZdfOIcKeznE7BWr9dg0iPG90G5yfVQ+p/rGNMXdbfStvzQZEVEi4A==",
"requires": {
"@babel/code-frame": "7.10.4",
"address": "1.1.2",
@ -14859,6 +14845,18 @@
"react-side-effect": "^2.1.0"
}
},
"react-helmet-async": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/react-helmet-async/-/react-helmet-async-1.1.2.tgz",
"integrity": "sha512-LTTzDDkyIleT/JJ6T/uqx7Y8qi1EuPPSiJawQY/nHHz0h7SPDT6HxP1YDDQx/fzcVxCqpWEEMS3QdrSrNkJYhg==",
"requires": {
"@babel/runtime": "^7.12.5",
"invariant": "^2.2.4",
"prop-types": "^15.7.2",
"react-fast-compare": "^3.2.0",
"shallowequal": "^1.1.0"
}
},
"react-is": {
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
@ -16392,6 +16390,11 @@
"kind-of": "^6.0.2"
}
},
"shallowequal": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz",
"integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ=="
},
"shebang-command": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
@ -17627,9 +17630,9 @@
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
},
"tmpl": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz",
"integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE="
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
"integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw=="
},
"to-arraybuffer": {
"version": "1.0.1",
@ -18822,8 +18825,7 @@
},
"ssri": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
"integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
"resolved": "",
"requires": {
"figgy-pudding": "^3.5.1"
}

1
package.json

@ -31,6 +31,7 @@
"react-cookie": "^4.0.3",
"react-dom": "17.0.1",
"react-helmet": "^6.1.0",
"react-helmet-async": "^1.1.2",
"react-jsx-parser": "^1.28.4",
"react-localization": "^1.0.17",
"react-router": "5.2.0",

27
public/index.html

@ -1,29 +1,32 @@
<!DOCTYPE html>
<html lang="it">
<html>
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/logo/unimi150.png" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="author" content="Giuseppe Del Campo, Manuele Lucchi" />
<meta name="description" content="Sito web ufficiale del Network StudentiUniMi: gruppi WhatsApp rimpiazziati da Telegram, servizi e molto altro. Il network più grande dell'Università degli Studi di Milano." />
<meta name="keywords" content="Network StudentiUniMi, Studenti UniMi, Studenti Unimi, Network statale informatica, Gruppi telegram unimi informatica, Siti web corsi unimi informatica, Faq corsi unimi informatica, Wiki Unimi, Network Studenti Unimi" />
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://studentiunimi.it https://code.jquery.com https://cdn.jsdelivr.net https://static.cloudflareinsights.com; font-src *;">
<title>Network StudentiUniMi - Gruppi, servizi e molto altro</title>
<meta name="description" content="Sito web ufficiale del Network StudentiUniMi: gruppi WhatsApp rimpiazziati da Telegram, servizi e molto altro. Il network più grande dell'Università degli Studi di Milano." />
<meta name="keywords" content="Network StudentiUniMi, Studenti UniMi, Studenti Unimi, StudentiUniMi, Network statale informatica, Gruppi telegram unimi, Gruppi unimi, Siti web corsi unimi, Faq corsi unimi, Wiki Unimi, Network Studenti Unimi" />
<link rel="canonical" hrefLang="it" href="https://studentiunimi.it/" />
<!-- Open Graph Data -->
<meta property="og:title" content="Network StudentiUniMi"/>
<meta property="og:description" content="Sito web del Network StudentiUniMi, contenente i collegamenti a siti web, gruppi telegram e wiki dei corsi didattici delle lauree triennali e magistrali dell'Università degli Studi di Milano." />
<!-- Open Graph Properties -->
<meta property="og:title" content="Network StudentiUniMi - Gruppi, servizi e molto altro" />
<meta property="og:description" content="Sito web ufficiale del Network StudentiUniMi: gruppi WhatsApp rimpiazziati da Telegram, servizi e molto altro. Il network più grande dell'Università degli Studi di Milano." />
<meta property="og:image" content="%PUBLIC_URL%/logo/preview_logo.png" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://studentiunimi.it" />
<meta property="og:image" content="%PUBLIC_URL%/logo/logo1280x720.png" />
<meta name="twitter:card" content="summary_large_image">
<title>Network StudentiUniMi</title>
<meta property="og:url" content="https://studentiunimi.it/" />
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!-- Cloudflare Web Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "a01aada8d53f44709781f2d04dc04e4b"}'></script><!-- End Cloudflare Web Analytics -->
<!-- Cloudflare Web Analytics -->
<script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "a01aada8d53f44709781f2d04dc04e4b"}'></script>
<!-- End Cloudflare Web Analytics -->
</body>
</html>

BIN
public/logo/logo1280x720.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

BIN
public/logo/preview_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

58
src/services/LocalizationService.ts

@ -1,6 +1,16 @@
import LocalizedStrings, { LocalizedStringsMethods } from 'react-localization';
import ILocalizationStrings from '../models/ILocalizationStrings';
interface helmet {
homepage: any,
courses: any,
services: any,
rules: any,
university: any,
organization: any,
degreeLoaded: any
};
class LocalizationService {
private static data?: LocalizedStringsMethods & ILocalizationStrings;
@ -8,15 +18,7 @@ class LocalizationService {
if (LocalizationService.data == null || LocalizationService.data === undefined) {
LocalizationService.data = new LocalizedStrings<ILocalizationStrings>({
it: {
helmet: {
homepage: { title: "Network StudentiUniMi - Gruppi, servizi e molto altro", description: "Sito web ufficiale del Network StudentiUniMi: gruppi WhatsApp rimpiazziati da Telegram, servizi e molto altro. Il network più grande dell'Università degli Studi di Milano." },
courses: { title: "Tutti i gruppi | Network StudentiUniMi", description: "Tutti i gruppi Telegram per tutti i corsi di laurea (triennali, magistrali, lauree a ciclo unico) dell'Università degli Studi di Milano. Entra, chiedi informazioni e conosci persone nuove grazie al Network StudentiUniMi." },
services: { title: "Servizi e link rapidi | Network StudentiUniMi", description: "Stanco dei disservizi di unimia? Da questa pagina alternativa puoi accedere a tutti i link utili dell'Università degli Studi di Milano." },
rules: { title: "Regolamento dei gruppi | Network StudentiUniMi", description: "Il regolamento ufficiale del Network StudentiUniMi." },
university: { title: "Informazioni dall'Ateneo e rappresentanti | Network StudentiUniMi", description: "Rimani aggiornato con tutte le informazioni e i rappresentanti dell'Università degli Studi di Milano, offerto dal Network StudentiUniMi." },
organization: { title: "Chi siamo | Network StudentiUniMi", description: "Chi siamo? Scopri l'organizzazione dietro il Network StudentiUniMi, il più grande network dell'Università degli Studi di Milano." },
degreeLoaded: { title1: 'Gruppi di ', title2: ' | Network StudentiUniMi', description1: 'Tutti i link dei gruppi Telegram del corso di laurea di ', description2: " dell'Università degli Studi di Milano offerti dal Network StudentiUniMi." }
},
helmet: LocalizationService.getHelmetITAProperties(),
loading: "Caricamento in corso..",
telegramGroup: 'Gruppo Telegram',
errorLoadingDepartments: 'Errore durante il caricamento dei dipartimenti.',
@ -231,20 +233,8 @@ class LocalizationService {
en: {
helmet: {
homepage: { title: "Network StudentiUniMi - Groups, services and much more", description: "Official website of StudentiUniMi Network: WhatsApp groups replaced by Telegram ones, services and much more. The largest network of the University of Milan." },
courses: { title: "Groups | Network StudentiUniMi", description: "All Telegram groups for all degree courses (three-year, master, single-cycle degrees) of the University of Milan. Join, ask for information and meet new people thanks to the StudentiUniMi Network." },
services: { title: "Services | Network StudentiUniMi", description: "Tired of unimia's inefficiencies? On this alternative page you can access all the useful links of the University of Milan." },
rules: { title: "Groups rules | Network StudentiUniMi", description: "The official rules of the StudentiUniMi Network." },
university: { title: "University redirects | Network StudentiUniMi", description: "Stay up-to-date with all the information and representatives of the University of Milan, offered by the StudentiUniMi Network." },
organization: { title: "Organization | Network StudentiUniMi", description: "Who are we? Discover the organization behind the StudentiUniMi Network, the largest network of the University of Milan." },
degreeLoaded: { title1: 'Groups of ', title2: ' | Network StudentiUniMi', description1: 'All the links of the Telegram groups of ', description2: ' degree of the University of Milan. Offered by StudentiUniMi Network.' }
},
helmet: LocalizationService.getHelmetENGProperties(),
loading: "Loading..",
telegramGroup: 'Telegram Group',
errorLoadingDepartments: 'Error has occured while retrieving departments.',
@ -467,6 +457,30 @@ class LocalizationService {
static getLanguage = () => {
return LocalizationService.data?.getLanguage();
}
static getHelmetITAProperties = () : helmet => {
return {
homepage: { title: "Network StudentiUniMi - Gruppi, servizi e molto altro", description: "Sito web ufficiale del Network StudentiUniMi: gruppi WhatsApp rimpiazziati da Telegram, servizi e molto altro. Il network più grande dell'Università degli Studi di Milano." },
courses: { title: "Tutti i gruppi | Network StudentiUniMi", description: "Tutti i gruppi Telegram per tutti i corsi di laurea (triennali, magistrali, lauree a ciclo unico) dell'Università degli Studi di Milano. Entra, chiedi informazioni e conosci persone nuove grazie al Network StudentiUniMi." },
services: { title: "Servizi e link rapidi | Network StudentiUniMi", description: "Stanco dei disservizi di unimia? Da questa pagina alternativa puoi accedere a tutti i link utili dell'Università degli Studi di Milano." },
rules: { title: "Regolamento dei gruppi | Network StudentiUniMi", description: "Il regolamento ufficiale del Network StudentiUniMi." },
university: { title: "Informazioni dall'Ateneo e rappresentanti | Network StudentiUniMi", description: "Rimani aggiornato con tutte le informazioni e i rappresentanti dell'Università degli Studi di Milano, offerto dal Network StudentiUniMi." },
organization: { title: "Chi siamo | Network StudentiUniMi", description: "Chi siamo? Scopri l'organizzazione dietro il Network StudentiUniMi, il più grande network dell'Università degli Studi di Milano." },
degreeLoaded: { title1: 'Gruppi di ', title2: ' | Network StudentiUniMi', description1: 'Tutti i link dei gruppi Telegram del corso di laurea di ', description2: " dell'Università degli Studi di Milano offerti dal Network StudentiUniMi." }
}
}
static getHelmetENGProperties = () : helmet => {
return {
homepage: { title: "Network StudentiUniMi - Groups, services and much more", description: "Official website of StudentiUniMi Network: WhatsApp groups replaced by Telegram ones, services and much more. The largest network of the University of Milan." },
courses: { title: "Groups | Network StudentiUniMi", description: "All Telegram groups for all degree courses (three-year, master, single-cycle degrees) of the University of Milan. Join, ask for information and meet new people thanks to the StudentiUniMi Network." },
services: { title: "Services | Network StudentiUniMi", description: "Tired of unimia's inefficiencies? On this alternative page you can access all the useful links of the University of Milan." },
rules: { title: "Groups rules | Network StudentiUniMi", description: "The official rules of the StudentiUniMi Network." },
university: { title: "University redirects | Network StudentiUniMi", description: "Stay up-to-date with all the information and representatives of the University of Milan, offered by the StudentiUniMi Network." },
organization: { title: "Organization | Network StudentiUniMi", description: "Who are we? Discover the organization behind the StudentiUniMi Network, the largest network of the University of Milan." },
degreeLoaded: { title1: 'Groups of ', title2: ' | Network StudentiUniMi', description1: 'All the links of the Telegram groups of ', description2: ' degree of the University of Milan. Offered by StudentiUniMi Network.' }
}
}
}
export default LocalizationService;

27
src/views/ContentView.tsx

@ -7,7 +7,7 @@ import UniversityView from './UniversityView';
import LocalizationService from '../services/LocalizationService';
import { Route, Switch } from 'react-router-dom';
import { withCookies } from 'react-cookie';
import { Helmet } from "react-helmet";
import { Helmet } from 'react-helmet-async';
const ContentView = () => {
const locale = LocalizationService.strings();
@ -25,7 +25,12 @@ const ContentView = () => {
<meta charSet="utf-8" />
<title>{locale?.helmet.homepage.title}</title>
<meta name="description" content={locale?.helmet.homepage.description} />
<meta name="keywords" content="Network StudentiUniMi, Studenti UniMi, Studenti Unimi, StudentiUniMi, Network statale informatica, Gruppi telegram unimi, Gruppi unimi, Siti web corsi unimi, Faq corsi unimi, Wiki Unimi, Network Studenti Unimi" />
<link rel="canonical" hrefLang={language} href="https://studentiunimi.it/home/" />
<meta property="og:title" content={locale?.helmet.homepage.title} />
<meta property="og:description" content={locale?.helmet.homepage.description} />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://studentiunimi.it/home/" />
</Helmet>
<HomeView/>
</>
@ -42,7 +47,12 @@ const ContentView = () => {
<meta charSet="utf-8" />
<title>{locale?.helmet.services.title}</title>
<meta name="description" content={locale?.helmet.services.description} />
<meta name="keywords" content="Unimia StudentiUnimi, Servizi StudentiUnimi, Studenti Unimi, StudentiUnimi, Network StudentiUnimi, Network Studenti Unimi, Servizi StudentiUnimi, Servizi Studenti Unimi, StudentiUnimi Services, Network StudentiUnimi Services" />
<link rel="canonical" hrefLang={language} href="https://studentiunimi.it/services/" />
<meta property="og:title" content={locale?.helmet.services.title} />
<meta property="og:description" content={locale?.helmet.services.description} />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://studentiunimi.it/services/" />
</Helmet>
<ServicesView/>
</>
@ -53,7 +63,12 @@ const ContentView = () => {
<meta charSet="utf-8" />
<title>{locale?.helmet.rules.title}</title>
<meta name="description" content={locale?.helmet.rules.description} />
<meta name="keywords" content="Network StudentiUnimi regolamento gruppi, StudentiUnimi regolamento gruppi, Network StudentiUnimi rules, StudentiUnimi rules, Group rules network studentiunimi, Group rules studentiunimi, Studenti Unimi, StudentiUnimi, Network StudentiUnimi, Network Studenti Unimi" />
<link rel="canonical" hrefLang={language} href="https://studentiunimi.it/rules/" />
<meta property="og:title" content={locale?.helmet.rules.title} />
<meta property="og:description" content={locale?.helmet.rules.description} />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://studentiunimi.it/rules/" />
</Helmet>
<RulesView/>
</>
@ -64,7 +79,12 @@ const ContentView = () => {
<meta charSet="utf-8" />
<title>{locale?.helmet.university.title}</title>
<meta name="description" content={locale?.helmet.university.description} />
<meta name="keywords" content="Network StudentiUnimi ateneo, StudentiUnimi ateneo, Network StudentiUnimi ateneo, StudentiUnimi ateneo, Network StudentiUnimi rappresentanti, StudentiUnimi rappresentanti, Network StudentiUnimi rappresentanti, StudentiUnimi rappresentanti, Studenti Unimi, StudentiUnimi, Network StudentiUnimi, Network Studenti Unimi" />
<link rel="canonical" hrefLang={language} href="https://studentiunimi.it/representatives/" />
<meta property="og:title" content={locale?.helmet.university.title} />
<meta property="og:description" content={locale?.helmet.university.description} />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://studentiunimi.it/representatives/" />
</Helmet>
<UniversityView/>
</>
@ -74,8 +94,13 @@ const ContentView = () => {
<Helmet>
<meta charSet="utf-8" />
<title>{locale?.helmet.organization.title}</title>
<meta name="keywords" content="Network StudentiUnimi chi siamo?, StudentiUnimi chi siamo?, Network StudentiUnimi chi siamo, StudentiUnimi chi siamo, Network StudentiUnimi who we are, StudentiUnimi organization, Network StudentiUnimi organization, StudentiUnimi who we are, Studenti Unimi, StudentiUnimi, Network StudentiUnimi, Network Studenti Unimi" />
<meta name="description" content={locale?.helmet.organization.description} />
<link rel="canonical" hrefLang={language} href="https://studentiunimi.it/organization/" />
<meta property="og:title" content={locale?.helmet.organization.title} />
<meta property="og:description" content={locale?.helmet.organization.description} />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://studentiunimi.it/organization/" />
</Helmet>
<OrganizationView/>
</>

112
src/views/GroupsView.tsx

@ -15,8 +15,8 @@ import AdminsList from '../components/Groups/AdminsList';
import AdditionalGroupsView from '../components/Groups/AdditionalGroups';
import { Autocomplete } from '../components/Groups/Autocomplete';
import { ISuggestionItem } from '../components/Groups/Autocomplete_types';
import { Helmet } from "react-helmet";
import { IconButton, IIconProps, ITooltipHostStyles, TooltipHost } from "@fluentui/react";
import { Helmet } from 'react-helmet-async';
import { IconButton, IIconProps, ITooltipHostStyles, TooltipHost } from '@fluentui/react';
initializeIcons();
@ -48,8 +48,6 @@ const GroupsView = () => {
let didMount = React.useRef(false);
const resetIcon: IIconProps = { iconName: 'Refresh' };
const calloutProps = { gapSpace: 10 };
// The TooltipHost root uses display: inline by default.
// If that's causing sizing issues or tooltip positioning issues, try overriding to inline-block.
const hostStyles: Partial<ITooltipHostStyles> = { root: { display: 'inline-block' } };
/* States */
@ -59,7 +57,12 @@ const GroupsView = () => {
let [searchData, setSearchData] = React.useState<ISuggestionItem[]>([]); // Array di ISuggestionItem (contenente anche Degree per ogni elemento)
let [courses, setCourses] = React.useState<CourseDegree[]>([]); // Corsi di insegnamento
let [reactHelmetContent, setReactHelmetContent] = React.useState<reactHelmetContent>(
{ title: locale?.helmet.courses.title!, description: locale?.helmet.courses.description!, href: 'https://studentiunimi.it/courses/', hrefLang: language! }
{
title: locale?.helmet.courses.title!,
description: locale?.helmet.courses.description!,
href: 'https://studentiunimi.it/courses/',
hrefLang: language!
}
);
const [loadingCourses, setLoadingCourses] = React.useState<boolean>(false);
@ -221,58 +224,63 @@ const GroupsView = () => {
return (
<>
<Helmet>
<meta charSet="utf-8" />
<title>{reactHelmetContent.title}</title>
<meta name="description" content={reactHelmetContent.description} />
<link rel="canonical" href={reactHelmetContent.href} />
</Helmet>
<div className="pt-5 courses">
<Container>
<div className="mb-3">
<div className="mb-1"><Text variant="medium" styles={semibold} style={{textTransform: 'uppercase', color: theme.palette.themePrimary}}>{locale?.groups.groupsSection.text1}</Text></div>
<span className="mr-1"><Text variant="xLarge">{locale?.groups.groupsSection.text2}</Text></span>
<TooltipHost
content={locale?.groups.resetSection}
calloutProps={calloutProps}
styles={hostStyles}
>
<IconButton iconProps={resetIcon} onClick={resetSection} />
</TooltipHost>
<Helmet>
<meta charSet="utf-8" />
<title>{reactHelmetContent.title}</title>
<meta name="description" content={reactHelmetContent.description} />
<link rel="canonical" href={reactHelmetContent.href} />
<meta name="keywords" content={reactHelmetContent.title + ", " + reactHelmetContent.description + ", Network StudentiUniMi, Studenti UniMi, Network Studenti Unimi, Gruppi telegram unimi, Gruppi unimi, Siti web corsi unimi, Faq corsi unimi, Wiki Unimi"} />
<meta property="og:title" content={reactHelmetContent.title} />
<meta property="og:description" content={reactHelmetContent.description} />
<meta property="og:type" content="website" />
<meta property="og:url" content={reactHelmetContent.href} />
</Helmet>
<div className="pt-5 courses">
<Container>
<div className="mb-3">
<div className="mb-1"><Text variant="medium" styles={semibold} style={{textTransform: 'uppercase', color: theme.palette.themePrimary}}>{locale?.groups.groupsSection.text1}</Text></div>
<span className="mr-1"><Text variant="xLarge">{locale?.groups.groupsSection.text2}</Text></span>
<TooltipHost
content={locale?.groups.resetSection}
calloutProps={calloutProps}
styles={hostStyles}
>
<IconButton iconProps={resetIcon} onClick={resetSection} />
</TooltipHost>
</div>
<div className="search-box mb-4">
<Autocomplete
items={searchData}
searchTitle={locale?.groups.findDegreeByName}
suggestionCallback={(item) => entitySelectHandler(item)}
searchCallback={searchTextHandler}
changeCallback={(text) => updateDegreesForSearchBox(text)}
value={degreeTextSearch}
/>
</div>
</Container>
<div style={{ display: selectedDegree !== '' ? 'block' : 'none' }}>
<GroupList degree={loadedDegree!} courses={courses} loadingCourses={loadingCourses} errorLoadingCourses={errorLoadingCourses} />
<DegreeInformations degree={loadedDegree!} />
<AdminsList degree={loadedDegree!} />
</div>
<div className="search-box mb-4">
<Autocomplete
items={searchData}
searchTitle={locale?.groups.findDegreeByName}
suggestionCallback={(item) => entitySelectHandler(item)}
searchCallback={searchTextHandler}
changeCallback={(text) => updateDegreesForSearchBox(text)}
value={degreeTextSearch}
/>
</div>
<Container className="pb-4">
<Separator className="mb-3" />
<div className="mb-3">
<div className="mb-1"><Text variant="medium" styles={semibold} style={{ textTransform: 'uppercase', color: theme.palette.themePrimary }}>{locale?.groups.extraGroupsSection.text1}</Text></div>
<Text variant="xLarge">{locale?.groups.extraGroupsSection.text2}</Text>
</div>
</Container>
<AdditionalGroupsView />
<div style={{ display: selectedDegree !== '' ? 'block' : 'none' }}>
<GroupList degree={loadedDegree!} courses={courses} loadingCourses={loadingCourses} errorLoadingCourses={errorLoadingCourses} />
<DegreeInformations degree={loadedDegree!} />
<AdminsList degree={loadedDegree!} />
</Container>
</div>
<Container className="pb-4">
<Separator className="mb-3" />
<div className="mb-3">
<div className="mb-1"><Text variant="medium" styles={semibold} style={{ textTransform: 'uppercase', color: theme.palette.themePrimary }}>{locale?.groups.extraGroupsSection.text1}</Text></div>
<Text variant="xLarge">{locale?.groups.extraGroupsSection.text2}</Text>
</div>
<AdditionalGroupsView />
</Container>
</div>
</>
);
};

9
src/views/MainView.tsx

@ -7,6 +7,7 @@ import { BrowserRouter as Router } from "react-router-dom";
import { ThemeProvider } from '@fluentui/react-theme-provider';
import { buildLightTheme, buildDarkTheme } from '../services/Themes';
import { CookiesProvider, useCookies, withCookies } from 'react-cookie';
import { HelmetProvider } from 'react-helmet-async';
import { loadTheme } from '@fluentui/react';
import { addDays } from '../services/Utils';
@ -63,9 +64,11 @@ const MainView = () => {
<Router basename={process.env.PUBLIC_URL}>
<CookiesProvider>
<ThemeProvider applyTo="body" theme={theme ? darkTheme : lightTheme}>
<Header/>
<ContentView/>
<Footer changeTheme={changeTheme} changePalette={changePalette} changeLanguage={changeLanguage}/>
<HelmetProvider>
<Header/>
<ContentView/>
<Footer changeTheme={changeTheme} changePalette={changePalette} changeLanguage={changeLanguage}/>
</HelmetProvider>
</ThemeProvider>
</CookiesProvider>
</Router>

Loading…
Cancel
Save