valerionew / triennale-elettronica-polimi

Collezione di materiale libero, prodotto e recuperato, utile ad affrontare la laurea triennale in ingegneria elettronica al Politecnico di Milano
https://valerionew.github.io/triennale-elettronica-polimi/
17 stars 19 forks source link

Switching to BearBlog style? #29

Closed valerionew closed 9 months ago

valerionew commented 1 year ago

Could we consider moving to Hugo with a Bear theme to improve the user experience? The appearance is very similar to the current website

Anyone brave enough to try to migrate in a branch?

https://github.com/janraasch/hugo-bearblog

TIT8 commented 1 year ago

I am curious, how could this theme improve the user experience?

valerionew commented 1 year ago

I'd say the two main things are the responsiveness of the website (to be checked), the dark/light theme and in general the appearance is more polished.

Idk how much effort is required to migrate, and if the advantages are worth the effort

TIT8 commented 1 year ago

This is completely new for me, but it’s interesting. Now I am under exam session, so until September I can’t give help, but if none do it first, I will try in autumn.

TIT8 commented 10 months ago

Hei there, I've started the Hugo-based version of this project.

I only configured Hugo and the Bear theme in the config.toml. I decided to keep all in a new repo because in this way I can play with it without break this repo. So I've deployed a new Github Pages via Github Actions as described in the Hugo documentation, while the templating was made as said here.

So I haven't done anything special, but if someone in the while want to play with markdown files and themes of Hugo, start from here and play with my repo for faster prototyping. This page is awesome to work with markdown.

I already updated my repo with valerionew's latest pull requests.

If this will work, I will make a pull request to this repo.

TIT8 commented 10 months ago

Now we have the Bear theme, dark and with fast download, try it here

valerionew commented 10 months ago

I feel like it is more polished. What do you think?

TIT8 commented 10 months ago

Yes, I agree. The Bear theme is simple and clean. I found also better the experience with the download of notes (where they can be downloaded). On my browser I don't have anymore to save the file on the download folder on Windows before open it, but it is displayed immediately in the browser. I don't know if it work in this way also for you, but I like it.

Hugo is very big, I tried themes like docsy by Google and docura and they are awesome, but our project is too simple for that style power.

valerionew commented 10 months ago

On my browser I don't have anymore to save the file on the download folder on Windows before open it, but it is displayed immediately in the browser. I don't know if it work in this way also for you, but I like it.

That was actually done on purpose on the old website: the download keyword on the <a>.

I can't recall what was the exact idea behind this.

TIT8 commented 10 months ago

Ah ok, it was intended. Indeed in the Hugo-generated html there isn't that keyword

Screenshot (129)

I found that this behaviour makes the new site run smoother, but yes it's totally subjective.

valerionew commented 10 months ago

Do files open in the same tab on the new version?

valerionew commented 10 months ago

And for the last part: how do you find the process of adding new material? Is it any harder?

TIT8 commented 10 months ago

Do files open in the same tab on the new version?

Yes

TIT8 commented 10 months ago

And for the last part: how do you find the process of adding new material? Is it any harder?

This involves a shift from HTML to Markdown language. While they both belong to the Markdown family, transitioning between the two is not overly complex. You need to write in the content/_index.md file just like you did in the previous index.html.

As for adding notes, place them in the static folder. The process remains consistent with what we currently do in this repository.

In essence, it's all about changing habits. I will write these steps in the wiki.

TIT8 commented 10 months ago

You will find the description in the wiki. Please let me know if it's clear for you.

TIT8 commented 10 months ago

I made some changes to use better the Bear theme. Now I'm reaching a stable version of the new site.

I like it, but maybe I am biased.

TIT8 commented 10 months ago

I'd say the two main things are the responsiveness of the website (to be checked), the dark/light theme and in general the appearance is more polished.

Idk how much effort is required to migrate, and if the advantages are worth the effort

From my perspective, your intuitions were correct.

valerionew commented 9 months ago

Finalmente ho avuto tempo di guardarci. Devo dire che è molto figo. Cosa manca per il merge?

Per il futuro sarebbe ancora più figo se riuscissimo a creare un upload guidato, tipo un form in cui caricare file e descrizioni e che dall'invio del form crea automaticamente la PR. Anche se non credo che si possa fare senza backend, e forse è un po' complicato per questo sito

TIT8 commented 9 months ago

Molto bene! Giusto una conferma, ti funziona tutto giusto? Hai provato a toccare i link, switchare tra dark e light theme, inviare un messaggio via form? Mi darebbe una mano un occhio esterno nel debug.

Allora posso provare subito a fare una pull request. Alcuni accorgimenti li devo fare.

  1. Dovrei aver fatto il sito abbastanza generale da non avere problemi con il cambio di url per le Github Pages, dovremo solo passare ad un deploy non via branch ma via github actions come descritto sul sito di Hugo (basta cambiare un'impostazione e il sistema fa tutto in automatico).

  2. Se vogliamo testarlo estensivamente prima di fare il merge tra nuovo branch e master, possiamo usare Netlify che a differenza delle Github Pages è in grado di fare il deploy di branch che non siano il master. Questo commento è molto probabilmente inutile, ma mi sono innamorato di Netlify (è velocissimo a fare il deploy, Github actions ci mette 15 minuti, Netlify 1, e non ha problemi con il size della repo, Github actions ti dice che per repo con size sopra 1GB potrebbe fallire il deploy; mai fallito per ora se non per colpa mia).

  3. Dovrò solo sistemare alcuni link che portano alla mia repo, ma una volta che il sito è funzionante si tratta di fare una pull request con i cambiamenti.

  4. Poi copierei così com'è la wiki per le istruzioni su come contribuire, ma se non ti piace l'idea si può benissimo portare il contenuto nel README. Non so il perché, mi piacciono un sacco le wiki di Github per le documentazioni.

  5. Gran bella idea quella del form guidato, posso provarla sulla API che ho scritto per il form del nuovo sito. Se tu hai voglia di provare e conosci Go, cioè hai letto cinque minuti fa go-by-example, ti faccio collaboratore anche lì e lo vediamo in un nuovo branch. Credo che Go lato backend abbia qualche soluzione per lavorare con Git.

  6. Aggiungo già le ultime pull request dei ragazzi su questa repo.

  7. Mi servirebbe il tuo telegram per metterti nel canale in cui l'API in Go manda i messaggi (molto probabilmente non servirà, ma un canale in più non fa male).

valerionew commented 9 months ago

Giusto una conferma, ti funziona tutto giusto? Hai provato a toccare i link, switchare tra dark e light theme, inviare un messaggio via form? Mi darebbe una mano un occhio esterno nel debug.

Ci do un secondo sguardo ora

Dovrei aver fatto il sito abbastanza generale da non avere problemi con il cambio di url per le Github Pages, dovremo solo passare ad un deploy non via branch ma via github actions come descritto sul sito di Hugo (basta cambiare un'impostazione e il sistema fa tutto in automatico).

Stupendo

Se vogliamo testarlo estensivamente prima di fare il merge tra nuovo branch e master, possiamo usare Netlify che a differenza delle Github Pages è in grado di fare il deploy di branch che non siano il master. Questo commento è molto probabilmente inutile, ma mi sono innamorato di Netlify (è velocissimo a fare il deploy, Github actions ci mette 15 minuti, Netlify 1, e non ha problemi con il size della repo, Github actions ti dice che per repo con size sopra 1GB potrebbe fallire il deploy; mai fallito per ora se non per colpa mia).

Dovrò solo sistemare alcuni link che portano alla mia repo, ma una volta che il sito è funzionante si tratta di fare una pull request con i cambiamenti.

Yes, let's do that!

Poi copierei così com'è la wiki per le istruzioni su come contribuire, ma se non ti piace l'idea si può benissimo portare il contenuto nel README. Non so il perché, mi piacciono un sacco le wiki di Github per le documentazioni.

Va benissimo, basta linkarla nel readme, che la gente legge solo quello :)

Gran bella idea quella del form guidato, posso provarla sulla API che ho scritto per il form del nuovo sito. Se tu hai voglia di provare e conosci Go, cioè hai letto cinque minuti fa go-by-example, ti faccio collaboratore anche lì e lo vediamo in un nuovo branch. Credo che Go lato backend abbia qualche soluzione per lavorare con Git.

Potrebbe essere uno sviluppo interessante, ma chi compila il form dovrebbe avere almeno un account gh. Non ho idea di come si potrebbe fare questa cosa, non so nulla di webdev

Aggiungo già le ultime pull request dei ragazzi su questa repo.

Perfetto!

Mi servirebbe il tuo telegram per metterti nel canale in cui l'API in Go manda i messaggi (molto probabilmente non servirà, ma un canale in più non fa male).

Se sei nel gruppo telegram di elettronica mi trovi come Sono Utente Dell'Ideale Scientifico

TIT8 commented 9 months ago

Ok, dai allora inizio a fare il grande cambiamento.

Io mi occupo delle Github Pages e della wiki, @valerionew devi occuparti di Netlify, perché solo l'admin può fare il deploy di una repo (creare un account Netlify è gratuito, l'uso anche, entro limiti che non dovremmo raggiungere). Le istruzioni sono qui, anche se durante il processo il sito di Netlify è molto più chiaro della documentazione di Hugo. Consigli miei:

Siccome dovrai scegliere quale branch fare il deploy ci sono due opzioni:

Qui dipende dal nostro coraggio, io mi sono già stufato di testare, ma l'admin sei te quindi la patata bollente la prendi tu: ho il via libera a tentare il primo merge o è meglio essere cauti?

Considera che fino a quando non facciamo il merge, i link alle immagini nella wiki e nel sito portano alla mia repo ancora, li cambieremo una volta che il master sarà aggiornato.

valerionew commented 9 months ago

teniamo ancora il branch separato, fai il deploy di hugo, testiamo il tutto e poi faremo il merge (in questo caso le Github Pages non possono farci vedere il nuovo sito)

This please. Siamo pur sempre in sessione :)

TIT8 commented 9 months ago

Va bene 😂 . Ho sistemato la wiki. Gioca con Netlify e il branch hugo, quando hai finito metti il link nel readme. Vorrai mica giocarci da solo, io sono geloso?

valerionew commented 9 months ago

Building

valerionew commented 9 months ago

Live at https://triennale-elettronica-polimi.netlify.app/

TIT8 commented 9 months ago

Live at https://triennale-elettronica-polimi.netlify.app/

Sei stato una furia 🔝

valerionew commented 9 months ago

Come si collega la build di netlify a github.io però?

TIT8 commented 9 months ago

github.io è un'altra cosa, sono due deploy (e host) separati. Il deploy sulle github pages è fatto via uno script (hugo.yaml) che trovi nella cartella .github/workflows.

Il sito di Hugo mi ha detto come fare. Non appena quello script finisce sul master, farà tutto.

valerionew commented 9 months ago

Ok perfetto!

TIT8 commented 9 months ago

Proporrei ora di fare la pull request per preparare il merge, Netlify ci manderà in automatico una preview (che sarà lo stesso sito che vediamo ora, ma solo con un dominio differente). Poi sarai tu a schiacciare il fatidico bottone 🥇 .

Un appunto che mi ero dimenticato di dirti: durante lo sviluppo avevo tolto il tuo google tag manager per non crearti dei falsi positivi nelle analisi. Se lo usi ancora, te lo rimetto (non si fa da qua, devo inserirlo nel mio fork del tema BearBlog). Dimmi te.

valerionew commented 9 months ago

Procediamo!

valerionew commented 9 months ago

Si, direi di tenere analytics. Penso di poterti anche dare accesso se hai un account Google

TIT8 commented 9 months ago

Ok, 5 minuti, copio-incollo-arrivo.

TIT8 commented 9 months ago

Si, direi di tenere analytics. Penso di poterti anche dare accesso se hai un account Google

No, grazie, non voglio altre mail da Google, sono già pieno di spam.

TIT8 commented 9 months ago

Ok, pull request fatta, perdonami se ci ho messo molto più di 5 minuti, ma la pull request è troppo grande per il sito di Github, ho dovuto imparare ad usare la CLI di Github per farla. Ora è a posto.

valerionew commented 9 months ago

Closed by #34

Thank you very much @TIT8 for your effort, the result looks amazing!

TIT8 commented 9 months ago

@valerionew per le github pages devi solo cambiare una cosa che può fare solo l'owner, come scritto sul sito di Hugo.

Sostanzialmente devi dire che invece che fare il deploy da branch, lo vuoi da Github Action (è ancora in beta, ma oramai quasi stabile come soluzione)

TIT8 commented 9 months ago

@valerionew per le github pages devi solo cambiare una cosa che può fare solo l'owner, come scritto sul sito di Hugo.

Sostanzialmente devi dire che invece che fare il deploy da branch, lo vuoi da Github Action (è ancora in beta, ma oramai quasi stabile come soluzione)

This. Mentre per Netlify basterà cambiare il branch di deploy, ma credo tu lo abbia già fatto.

valerionew commented 9 months ago

Giuro che l'ho fatto

image

TIT8 commented 9 months ago

Ok allora aspettiamo i soliti 20 minuti (dove gli artifacts ce ne mettono 12)

valerionew commented 9 months ago

Questa run dovrebbe essere quella buona

https://github.com/valerionew/triennale-elettronica-polimi/actions/runs/6195961295/job/16821679163

TIT8 commented 9 months ago

La vedo, se inizia il deploy vuol dire che è tutto a posto (potrebbe fallire per via del size della repo, motivo per cui mi sono buttato su Netlify)

valerionew commented 9 months ago

Nel caso peggiore credo che potremmo fare la build di una pagina che restituisce 301 redirect alla build di netlify, immagino

valerionew commented 9 months ago

deployed