• Stars
    star
    417
  • Rank 103,829 (Top 3 %)
  • Language
    CSS
  • License
    Apache License 2.0
  • Created almost 7 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Simple and Minimalist theme for Hugo with a focus on typography and content.

Call me Sam: a theme for Hugo

Test Hugo versions Latest Release

Main page screenshot

Sam is a Simple and Minimalist theme for Hugo. It lets you categorize and showcase your content the way you want to.

Focused on content and typography, the stylized index page is really just a list of navigation links that you can set in your config.toml. This versatile design is limited only by your imagination, as you can make it say anything you like. Here are some ideas.

Index page iterations.

Features

  • Showcase content
    • Content-focused page templates for list pages, single pages, and posts
    • A responsive CSS grid gallery page that renders from images in your Page Bundle
  • Customize
    • Custom navigation menu set via config.toml
    • Custom footer text
    • Custom background video via config.toml
  • Developer-approved
    • Syntax highlighting
    • Share-ready pages with Open Graph and Twitter metadata you can customize in config.toml and page front-matter
    • Effortless use of Hugo Pipes to generate CSS from Sass files
    • Tested for compatibility with Hugo versions as far back as 0.49.2

Quick start

Requirements

Requires the extended version of Hugo. You can find installation instructions here (latest version recommended). Here's a handy Bash function for downloading a specific Hugo version.

Extended Hugo's PostCSS requires JavaScript packages to compile the styles for this theme. If you're seeing an error like this:

Error: Error building site: POSTCSS failed to transform "css/main.css"

Install the required packages globally using npm. You'll need postcss, postcss-cli, and autoprefixer.

npm i -g postcss postcss-cli autoprefixer

If you're new to Node.js and npm, learn how to install and use npm here. It is recommended that you use a version manager for your Node.js installation, such as nvm.

Note: If you are using Hugo as a snap app, the above two Node.js packages have to be installed locally inside exampleSite.

cd exampleSite/
npm i postcss postcss-cli autoprefixer

1. Get the theme

Use the theme as hugo module

  1. Ensure that Go is installed (version >= 1.12). Download the Go installer here.

  2. Turn your new or existing site into a hugo module by issuing this command from site root:

    hugo mod init github.com/me/my-sam-based-site
  3. Declare the sam theme module as a dependency of your site:

    hugo mod get github.com/victoriadrake/hugo-theme-sam

Use the theme locally with git clone or as a submodule

Run from the root of your Hugo site:

git clone https://github.com/victoriadrake/hugo-theme-sam.git themes/sam

Alternatively you can include this repository as a git submodule. This makes it easier to update this theme if you have your Hugo site in git as well. For this you need to run:

git submodule add https://github.com/victoriadrake/hugo-theme-sam.git themes/sam

2. Configure your site

From the exampleSite, copy config.toml to the root folder of your Hugo site. Inside this file, identify the theme = ... line.

To configure as a Hugo module

Make sure the following line is uncommented in order to activate your theme as hugo module:

theme = "github.com/victoriadrake/hugo-theme-sam"

To configure a local theme

Make sure the following line is uncommented:

theme = "sam"

Afterwards, adapt the configuration parameters inside config.toml as you like. There are helpful hints in the file.

3. Create pages

Run:

hugo new page.md

Where page can be anything you like. A contact page, a bio, dates for your upcoming world tour... Anything!

4. Design your main menu and index page

In config.toml, customize the entries for [[params.mainMenu]] however you like. You can have as many or as few entries as you like. You can even include external links.

This list comprises the index page and part of the navigation menu at the bottom of single content pages. Here's an example:

[[params.mainMenu]]
    link = "/photography"
    text = "photography"

[[params.mainMenu]]
    link = "/posts"
    text = "writing"

[[params.mainMenu]]
    link = "/about"
    text = "who dis?"

Preview your site locally

Use Hugo's built-in server to see your site in action as you make changes.

hugo serve -t sam

Visit localhost:1313 in your browser to see a live preview of your site.

Posts

To create a new post, run:

hugo new posts/your-post-title.md

Image gallery

To create an image gallery, place all the files you want included in your Page Bundle. The directory structure might then look like this:

content/
 └── gallery/
      β”œβ”€β”€ _index.md
      β”œβ”€β”€ file_1.jpg
      β”œβ”€β”€ file_2.jpg
      └── file_3.jpg

To automagically generate a gallery from the images, set type: "gallery" in the front-matter of _index.md. You can also set other options for the gallery:

  • The gallery title
  • The page link with url
  • The maxWidth of the resized images
  • Whether you want the images to link to the full size files, with clickablePhotos
  • You can keep the orignal aspect ratio of the images in the grid with keepAspectRatio

Here is an example of a gallery's _index.md:

---
title: "Portraits"
type: "gallery"
url: "/portrait-gallery"
maxWidth: "800x"
clickablePhotos: true
keepAspectRatio: false
---

In order to create more than one gallery, create multiple Page Bundles with images and type: "gallery" defined in the _index.md front matter. For example:

content/
 β”œβ”€β”€ gallery/
 |   β”œβ”€β”€ _index.md
 |   β”œβ”€β”€ file_1.jpg
 |   β”œβ”€β”€ file_2.jpg
 |   └── file_3.jpg
 |
 └── portfolio/
     β”œβ”€β”€ _index.md
     β”œβ”€β”€ file_1.jpg
     β”œβ”€β”€ file_2.jpg
     └── file_3.jpg

That's it! Sam's gallery layout template will automagically build the page from your images.

Custom video background

To change the default home page background to a looping video, you need to set a list of video sources and optionally an overlay color (default: rgba(0, 0, 0, 0.4)).

Here is an example configuration of config.toml:

[[params.videoBackground.sources]]
    source  = "/background.mp4" # Your video file
    type    = "video/mp4"
    poster  = "/background.jpg" # The image to show when the video isn't playing

[params.videoBackground]
    overlay = "rgba(0, 0, 0, 0.4)" # optional

And here is a screenshot of what that might look like:

Video background main page screenshot

Editing the theme

This theme uses Hugo Pipes to compile, autoprefix, and minify its CSS styles from the included Sass files.

To make changes to the CSS, edit the Sass files located in assets/sass/, then build your site using extended Hugo, which you can obtain from Hugo Releases.

If when building you do not see the changes you have done, make sure to build your website with the --ignoreCache flag, otherwise Hugo will attempt to use its own cached Sass files.

You can run the built-in server to preview the site as you make changes to the Sass files!

Issues

If you have a question or get stuck, please open an issue for help and to help those who come after you. The more information you can provide, the better!

Contributing

Pull requests for bug fixes and enhancements are welcome! Please ensure you first read about contributing to this project.

Open source themes like this one would not be possible without some amazing contributors. Thank you!

License

Copyright (C) 2018-2022 Victoria Drake

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

hugo-theme-introduction

Minimal, single page, smooth-scrolling theme for Hugo static site generator.
HTML
667
star
2

dotfiles

Dotfiles and automagic set-up scripts for Linux flavours
Shell
248
star
3

hydra-link-checker

Hydra: a multithreaded site-crawling link checker in Python standard library
Python
121
star
4

kabukicho-vscode

Neon vaporwave dark theme for VS Code. Now with dreamy nostalgia πŸŒ† and hints of hazy liquid synth. 🎧
CSS
94
star
5

django-security-check

Helps you continuously monitor and fix common security vulnerabilities in your Django application.
Shell
88
star
6

neofeed-theme

A personal feed for Neocities, GitHub Pages, or anywhere else, built with Hugo. #IndieWeb friendly and all yours. It's better than Twitter.
HTML
86
star
7

simple-subscribe

Collect emails with a subscription box you can add to any page and build your own independent subscriber base.
Go
82
star
8

i3-linux-config-tokyo-rice

My config files for i3-gaps and Linux, first rice.
74
star
9

hugo-remote

GitHub Action to build and deploy a Hugo site to a remote repository. Deploy from a private repo to a public one!
Shell
66
star
10

link-snitch

:octocat: GitHub Action to scan your site for broken links so you can fix them πŸ”—
Shell
58
star
11

victoriadrake.github.io

🌱 Victoria's autonomous self-improving blockchain-fortified AI static website
HTML
32
star
12

jekyll-cd

:octocat: GitHub Action to build and deploy a Jekyll site to GitHub Pages πŸ§ͺ
Shell
24
star
13

start

A simple and pleasing new tab startpage or homepage.
JavaScript
23
star
14

hugo-theme-quint

Quint: Essence of Minimalism. A theme for Hugo static site generator.
HTML
22
star
15

heartbreak

Unlikes your Twitter Likes. πŸ’”
Go
21
star
16

victoriadrake

πŸ‘‹πŸŒŽ
Go
20
star
17

chatgptmax

Python module to send large input to ChatGPT using preprocessing and chunking.
Python
16
star
18

git-rundown

πŸ—ƒ Check the status of multiple git repositories in a folder
Shell
14
star
19

fancy-unicode

Turn boring plain text into pretty unicode characters.
JavaScript
13
star
20

open-mscs

Based on OMSCS. πŸŽ“ Collaborative open source notes for graduate computer science courses.
13
star
21

hugo-latest-cd

:octocat: GitHub Action to build and deploy πŸš€ a Hugo site to GitHub Pages using latest extended Hugo
Shell
13
star
22

react-in-django

Basic scaffold for a Django Rest Framework + React app.
Python
12
star
23

github-guestbook

A retro 90s website guestbook powered by GitHub Actions
HTML
11
star
24

gitdo

🦾 Tools for doing things with Git repositories
Shell
11
star
25

acme-gallery

Automagical gallery page generator.
JavaScript
7
star
26

django-starter

Django best practices and developer tools in a starter repository for your next project. Clone and start building.
HTML
7
star
27

30-days-of-code

My solutions for HackerRank's 30 Days of Code challenges using Python 3.
Python
7
star
28

hugo-theme-memex

A personal memex theme.
HTML
6
star
29

utc

A UTC clock.
CSS
6
star
30

rss-mailer

A Lambda function for turning your RSS feed items into emails.
Go
6
star
31

xmas

A countdown clock. πŸŽ„
4
star
32

simon

A futuristic, post-apocalypse, AI... Simon game.
JavaScript
4
star
33

standardnotes-to-markdown

Takes a Standard Notes JSON export and creates Markdown files
Python
4
star
34

author-afk

Post tweets with RSS links using AWS Lambda when you're afk.
Go
3
star
35

minimalist-calc

A simple responsive JavaScript calculator. Equivalent capabilities to a very smart monkey doing Grade 6 homework.
HTML
2
star
36

got-issues

A standard-library Python utility that uses the GitHub API to collect issues data from any repository.
Python
2
star
37

.github

πŸ“‚ Default community health files for my account
2
star
38

chicago-api

Capitalize your title in something pretty close to Chicago Manual of Style title case.
TypeScript
2
star
39

vsc-starter-snippets

Visual Studio Code snippets to help you start projects faster.
2
star
40

quint-demo

Demo site for the Hugo theme Quint.
JavaScript
2
star
41

tokyo-life

A demo gallery. Automagically generated with `acme-gallery`.
HTML
2
star
42

pomo-clock

A pomodoro timer.
JavaScript
1
star
43

cats-vs-unicorns

A 90s-inspired tic-tac-toe variant.
JavaScript
1
star