Everything I learned | Week 23 | Encora / Nearsoft Academy

Gibran Herrera
3 min readSep 14, 2021

Hi everyone! πŸ€—

This week I started the planning for my following projects, and I’m thriving to work on them. I have a blog, a portfolio, and a web application in the queue. This is the beginning of a new phase in my software engineer career. Yei!

β€” β€” β€” ⚑️ CSS Pain βš‘οΈβ€” β€” β€”

I always have problems making web pages beautiful, and one of the reasons behind this is my not complete understanding of CSS. There’s an unreasonable quantity of elements and tools to interact and work with, and some of them may depend on other elements and components. Also, I tend to not practice my CSS skills as I always work with other tools. Even though I believe that a developer should have HTML, CSS, and JavaScript fundamentals in its pocket, those are the ones that almost everything relies on.

Moving on, I used CSS to enrich my blog project, I learned that there’s a way to add it into GitHub gists, which is great news due to the ugly base light theme, and it’s very β€œeasy” to implement, just by adding the .gist on your CSS file and you are almost ready to go. Although I’d recommend checking out the Coder’s Blog to know more.

β€” β€” β€” 🎾 HTML Templates and Static Content 🎾 β€” β€” β€”

One of the struggles I had working with Go templates was being unable to add style through a separate file, if I open the plain HTML, the CSS file was used but whenever I created the template through the go app, it did not work. So I decided to look up, there has to be a way to get it done. Yes, it exists a method, and it’s a new concept that I did not realize due to that I had been working with frameworks taking care of that stuff. I’m talking about static content.

By creating a File Server you will have available all the files within the folder, and the only thing needed to change is the reference to the file within the HTML to the path defined for the file server:

// Creates a new Mux Server
mux := http.NewServeMux()
// Creates the File Server for the folder specified
fs := http.FileServer(http.Dir("./Static")
// Creates the handlers
mux.Handle("/static/", http.StripPrefix("/static", fs))

β€” β€” β€” β›° Final Thoughts β›° β€” β€” β€”

Creating a project without a clear notion and chaos in the view is a very funny and interesting way to learn. I was able to apply my current knowledge with things I’ve always struggle with.

Thank you for reading until here!

See you! πŸ‘‹πŸ½

--

--

Gibran Herrera

Software Engineer πŸ‘¨β€πŸ’» β€” Pythonist 🐍 β€” Linux lover 🐧 β€” Learning πŸ¦€πŸ‹