Source code for the #30DayChartChallenge webpage

Overview

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

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 and change the fields 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-2021 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.

You might also like...

Detect webpage updates and notify user to reload. support vite and umijs

English | 简体中文 plugin-web-update-notification Detect webpage updates and notify user to reload. support vite and umijs. Take the git commit hash as th

Dec 26, 2022

A webpage where the user can search for different TV shows, comment them and like them.

A webpage where the user can search for different TV shows, comment them and like them.

TV Shows In this project we built a webpage where the user can search for different TV shows, comment them and like them. Video Built With Major langu

Jul 9, 2022

Explore a webpage effortless.

Page Explorer A browser extension to explore webpages with ease. Available on Firefox now! https://addons.mozilla.org/en-US/firefox/addon/page-explore

Jul 6, 2022

This tool is studied to help ethical hackers to find vulnerable points in webpage's javascript

This tool is studied to help ethical hackers to find vulnerable points in webpage's javascript

JavaScream This tool is studied to help ethical hackers to find vulnerable points in webpage's javascript. HOW TO INSTALL (FIREFOX) 1- clone the proje

Aug 11, 2022

This tool is studied to help ethical hackers to find vulnerable points in webpage's javascript

This tool is studied to help ethical hackers to find vulnerable points in webpage's javascript

JavaScream This tool is studied to help ethical hackers to find vulnerable points in webpage's javascript. HOW TO INSTALL (FIREFOX) 1- clone the proje

Aug 3, 2022

This project is an Awesome Books web page where users can add or remove books from the site. It also displays a list of the books added to the collection. This Awesome books webpage was created using ES6.

Awesome books App using Module Awesome books App using Module This book list was built using modules and other ES6 syntax. It allows users to add/remo

Jul 25, 2022

This is a simple Image popup Jquery plugin. With a very simple configuration, you can show a popup on your webpage. By the way, this plugin works after page load.

This is a simple Image popup Jquery plugin. With a very simple configuration, you can show a popup on your webpage. By the way, this plugin works after page load.

Jquery-SingleImagePopup This is a simple Image popup Jquery plugin. With a very simple configuration, you can show a popup on your webpage. By the way

Aug 22, 2022

A simple to-do-list webpage

A simple to-do-list webpage

TO-DO-LIST A simple to-do-list webpage Contribution Do your work After your work kindly add a screen shot of that Then do a Pull Request We will merge

Oct 21, 2022

This project is for hacktoberfest to encourage new developer and open source developers to contribute to open source and improve skills which require debugging, write testable code, industry standards, problem solving and many more,

This project is for hacktoberfest to encourage new developer and open source developers to contribute to open source and improve skills which require debugging, write testable code, industry standards, problem solving and many more,

🚀 Blog project for hacktoberfest In this repository, you can find issues related to a blog project that is built on top of Next.js. The project is a

Oct 9, 2022
Comments
  • Correct day tagging

    Correct day tagging

    Currently, contributions are erroneously categorized as "Day1" in case it is any combination starting with a "1" (e.g. "Day10", "Day11" pp). Needs to be fixed in the regrex.

    bug 
    opened by z3tt 0
  • Link disclaimer as separate page in footer

    Link disclaimer as separate page in footer

    Currently, the disclaimer text is placed in the about section. That is fine for now but at some point it would be nice to have it at the bottom of each page (I am currently not sure how to automate this).

    Also, linking the "#30DayChartChallenge" text at the bottom to our Twitter account would be great.

    opened by z3tt 0
  • Provide direct links to tweet

    Provide direct links to tweet

    If possible, it might be nice to link the tweet so people can identify the creator, like the post and, if provided, have a look at the code, data or other resources.

    opened by z3tt 0
Owner
#30DayChartChallenge
A monthly community challenge centered around data visualization.
#30DayChartChallenge
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
A crawler that extracts data from a dynamic webpage. Written in node js.

??️ Gumo "Gumo" (蜘蛛) is Japanese for "spider". Overview ?? A web-crawler (get it?) and scraper that extracts data from a family of nested dynamic webp

Nuthalapai Venkata Krishna Chaitanya 22 Sep 13, 2022
A simple to do list webpage where you can log the daily tasks you have to do, mark them as checked, modify them, reorder them and remove them. Made using HTML, CSS and JavaScript.

To-Do-List This Webpage is for an app called To-Do-List which helps you add, remove or check tasks you have to do. It is a simple web page which conta

Zeeshan Haider 9 Mar 12, 2022
Webpage for a leaderboard list app that uses the Leaderboard api to store the highscores for a game

Leaderboard This Webpage is for a leaderboard list app that uses the Leaderboard api to store the highscores for a game. This is one of my first exper

Zeeshan Haider 7 Mar 12, 2022
This React-Based WebPage allows the client/user system to create their own blog, where users can publish their own opinions.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Gauri Bhand 4 Jul 28, 2022
A chrome / firefox extension to draw on any webpage with tldraw

tldrawe A chrome / firefox extension to draw on any webpage with tldraw. Development From the root folder: Run yarn to install dependencies. Run yarn

Nimesh Nayaju 54 Jan 6, 2023
In this project we made a Tv shows webpage where you can like or comment the different shows.

JS Capstone Project In this project we made a Tv shows webpage where you can like or comment the differents shows. Built With HTML CSS JavaScript Lint

Lucas Bonnefon 4 Mar 16, 2022
Convert any webpage into bionified text!

Bionify - Read Faster! LEGAL NOTICE: To the wonderful folks at Bionic Reading®, this is not a pirated version of your Bionic Reading® API, but rather

Vincent 96 Dec 8, 2022
Personal Webpage / Homepage application

Solace Prototype Design for Webpage Description Solace is a personal project by me, for me. That aims to replace Tabliss as my new page / home page pr

Michael Petersen 4 Sep 18, 2022