New Website in VueJS #6
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
fast issue
help wanted
invalid
long issue
pain 🫠
question
web world
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: adm/website#6
Loading…
Reference in a new issue
No description provided.
Delete branch "new-website"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Yay no more hugo!!
Ho reimplementato il sito in vue, "sembra come prima" ma non lo è.
Ho tenuto la cosa comoda di avere i contenuti in markdown per incentivarci ad inserire e aggiornare il sito senza sbatti.
Comunque ho scritto tutto nel readme :)
Prossimi step:
Se trovate bug o cose da cambiare segnalatelo che vedo di fixare prima del merge u.u
Vi lascio qualche screen di anteprima

@ -0,0 +1,130 @@<template>secondo me è un po piccolino, preferirei il testo più grande o anche più grande tutto
ma dici le scritte dentro all'header, il loghetto o proprio tutto?
vedo che ci sono tanti file di fonts, non è meglio scaricarli durante il build o qualcosa del genere?
Hi, the site looks great, but we have to fix a couple of things before merge :)
I've already left some comments around the code, here i'll leave some of more generale things that do not belongs to any file in particular.
#inside a codeblock is considered a chapter. So for example under wiki/medio we have "once a at 10" as a chapter in the sidebar@ -1,8 +1,9 @@---title: '{{ replace .File.ContentBaseName "-" " " | title }}'Do we need the brackets? We are not parsing this as a jinja template...
@ -0,0 +4,4 @@import { fileURLToPath } from "url";const __filename = fileURLToPath(import.meta.url);const __dirname = path.dirname(__filename);We could add
../at _dirname as we add it on every part of the code on this page@ -0,0 +29,4 @@* @param {string} title - Il titolo da scrivere* @param {string} outputPath - Percorso dove salvare l'immagine*/export async function generateOGImage(title, outputPath) {Do we need to export this func? We don't use it anywhere outside this file
@ -0,0 +103,4 @@/*** Genera immagini OG per tutti i contenuti markdown*/export async function generateAllOGImages() {Do we need to export this func? We don't use it anywhere outside this file
@ -0,0 +105,4 @@*/export async function generateAllOGImages() {const contentDir = path.join(__dirname, "../content");const publicDir = path.join(__dirname, "../public/og");The OG images are placed in /public/og, but after that no ones read them or interact with them. They are also not present in the build files after
pnpm run build, so they don't work :)@ -0,0 +118,4 @@if (title) {const relativePath = path.relative(contentDir, file);const slug = relativePath.replace(/\.md$/, "").replace(/\\/g, "/");It's longer but for path normalization should be better to use:
@ -0,0 +155,4 @@* @param {string} content* @returns {string|null}*/function extractTitle(content) {Also here we don't need a custom parser, we could use https://www.npmjs.com/package/gray-matter
@ -0,0 +171,4 @@}// Esegui lo script se chiamato direttamenteif (import.meta.url.startsWith("file:")) {Do we really need this trick to call the script itself? Could we just use a simple main()?
@ -0,0 +137,4 @@const repoRoot = process.cwd();const contentRoot = path.resolve(repoRoot, "content");const archetypePath = path.resolve(repoRoot, "archetypes", "default.md");Does it make sense to have the template as a file? Because we only read it from here
@ -0,0 +1,20 @@<template>This file is never used
@ -0,0 +1,14 @@<template>In shorter pages foot is in the middle of the page. I would force it at the end, always
@ -0,0 +1,14 @@<template><footer class="bg-neutral border-t border-base-300 mt-16 py-6"><div class="container mx-auto px-4 text-center text-sm text-secondary"><p>© {{ new Date().getFullYear() }} {{ $t("footer.copyright") }}</p>For the copyright symbol you can use
©@ -0,0 +10,4 @@<script setup>import { useI18n } from "vue-i18n";const { t } = useI18n();We don't use this
@ -0,0 +99,4 @@const { locale } = useI18n();const links = [I would also add
Home, even though you could reach it by clicking the logo@ -0,0 +113,4 @@{ code: "en", label: "EN" },];function languageBtnClass(code, isMobile = false) {isMobile is never used :)
But could we just duplicate the classes in the two buttons and avoid using this function?
@ -0,0 +1,81 @@<template>This file is never used
@ -0,0 +9,4 @@// Importa tutti i file markdown dalla directory content (più specifico)const contentFiles = import.meta.glob(["/content/**/*.md", "!**/node_modules/**", "!**/public/**"],We don't need the last two matching strings, only the first one
@ -0,0 +5,4 @@const i18n = createI18n({legacy: false,locale: localStorage.getItem("locale") || "it",fallbackLocale: "it",We can fall back to English, I think it's better. But we could also check the browser language (with
navigator.languagei think) and use that if it falls in the [it, en] set.@ -0,0 +10,4 @@},"footer": {"copyright": "ADMStaff","tagline": "Services run by students, for students since 1994"Tbh i don't like the "since" part. ADM exist since 1994 (i don't remember this date), but it evolves every time and like this it seems that it almost stayed the same since 1994. But maybe it's just me.
@ -0,0 +1,203 @@@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap");Why do we import the fonts if we already have them as a static content?
@ -0,0 +12,4 @@* Parser YAML semplice per il frontmatter* Supporta stringhe (con o senza quotes), numeri, booleani, date*/function parseYAMLFrontmatter(yamlContent) {We don't need a custom parser. There are already made parsers for the frontmatter, like: https://www.npmjs.com/package/gray-matter
@ -0,0 +101,4 @@/*** Processa gli shortcode Hugo e li converte in HTML/markdown compatibile*/function processHugoShortcodes(content) {Not super important but this regex are a bit too much, we could use a simple formatting schema or use template-language parser like jinja (as these are jinja style templates)
@ -0,0 +1,180 @@<template>Some text is not translated
@ -0,0 +156,4 @@import { resolveAssetPath } from "../utils/assetPath.js";// Carica tutti gli eventi dalla directory content/events/const { items, loading, error } = useContentList("/content/events/");We don't need the
/content/prefix@ -0,0 +107,4 @@<script setup>import { RouterLink } from "vue-router";import { useContentList } from "../composables/useContent.js";import { computed, onMounted, nextTick } from "vue";onMounted and nextTick are not used
@ -0,0 +112,4 @@// Carica eventi e progetticonst { items: allEvents, loading: eventsLoading } =useContentList("/content/events/");Don't need the
/content/prefix@ -0,0 +124,4 @@// Funzione per troncare HTML mantenendo la formattazionefunction truncate(html, length) {if (!html) return "";const div = document.createElement("div");This is ugly :(
All the content is from us so should be safe, but i would not bet on this. We should be able to only use a parser without creating a div:
We could also think about a sanitize just to be sure?
@ -0,0 +178,4 @@function getExcerpt(html, length) {if (!html) return "";const div = document.createElement("div");Same story of HomeView for the parser and sanitize
@ -0,0 +53,4 @@type="button"@click="closeMobileSidebar">XAn icon would look better :)
@ -0,0 +154,4 @@</div></template><script setup>All the logic in this file is a bit meh. But maybe with markdown render generation at compile time could be better
@ -0,0 +191,4 @@return `${pages} pagine · ${sections} sezioni`;});const sidebarPanelClasses = computed(() => [We only use this once in the html, why use a compute?
@ -0,0 +223,4 @@}function parseSidebarLine(line) {if (line.includes("<!-- NOT INCLUDE -->") || line.includes("<!--")) {What's the point of this? The exclusion should be server-side with the python script, not client side
@ -0,0 +267,4 @@return null;}function createMarkdownRenderer() {All of this is very ugly tbh. Can we do it at compile time like the og photos?
@ -0,0 +3,4 @@# See the latter for an explanation.## Names should be added to this file as:# Name or Organization <email address>Do we need to fill this file?
@ -0,0 +1,93 @@Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)Do we need the license in the repo?
Ciaoo, miiii quante cose!! Sinceramente non me l'aspettavo ahhahhah
Io non ho tempo di mettermi lì, capisco che magari sono cose che per te non sono posticipabili, ma non ne vedo l'urgenza di implementarle ora. O almeno non ho il tempo e le forze di farlo. Ci sarebbe piaciuto metterlo online in fretta e si è sempre in tempo di migliorare tutto.
Se hai tempo e riesci a fixare tu sarebbe carino ecco visto che già hai fatto questo lavorone.
Ecco qualche osservazione alle parti generali che hai scritto:
Lo so, non mi sembrava una cosa così urgente sinceramente e ci avrei aperto una issue e con calma si fixa anche dopo che è online.
Come scritto nella descrizione della pr l'idea è proprio di predisporre il sistema bilingue, non quella di scrivere e creare il contenuto. Lo faremo dopo tutti insieme e d'accordo.
Ci sta la custom 404. La aggiungerò se è così urgente.
che palle solita roba, committo formattato ora
ok vero.
okay, non vedo il problema di lasciarla lì dato che è sempre stata in questo punto anche con hugo.
si potrà sempre convertire dopo sinceramente.
upsi dupsi rimasuglio di un refactor, non l'avevo visto, grazie :D
router/... non veniva usato comunque.
okay ci ho fatto un commit.
sni in realtà dovremmo usarlo anche nel sito per evitare chiamate a google fonts e non dover mettere cookie tecnici e richieste di consensi. Ci guardo meglio.
ops non l'avevo testato in effetti, anche se non serve in teoria formattare la wiki con il nuovo sito.
mmmmmmmmm boh potrebbe essere figo in effetti ma per ora lo terrei così.
okay va bene possiamo nasconderlo ma non mi sembra tutto sto problema.
mmmmmmmm non ci avevo fatto caso, ci guardo credo sia perché non siamo consistenti con i nomi e fetchavo entrambi [per colpa della wiki di freeipa (@greg u.u) che sinceramente potremmo rinominare ed essere consistenti]
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.