Giter VIP home page Giter VIP logo

glennmccomb-com's Introduction

https://glennmccomb.com

Tech stack

Built using Hugo. Content is managed via Netlify CMS. Hosted on Netlify.

Gulp is used to:

  • Compile SCSS into CSS and append a hash to file names.
  • Compile and minify vanilla JavaScript and append a hash to file names.
  • Create low-quality-image-placeholders (LQIP) while page is loading.
  • Compress images.
  • Create critical CSS for key pages.

Webpack is used to:

  • Compile React.
  • Compile lambda functions.

Comments are manage via Disqus and are lazy-loaded using disqusLoader which you can learn about in this CSS Tricks article.

Hugo

This codebase is currently optimised for Hugo v0.58.2.

Useful commands:

$ hugo server to run a local environment. Runs at http://localhost:1313/ by default.

$ hugo version to check current Hugo version.

Upgrading

To update hugo I use $ brew upgrade hugo which updates to the latest release. Hugo also needs to be updated in Netlify in Settings -> Build & deploy -> Environment -> Environment variables -> HUGO_VERSION.

Gulp

Useful commands:

$ gulp to watch SCSS and JavaScript files.

$ gulp images to create responsive sizes of featured images and to generate LQIP images.

$ gulp compress-images to run additional compression on images.

$ gulp critical to generate critical CSS for key pages.

Webpack

Webpack is run using NPM scripts:

$ npm start to create a development build and start watching files in /src/react/.

$ npm run build to create a production build (without watch).

Unfortunately anytime $ gulp run, a webpack production build needs to be regenerated before deploying. This is because $ gulp clears static files when it builds. It's annoying but I haven't bothered to develop a workaround.

General notes

Page header images

Page header featured images are saved as plain JPG / PNGs in Photoshop with featured-image- prefix in /src/img/uploads/. These then need to be processed with gulp images and gulp compress-images, after which point they are compressed and copied to static/img/uploads/. In generaly, these images are 1400 x 700, but it doesn't particularly matter since they are scaled to fit wherever they're displayed (in article summary tiles and in page headers).

Photography images

Photography images should have their widest side set to 1600 pixels. They are set up as Hugo Page Resources and use Hugo Image Processing. They are co-located with photography items and described in the photography.md's frontmatter.

If image quality of image dimensions are adjusted, they are automatically regenerated and added to the /resources/_gen/images/photography/post-name/image-name-hash.jpg. It's important to note that old images are not removed during this process and they must be manually cleaned up with $ hugo --gc, which is Hugo's garbage collection.

glennmccomb-com's People

Contributors

lenymo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.