Git Product home page Git Product logo

hugo-min-components's Introduction

This is my personal custom Hugo base theme implemented as a Hugo module.

My basic approach to creating this theme:

- I started with the Hugo base theme, which provides complete, but skeletal templates. This was the best starting point I could find for my needs.
- I further refactored default templates to facilitate finer-grained overriding. I added shortcodes and additional partials as their need arose and tried to make them generalizable. For example, I created my own figure shortcode that links images with their corresponding metadata to display in the figure footer, etc. 
- I added Javascript and CSS resource bundling. Bundle CSS according to sorted filenames to allow a simple approach to overriding styles on sites where it is used. In this way, I can get an initial site up instantly, and efficiently customize it in a predictable way.
- Bundled CSS is executed as a Hugo template to allow substitution of values from Hugo site config. 
- I had initially incorporated SASS preprocessing, but have decided to move to CSS variables and calc() instead. This obviously simplifies the architecture and makes it so the theme doesn't require the Hugo extended version to compile SASS code.

In an attempt to introduce as little CSS as possible in the base theme, and keep the base CSS as clean, logical and disciplined as my limited expertise allows, I made a number of simplifying decisions, some of which include:

- Use browser default body text size (16px on desktop). (A minimal approach implies only deviating from defaults when absolutely needed.)
- Use rems for all sizing.
- Default line height is 150% (1.5 rem) by default, adjust to 1.6 for small screens.
- Default margin size is 1.5 rem. Margins are defined in one direction.
- Assume 1 character = 1 rem.
- Default (essentially, the maximum) line length = 65 rem.
- There is only one breakpoint, so only two sizes designed for: small screens vs. large screens.
- Small screen body width is 100%.
- Large screen max body width is line length + 3 rem (line length and two margins of 1.5 rem). Naturally, this value is sole the breakpoint in the base CSS.

hugo-min-components's People

Contributors

ajsmith607 avatar ajs17 avatar

Watchers

 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.