Code Monkey home page Code Monkey logo

hugo-theme-gruvbox's Introduction

Gruvbox Hugo Theme

A retro-looking Hugo theme inspired by gruvbox to build secure, fast, and SEO-ready websites.

This theme is easily customizable with features that any coder loves.

I took a lot of inspiration from the Hello Friend and Doks Hugo themes.

Screenshot of the theme in dark and light colors

DISCLAIMER: Project Status

This theme is still in early development. Check out the issues to see what's still missing.

Highlights

A big thank you to the authors of the software that make this theme possible! ❤️

Quickstart

The theme requires extended Hugo because it uses Sass/SCSS. You'll also have to install Go because the theme uses Go modules.

  1. git clone the repository and cd into it
  2. Run npm ci to install the dependencies
  3. Run hugo server

Install The Theme

Create a new Hugo website:

hugo new site example.com
cd example.com/

Initialize the site as Hugo module

hugo mod init example.com

Add the following to the config.toml file:

[markup]
  # (Optional) To be able to use all Prism plugins, the theme enables unsafe
  # rendering by default
  #_merge = "deep"

[build]
  # Merge build config of the theme
  _merge = "deep"

# This hopefully will be simpler in the future.
# See: https://github.com/schnerring/hugo-theme-gruvbox/issues/16
[module]
  [[module.imports]]
    path = "github.com/schnerring/hugo-theme-gruvbox"
  [[module.imports]]
    path = "github.com/schnerring/hugo-mod-json-resume"
    [[module.imports.mounts]]
      source = "data"
      target = "data"
    [[module.imports.mounts]]
      source = "layouts"
      target = "layouts"
    [[module.imports.mounts]]
      source = "assets/css/json-resume.css"
      target = "assets/css/critical/44-json-resume.css"
  [[module.mounts]]
    # required by hugo-mod-json-resume
    source = "node_modules/simple-icons/icons"
    target = "assets/simple-icons"
  [[module.mounts]]
    source = "assets"
    target = "assets"
  [[module.mounts]]
    source = "layouts"
    target = "layouts"
  [[module.mounts]]
    source = "static"
    target = "static"
  [[module.mounts]]
    source = "node_modules/prismjs"
    target = "assets/prismjs"
  [[module.mounts]]
    source = "node_modules/prism-themes/themes"
    target = "assets/prism-themes"
  [[module.mounts]]
    source = "node_modules/typeface-fira-code/files"
    target = "static/fonts"
  [[module.mounts]]
    source = "node_modules/typeface-roboto-slab/files"
    target = "static/fonts"
  [[module.mounts]]
    source = "node_modules/@tabler/icons/icons"
    target = "assets/tabler-icons"
  [[module.mounts]]
    # Add hugo_stats.json to Hugo's server watcher
    source = "hugo_stats.json"
    target = "assets/watching/hugo_stats.json"

Install the theme:

hugo mod get

Initialize the NPM package.json and install the dependencies:

hugo mod npm pack
npm install

Run Hugo:

hugo server

Update The Theme

Update the Hugo modules:

hugo mod get -u
hugo mod tidy

Update the NPM dependencies:

hugo mod npm pack
npm install

Colors

Two options are available to configure the theme colors:

  • defaultTheme: dark or light (defaults to light)
    Default theme color for when a user visits the site for the first time. OS or user preference override this setting. See this comment for more details.
  • themeColor: gray, red, green, yellow, blue, purple, aqua, or orange (defaults to blue)
    Theme color for things such as links, headings etc.
  • themeContrast: soft, medium, or hard (defaults to medium)
    Theme background color

Prism

The theme allows customization of Prism via config.toml parameters:

[params]
  [params.prism]
    languages = [
      "markup",
      "css",
      "clike",
      "javascript"
    ]
    plugins = [
      "normalize-whitespace",
      "toolbar",
      "copy-to-clipboard"
    ]

In my opinion, this is the coolest feature of the theme. Other Hugo themes usually include a pre-configured version of Prism, which complicates updates and change tracking, and clutters the theme's code base with third-party JavaScript.

The Prism theme is not configurable because of the integration with the dark mode functionality. Toggling between color modes swaps the Prism theme between gruvbox-dark and gruvbox-light from github.com/PrismJS/prism-themes.

Check out the Prism showcase on the Demo site for examples

Explore Prism Features

After running npm install, explore Prism features like this:

# Languages
ls node_modules/prismjs/components

# Plugins
ls node_modules/prismjs/plugins

Image Optimization

Images are optimized by default without requiring shortcodes. A custom render hook does all the heavy lifting (see render-image.html).

By default, the theme creates resized versions of images ranging from 300 to 700 pixels wide in increments of 100 pixels.

If the image format is not WebP, the image is converted. The original file format will serve as a fallback for browsers that don't support the WebP format.

Note that only images that are part of the page bundle are processed. If served from the static/ directory or external sources, the image will be displayed but not be processed.

Additionally, all images are lazily loaded to save the bandwidth of your users.

Configuration

The default quality is 75%. See the official Image Processing Config Hugo docs. Change it by adding the following to the config.toml file:

[imaging]
  quality = 75

Change the resize behavior:

[params]
  [params.imageResize]
    min = 300
    max = 700
    increment = 100

Captions

![Alt text](image-url.jpg "Caption with **markdown support**")

The demo site features examples you can look at. I also use the theme for my website.

Blog Post Covers

Add blog post covers by defining them in the front matter of your posts:

---
cover:
  src: my-blog-cover.jpg
  alt: A beautiful image containing interesting things
  caption: [Source](https://www.flickr.com/)
---

Embed Video Files

Use the video shortcode to embed your video files from Page Resources.

With a page bundle looking like the following:

embed-videos/
|-- index.md
|-- my-video.jpg
|-- my-video.mp4
|-- my-video.webm

You can embed my-video like this:

{{< video src="my-video" autoplay="true" controls="false" loop="true" >}}

The shortcode looks for media files matching the filename my-video*. For each video MIME type file, a <source> element is added. The first image MIME type file is used as poster (thumbnail). It will render the following HTML:

<video
  autoplay
  loop
  poster="/blog/embed-videos/my-video.jpg"
  width="100%"
  playsinline
>
  <source src="/blog/embed-videos/my-video.mp4" type="video/mp4" />
  <source src="/blog/embed-videos/my-video.webm" type="video/webm" />
</video>

You can set a Markdown caption, wrapping the <video> inside a <figure>.

Additionally, the shortcode allows you to set the following attributes:

Attribute Default
autoplay false
controls true
height
loop false
muted true
preload
width 100%
playsinline true

Learn more about the <video> attributes here.

SEO

Due to the European Copyright Directive it is required to opt into displaying snippets in search engine results.

By default, every page (except 404) includes the index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1 robots meta value, opting into all snippet features.

You can override the robots meta value in the front matter of your pages:

---
robots: noindex, nofollow
---

Social Share Links

Configure social share links in the Hugo config like this:

[params]
  [[params.socialShare]]
    iconSuite = "simple-icon"
    iconName = "facebook"
    formatString = "https://www.facebook.com/sharer.php?u={url}"
  [[params.socialShare]]
    iconSuite = "simple-icon"
    iconName = "reddit"
    formatString = "https://reddit.com/submit?url={url}&title={title}"
  [[params.socialShare]]
    iconSuite = "tabler-icon"
    iconName = "mail"
    formatString = "mailto:?subject={title}&body={url}"

Use the iconSuite option to specify the icon suite used for the social share link: simple-icon or tabler-icon. Select an icon from the suite with the iconName option.

The formatString supports the following placeholders:

  • {url} is replaced with the .Permalink of the post
  • {title} is replaced with the .Title of the post

To enable social share links, set the following in the post's front matter:

---
socialShare: true
---

Check out the Social Share URLs repo on GitHub for more format strings.

Favicon

The favicons and corresponding markup were generated with the free RealFaviconGenerator.net.

The easiest way to replace the default favicons is to generate them using RealFaviconGenerator.net and put the generated files into the static/ directory.

Extensibility

You can extend the theme by overriding the following partials in the layouts/partials directory which by default are empty placeholder files:

Example: Adding KaTeX Support to the Theme

KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. Let's add it to the theme via npm. First, add the following to the package.hugo.json file:

"dependencies": {
  "katex": "^0.16.8"
}

Then run hugo mod npm pack to sync the package.hugo.json dependencies with package.json. Run npm install after. We then need to mount the node_modules/katex folder into Hugo's virtual filesystem by adding the following to the config/_default/module.toml file:

[[mounts]]
  source = "node_modules/katex"
  target = "assets/katex"

We can then add the following to layouts/partials/head/head_end.html:

{{ if .Params.katex }}
  {{ $katexCSS := resources.Get "katex/dist/katex.min.css" }}
  <link
    rel="stylesheet"
    href="{{ $katexCSS }}"
    {{ if hugo.IsProduction }}
      integrity="{{ $katexCSS.Data.Integrity }}"
    {{ end }}
    crossorigin="anonymous"
  />

  {{ $katexJS := resources.Get "katex/dist/katex.min.js" }}
  <script
    defer
    src="{{ $katexJS.RelPermalink }}"
    {{ if hugo.IsProduction }}
      integrity="{{ $katexJS.Data.Integrity }}"
    {{ end }}
    crossorigin="anonymous"
  ></script>

  {{ $autoRender := resources.Get "katex/dist/contrib/auto-render.min.js" }}
  <script
    defer
    src="{{ $autoRender.RelPermalink }}"
    {{ if hugo.IsProduction }}
      integrity="{{ $autoRender.Data.Integrity }}"
    {{ end }}
    crossorigin="anonymous"
    onload="renderMathInElement(document.body);"
  ></script>
{{ end }}

The only thing left is enabling KaTeX in the front matter of our content:

---
title: "Hello World"
description: "The first post of this blog"
date: 2021-03-14T15:00:21+01:00
draft: false
katex: true
---

I'm a .NET developer by trade, so let's say hello in C#!

Configure the Tag Cloud

The theme comes with a tag cloud partial. It is included in the sidebar, but it is disabled by default. If you wish to configure it, add the following to the [params] section in the config.toml file:

[params.tagCloud]
  enable = true
  minFontSizeRem = 0.8
  maxFontSizeRem = 2.0

Remove the Sidebar

If you want to get rid of the sidebar, add an empty data/json_resume/en.json file with the following content:

{
  "$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
  "basics": {},
  "work": [],
  "volunteer": [],
  "education": [],
  "awards": [],
  "certificates": [],
  "publications": [],
  "skills": [],
  "languages": [],
  "interests": [],
  "references": [],
  "projects": [],
  "meta": {
    "canonical": "https://raw.githubusercontent.com/jsonresume/resume-schema/master/resume.json",
    "version": "v1.0.0",
    "lastModified": "2017-12-24T15:53:00"
  }
}

Extend CSS

The theme uses PostCSS with following plugins:

Additionally the following plugins are used if building the site with hugo -e production:

Inside the assets/css two folders exist, critical and non-critical. Files inside critical are concatenated during build time and inlined into the <head> element. The styles target mostly above the fold content. Try to keep inline CSS to a minimum because it can't be cached and will be inlined into every single page. Files inside non-critical are concatenated into a single file and included as <style>. Most of the styles are in there.

Files are concatenated in lexicographic order of their file names. File names start with two digits and a hyphen: NN-. The order of files might differ between Linux and Windows, so using this convention improves cross-platform compatibility. You might know this approach if you're familiar with Xorg.

You can add new CSS files to the PostCSS pipeline like this:

  • critical/50-foo.css
  • non-critical/05-bar.css
  • non-critical/99-last.css

hugo-theme-gruvbox's People

Contributors

bronislav avatar davegallant avatar keystroke3 avatar mikefarmer01 avatar renovate[bot] avatar schnerring avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hugo-theme-gruvbox's Issues

Support nested menus

The current implementation doesn't support menus with a lot of items or complex sub-menus

Error about render of "page" failed: execute of template failed

Hello Michael, I used gruvbox as my blog theme for long time, and I really like it. Thanks for your great work!!
But recently I can't successfully run local host. When I run hugo server I got this Error:
Do you know how to fix it?

E:\gruvbox>hugo server
port 1313 already in use, attempting to use an available port
Start building sites …
hugo v0.89.0-ADE966B8+extended windows/amd64 BuildDate=2021-11-02T10:00:18Z VendorInfo=gohugoio
ERROR 2023/06/18 22:05:09 render of "page" failed: execute of template failed: template: _default/single.html:9:9: executing "_default/single.html" at <partial "header.html" .>: error calling partial: execute of template failed: template: partials/header.html:42:9: executing "partials/header.html" at <partial "icons/tabler-icon.html" "menu-2">: error calling partial: execute of template failed: template: partials/icons/tabler-icon.html:1:3: executing "partials/icons/tabler-icon.html" at <partial "icons/svg.html" (printf "tabler-icons/%s.svg" .)>: error calling partial: "E:\gruvbox\layouts\partials\icons\svg.html:2:18": execute of template failed: template: partials/icons/svg.html:2:18: executing "partials/icons/svg.html" at <$path>: nil pointer evaluating resource.Resource.Content
ERROR 2023/06/18 22:05:09 render of "page" failed: execute of template failed: template: cv/single.html:9:9: executing "cv/single.html" at <partial "header.html" .>: error calling partial: execute of template failed: template: partials/header.html:42:9: executing "partials/header.html" at <partial "icons/tabler-icon.html" "menu-2">: error calling partial: execute of template failed: template: partials/icons/tabler-icon.html:1:3: executing "partials/icons/tabler-icon.html" at <partial "icons/svg.html" (printf "tabler-icons/%s.svg" .)>: error calling partial: "E:\gruvbox\layouts\partials\icons\svg.html:2:18": execute of template failed: template: partials/icons/svg.html:2:18: executing "partials/icons/svg.html" at <$path>: nil pointer evaluating resource.Resource.Content
ERROR 2023/06/18 22:05:09 render of "page" failed: execute of template failed: template: _default/single.html:9:9: executing "_default/single.html" at <partial "header.html" .>: error calling partial: execute of template failed: template: partials/header.html:42:9: executing "partials/header.html" at <partial "icons/tabler-icon.html" "menu-2">: error calling partial: execute of template failed: template: partials/icons/tabler-icon.html:1:3: executing "partials/icons/tabler-icon.html" at <partial "icons/svg.html" (printf "tabler-icons/%s.svg" .)>: error calling partial: "E:\gruvbox\layouts\partials\icons\svg.html:2:18": execute of template failed: template: partials/icons/svg.html:2:18: executing "partials/icons/svg.html" at <$path>: nil pointer evaluating resource.Resource.Content
ERROR 2023/06/18 22:05:09 render of "page" failed: execute of template failed: template: _default/single.html:9:9: executing "_default/single.html" at <partial "header.html" .>: error calling partial: execute of template failed: template: partials/header.html:42:9: executing "partials/header.html" at <partial "icons/tabler-icon.html" "menu-2">: error calling partial: execute of template failed: template: partials/icons/tabler-icon.html:1:3: executing "partials/icons/tabler-icon.html" at <partial "icons/svg.html" (printf "tabler-icons/%s.svg" .)>: error calling partial: "E:\gruvbox\layouts\partials\icons\svg.html:2:18": execute of template failed: template: partials/icons/svg.html:2:18: executing "partials/icons/svg.html" at <$path>: nil pointer evaluating resource.Resource.Content
Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: _default/single.html:9:9: executing "_default/single.html" at <partial "header.html" .>: error calling partial: execute of template failed: template: partials/header.html:42:9: executing "partials/header.html" at <partial "icons/tabler-icon.html" "menu-2">: error calling partial: execute of template failed: template: partials/icons/tabler-icon.html:1:3: executing "partials/icons/tabler-icon.html" at <partial "icons/svg.html" (printf "tabler-icons/%s.svg" .)>: error calling partial: "E:\gruvbox\layouts\partials\icons\svg.html:2:18": execute of template failed: template: partials/icons/svg.html:2:18: executing "partials/icons/svg.html" at <$path>: nil pointer evaluating resource.Resource.Content
Built in 1699 ms

In another issue I found this, but still can not fix it.

hugo mod get -u ./... 
hugo mod npm pack 
npm install 

I don't have too much knowledge of coding. If you need more information, please let me know😥

Implement tag cloud partial

  • Implement tag cloud
  • Add it to the 404 page
  • Display in sidebar
  • Add maxTagCount config param that limits the number of displayed tags

Quickstart throws an error

When i follow the quickstart instructions and run hugo server i get this error message:

WARN 2022/08/18 21:53:25 Module "github.com/schnerring/hugo-theme-gruvbox" is not compatible with this Hugo version; run "hugo mod graph" for more information.
Start building sites …
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66 windows/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
ERROR 2022/08/18 21:53:31 render of "home" failed: "C:\Hugo\test\layouts\index.html:5:5": execute of template failed: template: index.html:5:5: executing "main" at <partial "post-list.html" $paginator>: error calling partial: "C:\Hugo\test\layouts\partials\post-list.html:3:7": execute of template failed: template: partials/post-list.html:3:7: executing "partials/post-list.html" at <partial "post-header.html" (dict "page" . "pageIndex" $pageIndex)>: error calling partial: "C:\Hugo\test\layouts\partials\post-header.html:40:9": execute of template failed: template: partials/post-header.html:40:9: executing "partials/post-header.html" at <partial "image.html" (dict "src" .page.Params.cover.src "alt" .page.Params.cover.alt "caption" .page.Params.cover.caption "page" .page "lazy" $lazy)>: error calling partial: "C:\Hugo\test\layouts\partials\image.html:55:28": execute of template failed: template: partials/image.html:55:28: executing "partials/image.html" at <$image.Resize>: error calling Resize: image "C:\Hugo\test\content\blog\image-optimization\alexandre-van-thuan-mr9FouttLGY-unsplash.jpg": this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information
ERROR 2022/08/18 21:53:31 render of "section" failed: "C:\Hugo\test\layouts_default\list.html:2:5": execute of template failed: template: _default/list.html:2:5: executing "main" at <partial "post-list.html" .Paginator>: error calling partial: "C:\Hugo\test\layouts\partials\post-list.html:3:7": execute of template failed: template: partials/post-list.html:3:7: executing "partials/post-list.html" at <partial "post-header.html" (dict "page" . "pageIndex" $pageIndex)>: error calling partial: "C:\Hugo\test\layouts\partials\post-header.html:40:9": execute of template failed: template: partials/post-header.html:40:9: executing "partials/post-header.html" at <partial "image.html" (dict "src" .page.Params.cover.src "alt" .page.Params.cover.alt "caption" .page.Params.cover.caption "page" .page "lazy" $lazy)>: error calling partial: "C:\Hugo\test\layouts\partials\image.html:55:28": execute of template failed: template: partials/image.html:55:28: executing "partials/image.html" at <$image.Resize>: error calling Resize: image "C:\Hugo\test\content\blog\image-optimization\alexandre-van-thuan-mr9FouttLGY-unsplash.jpg": this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information
Error: Error building site: failed to render pages: render of "page" failed: "C:\Hugo\test\layouts_default\single.html:3:7": execute of template failed: template: _default/single.html:3:7: executing "main" at <partial "post-header.html" (dict "page" . "pageIndex" 0)>: error calling partial: "C:\Hugo\test\layouts\partials\post-header.html:40:9": execute of template failed: template: partials/post-header.html:40:9: executing "partials/post-header.html" at <partial "image.html" (dict "src" .page.Params.cover.src "alt" .page.Params.cover.alt "caption" .page.Params.cover.caption "page" .page "lazy" $lazy)>: error calling partial: "C:\Hugo\test\layouts\partials\image.html:55:28": execute of template failed: template: partials/image.html:55:28: executing "partials/image.html" at <$image.Resize>: error calling Resize: image "C:\Hugo\test\content\blog\image-optimization\alexandre-van-thuan-mr9FouttLGY-unsplash.jpg": this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information
Built in 6226 ms

I installed hugo just 2 days ago, so i don't know what the problem would be there

my hugo version:
hugo version

hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66 windows/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio

setting defaultTheme has no effect

Setting params.defaultTheme in ./config/_default/config.toml has no effect.
No matter whether set to "dark" or "light", the theme is always dark.

On the other hand, setting params.themeColor and params.themeContrast have the desired effects.

Question about search

Hi,
I just ported my small blog/site from Wordpress to a github site using hugo/gruvbox.

Firstly, very cool - I like it a lot!

My question related to the search option - it only seems to search/index blog/post items.
Ideally I'd like it to search all my content.

I checked your personal site and it seems to behave the same.

Wondering if this line of code is pointing to some config that can be added/tweaked to add extra sections to index?

{{ $list := (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}

Thanks again - your theme is awesome.

Katex support

Hey, great work on the theme! I plan on using a lot of math equations so I was wondering whether you could add LaTeX rendering support. I could only get it working by editing the theme itself, but if there is a way without editing the theme directly, please let me know.

Search on localhost only works for non-1313 Ports

Hi Michael, I encountered a strange scenario for this theme's Search functionality while testing on my local machine.

I followed the Install The Theme in the README.

In my new Hugo site, I created a new blog post with hugo new blog/name-of-post-here/index.md and started the Hugo server on localhost.

Somehow Search only succeeds if the Hugo server is started on a non-1313 Port.
Search fails if the Hugo server starts on the default 1313 Port.

As far as I can tell only Search is affect by the Port being 1313.

Please see screenshots.

Port_1313_Search_Fails Non_Port_1313_Search_Succeeds

Any way to remove the sidebar with the profile and bio?

I'd love to be able to use this as just a blog without my big head, socials, and bio on the side. Any way to remove it via the config? I can tear up the layout manually on my own locally, but I feel like there should be a better way.

Theme Installation Issue

Output from hugo server:
Start building sites …
hugo v0.116.1-3e1ea030a5897addaf9d113d0826709fe07f77c0+extended windows/amd64 BuildDate=2023-08-01T07:24:54Z VendorInfo=gohugoio

WARN found no layout file for "html" for kind "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN found no layout file for "html" for kind "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

-------------------+-----
Pages | 3
Paginator pages | 0
Non-page files | 0
Static files | 0
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0

Built in 5 ms
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)

Output on localhost:
image

OS: Windows

Relevant Link

Improve README

The README is out-of-date and needs an update:

  • Installation instructions
  • Contribution guidelines
  • Architecture Overview: explain toolchain (npm, esbuild, PostCSS, linters)

Implement i18n

Things to translate

  • CV
  • Read more
  • Modified date
  • Reading time
  • Date formats(?)

Critical CSS not being included in production builds

I have a custom css file with the path assets/css/critical/01_giscus.css. When running Hugo as a server, it is included in the HTML, but when running hugo by itself for production builds it is not included.

I know this because when I run hugo server --renderToDisk I can view the generated files in public and see that the CSS is there. I also set relativeURLs = true in Hugo.toml with no effect. Not sure if I'm doing something wrong or if it's a bug.

Improve module configuration

Currently, to use this theme, a site needs a config like this:

[module]
  [[module.imports]]
    path = "github.com/schnerring/hugo-gruvbox"
  [[module.mounts]]
    source = "assets"
    target = "assets"
  [[module.mounts]]
    source = "layouts"
    target = "layouts"
  [[module.mounts]]
    source = "static"
    target = "static"
  [[module.mounts]]
    source = "node_modules/prismjs"
    target = "assets/prismjs"
  [[module.mounts]]
    source = "node_modules/prism-themes/themes"
    target = "assets/prism-themes"
  [[module.mounts]]
    source = "node_modules/typeface-fira-code/files"
    target = "static/fonts"
  [[module.mounts]]
    source = "node_modules/typeface-roboto-slab/files"
    target = "static/fonts"
  [[module.mounts]]
    source = "node_modules/@tabler/icons/icons"
    target = "assets/tabler-icons"
  [[module.mounts]]
    source = "node_modules/simple-icons/icons"
    target = "assets/simple-icons"

A configuration like this would be more desirable:

[module]
  _merge = "deep"
  [[module.imports]]
    path = "github.com/schnerring/hugo-gruvbox"

This might be possible, but needs investigation. See the following Hugo issue:

gohugoio/hugo#8933 (comment)

Execute Template failed

Awesome theme ❤️

However,I am unable to get the theme working with json-resume

I get this error or a variation of it, depending on what I put on data/json_resume/en.json

Error: error building site: render: failed to render pages: render of "page" failed: "/var/folders/1z/rkgl7bkd3572l8bv3y56y6rw0000gn/T/hugo_cache/modules/filecache/modules/pkg/mod/github.com/schnerring/[email protected]/layouts/_default/baseof.html:14:11": 
execute of template failed: template: _default/single.html:14:11: executing "_default/single.html" at <partial "sidebar.html" .>: error calling partial: "/var/folders/1z/rkgl7bkd3572l8bv3y56y6rw0000gn/T/hugo_cache/modules/filecache/modules/pkg/mod/github.com/schnerring/[email protected]/layouts/partials/sidebar.html:17:9": 
execute of template failed: template: partials/sidebar.html:17:9: executing "partials/sidebar.html" at <partial "json-resume/basics.html" .>: error calling partial: "/var/folders/1z/rkgl7bkd3572l8bv3y56y6rw0000gn/T/hugo_cache/modules/filecache/modules/pkg/mod/github.com/schnerring/[email protected]/layouts/partials/json-resume/basics.html:58:13": execute of template failed: template: partials/json-resume/basics.html:58:13: 
executing "partials/json-resume/basics.html" at <partial "simple-icon.html" (dict "url" .url "network" .network "username" .username)>: error calling partial: "/var/folders/1z/rkgl7bkd3572l8bv3y56y6rw0000gn/T/hugo_cache/modules/filecache/modules/pkg/mod/github.com/schnerring/[email protected]/layouts/partials/simple-icon.html:8:22": execute of template failed: template: partials/simple-icon.html:8:22: executing "partials/simple-icon.html" at <$path>: nil pointer evaluating resource.Resource.Content

To help you troubleshoot, this could help

"<>/pkg/mod/github.com/schnerring/hugo-mod-json-resume@<>/layouts/partials/json-resume/basics.html:58:13": execute of template failed: template: partials/json-resume/basics.html:58:13: 
executing "partials/json-resume/basics.html" at <partial "simple-icon.html" (dict "url" .url "network" .network "username" .username)>: error calling partial: "<>pkg/mod/github.com/schnerring/hugo-mod-json-resume@v<>/layouts/partials/simple-icon.html:8:22": execute of template failed: template: partials/simple-icon.html:8:22: executing "partials/simple-icon.html" at <$path>: nil pointer evaluating 

Updating the modules does not solve the problem

I can get the site to work with empty data/json_resume/en.json but the issue with that is content is not centered(this could be a nice addition if one does not wish to add json_resume)

Improve internal templates

We need to figure out if the internal Twitter, RSS etc. internal templates are sufficient or need to be optimized for SEO and more.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency markdownlint-cli to ^0.40.0

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/publish.yml
  • actions/checkout v4
  • actions/setup-node v4
  • peaceiris/actions-hugo v2
  • stefanzweifel/git-auto-commit-action v5
  • actions/checkout v4
  • actions/setup-node v4
  • peaceiris/actions-hugo v2
  • cloudflare/pages-action v1
.github/workflows/renovate-hugo-modules.yml
  • actions/checkout v4
  • peaceiris/actions-hugo v2
  • stefanzweifel/git-auto-commit-action v5
gomod
go.mod
  • go 1.22.1
npm
package.hugo.json
  • @tabler/icons ^2.47.0
  • flexsearch 0.7.31
  • normalize.css ^8.0.1
  • prism-themes ^1.9.0
  • prismjs ^1.29.0
  • typeface-fira-code ^1.1.13
  • typeface-roboto-slab ^1.1.13
  • @fullhuman/postcss-purgecss ^5.0.0
  • cssnano ^6.0.5
  • eslint ^8.57.0
  • eslint-config-prettier ^9.1.0
  • eslint-plugin-prettier ^5.1.3
  • husky ^9.0.11
  • lint-staged ^15.2.2
  • markdownlint-cli ^0.39.0
  • postcss ^8.4.35
  • postcss-cli ^11.0.0
  • postcss-custom-media ^10.0.3
  • postcss-import ^16.0.1
  • postcss-nesting ^12.0.4
  • postcss-preset-env ^9.4.0
  • postcss-url ^10.1.3
  • prettier ^3.2.5
  • prettier-plugin-go-template ^0.0.15
  • stylelint ^16.2.1
  • stylelint-prettier ^5.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

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.