A lightweight Hugo theme leveraging CSS Flexbox
- Flexbox-based responsive layout
- Full posts in RSS feed
- Themed RSS feed
- No framework
- No javascript
- 100% speed score on PageSpeed Insight
Optional features:
- CSS and JS can be dynamically embedded with shortcodes
- Built-in shortcodes:
- Netlify contact form
- On-click Soundcloud player
From the website root:
git submodule add https://github.com/de-souza/hugo-flex.git themes/hugo-flex
The theme must be set in the website config:
echo 'theme: hugo-flex' >> config.yaml
From the website root:
git submodule update --remote --rebase
The official hugoBasicExample repository may be used as an example site.
Configuration options may be copied and modified from the theme defaults:
params:
color: teal # Any color in CSS syntax
width: 42rem # Any length in CSS syntax
footer: Except where otherwise noted, content on this site is licensed under
a <a href="http://creativecommons.org/licenses/by/4.0/" rel="license">
Creative Commons Attribution 4.0 International License</a>.
rss: To subscribe to this RSS feed, copy its address and paste it into your
favorite feed reader.
menu:
nav:
- name: About
url: about/
weight: 1
- name: Posts
url: post/
weight: 2
- name: Tags
url: tags/
weight: 3
- name: Categories
url: categories/
weight: 4
- name: RSS
url: index.xml
weight: 5
A contact form working with the built-in Netlify form handling service is inserted with the shortcode:
{{< contact >}}
A custom success page URL may be given as a parameter:
{{< contact "/success" >}}
An on-click Soundcloud Player is inserted with the shortcode:
{{< soundcloud 123456789 >}}
The parameter is a track ID and can be extracted from the "embed" sharing menu on the track webpage.
To embed additional CSS and JS with custom shortcodes, they must be loaded as resources by Hugo and added to the page-wide .Scratch
variable. As a result, they will be loaded in pages where the shortcodes are used.
For instance, from within a shortcode template:
{{ resources.Get "myscript.js" | fingerprint | slice | .Page.Scratch.Add "js" }}
As an example here is the shortcode template for the on-click Soundcloud player:
{{ resources.Get "css/soundcloud.css" | minify | fingerprint | slice | .Page.Scratch.Add "css" }}
{{ resources.Get "js/soundcloud.js" | minify | fingerprint | slice | .Page.Scratch.Add "js" }}
<div class="Soundcloud" data-id="{{ .Get 0 }}"></div>
This theme is licensed under the Apache License 2.0.
hugo-flex's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.