Coder Social home page Coder Social logo

frjo / hugo-theme-zen Goto Github PK

View Code? Open in Web Editor NEW
266.0 266.0 77.0 2.67 MB

A fast and clean Hugo base theme with css-grid and Hugo pipes support.

Home Page: https://zen-demo.xdeb.org/

License: GNU General Public License v2.0

JavaScript 8.73% HTML 40.34% Shell 1.26% SCSS 49.67%
css-grid hugo hugo-theme responsive theme

hugo-theme-zen's People

Contributors

apraditya avatar byeskille avatar celqaz avatar danielfdickinson avatar deining avatar dependabot[bot] avatar eriicf avatar frjo avatar fschrempf avatar httpsecure avatar k0a8t1o6 avatar larihuttunen avatar leoheitmannruiz avatar mohamed--abdel-maksoud avatar mortenkjarulff avatar onedrawingperday avatar tomaja-linuxo avatar veggiemonk avatar yitzhakbg avatar zezombini 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hugo-theme-zen's Issues

Searchbox in Sidebar

I have enabled searchform: true in the site config. And added following lines into the layouts/partial/sidebar.html partial in my site.
However when you search for a phrase, it doesn't show any results in the search page.

<section>
      <form id="search-form" class="search-form" action="/search" method="post" accept-charset="UTF-8" role="search">
        <label for="query" class="visually-hidden">{{ i18n "search_title" }}</label>
        <input type="search" id="query" name="query" class="search-text" placeholder="{{ i18n "search_placeholder" }}" maxlength="128">
        <button type="submit" name="submit" class="form-submit" >{{ i18n "search_title" }}</button>
      </form>
</section>

hugo server Error

hugo server
Building sites … WARN 2020/07/14 23:26:47 .File.UniqueID on zero object. Wrap it in if or with: {{ with .File }}{{ .UniqueID }}{{ end }}
ERROR 2020/07/14 23:26:47 TOCSS: failed to transform "sass/print.scss" (text/x-scss): resource "scss/sass/print.scss_6f664080c634a8edb051ceda3df60601" not found in file cache
Built in 42 ms
Error: Error building site: TOCSS: failed to transform "sass/styles.scss" (text/x-scss): resource "scss/sass/styles.scss_c253c1450adff31bb2ccb2afd691b09e" not found in file cache

Animated back to top button with CSS

The idea is to show a back to top button only after scrolling with CSS.

This article shows some methods that only use CSS, no JS.

I especially like this method with a fading button.

What do you guys think?

Light house Issue Not 100%

Performance
Best Practices
Serves images with low resolution
SEO
Document does not have a meta description
SEO
Tap targets are not sized appropriately
Accessibility
Heading elements are not in a sequentially-descending order
Accessibility
Links do not have a discernible name

Search box

Loving the search engine feature, would love to get a better idea how to create a working search box in the menu? The search feature is outstanding, but going to a webpage to search isn't ideal. Is there a way to activate a search box instead of a dedicated page?

Thanks :)

Sidebar lists all the posts on the site

If you enable the sidebar in the hugo config. The side displays all the published posts. I don't think there is way to limit the lists to latest 10 posts.

Issue building a site on AWS Amplify

Using this theme as a submodule of mine, when deploying the site using AWS Amplify I often encountered build error as following.

[WARNING]: Error: "/codebuild/output/src721358463/src/SITENAME/themes/zen/layouts/shortcodes/figure.html:18:1": parse failed: template: shortcodes/figure.html:18: illegal number syntax: "-". And the error is followed by failure messages.
2020-06-15T12:01:21.770Z [ERROR]: !!! Build failed
2020-06-15T12:01:21.841Z [ERROR]: !!! Non-Zero Exit Code detected

Podcast fails when using CDN

In layouts/podcast/rss.xml is trying to stat the file even if a CDN is configured:

{{ with .Params.podcast.mp3 }}{{ $file_stat := os.Stat (add "/static" (. | relURL)) }}<enclosure url="{{ if $.Site.Params.Podcast.cdn }}{{ add $.Site.Params.Podcast.cdn (. | relURL) }}{{ else }}{{ . | absURL }}{{ end }}" length="{{ $file_stat.Size }}" type="audio/mpeg" />{{ end }}

error calling Stat: LStat content/static/ep1.mp3: file does not exist

If I remove the call to stat and the length attribute it works as intended.

eslint giving errors with tip of 'main'

On Windows 10:

PS C:\Users\DanielDickinson\Build\hugo-dfd-sites\dfd-hugo-theme-zen> npm run lint-theme:js

> zen@1.0.0 lint-theme:js
> eslint "assets/js/**/*.js"

C:\Users\DanielDickinson\Build\hugo-dfd-sites\dfd-hugo-theme-zen\assets\js\search.js
  8:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

C:\Users\DanielDickinson\Build\hugo-dfd-sites\dfd-hugo-theme-zen\assets\js\tracking.js
  8:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'2 problems (2 errors, 0 warnings)

With node 16.19.1.

The line in question (in both cases) is:

import * as params from '@params';

Ask

Can i use it for comercial site?

Theme lacks support for Google Analytics

The theme looks (and feels?) good and is minimal, sadly doesn't support google analytics; this is bummer since user demography plays an important role while blogging (also other analytical tools - page views etc.)

Is it possible to support google analytics out of the box? Please let me know if you'd be interested in such a pull request.

Note: There is a work around to it - by adding custom scripts. Would prefer if it supports google analytics "out of the box".

Font size of code to large?

If I write a text in an unordered list which has code in it like

* `Application` - in an unordered list

it will be rendered correctly to monospace, but the font size looks too large. If I do it in normal text, it looks good. See screenshot
screen shot 2017-05-21 at 07 31 41

Problems occurs under all browser in Mac OSX.

Could it be fixed? Maybe something like 0.9em or 0.8em for monospace?

Dark mode

Hello!

Complete noob here to designing things. :) Is there a possibility to have a dark mode? Or do you happened to have a CSS lying around somewhere maybe for that? Pretty please? :))

Thanks!

languageCode: "sv-SE" not changing the texts

Hi,

My config.yaml:

baseurl: "https://gitte.one/"
title: "Gitte Kjærulff Møller"
theme: "zen"
languageCode: "sv-SE"

params:
  feedlinks: true
  podcast:
    title: "Gitte Kjærulff Møller"
    description: "Lydbøger."
    image: "images/podcast.jpg"
    category:
      name: "Books"

https://gitte.one/
The "Home" at the top and "Follow" is still English?

I can see that the language tag in the feeds has changed:
https://gitte.one/index.xml
https://gitte.one/podcast/index.xml
So something is in fact working.

What am I doing wrong?

/Morten

Theme demo broken on Hugo Themes Showcase

Hello @frjo

Currently your theme's demo does not generate as mentioned in gohugoio/hugoThemes#669 (comment)

To fix you need to change line 8 of theme.toml to: min_version = "0.55.0"

The min_version needs to be a string.

Feel free to close this issue once you do the above

Also note that once gohugoio/hugoThemes#668 is addressed you will need to keep an eye on whether the Zen theme demo generates on the Hugo website.

We are a very small team and we just cannot keep up opening issues in the various theme repositories. Whenever a theme demo breaks and remains broken then at some point it will be removed from the list without prior warning.

Thank you.

cc: @digitalcraftsman

Cdn url misses a / in rss feed

Site: https://antihashed.xyz
Repo: https://github.com/metasikander/antihashed

Cdn config line:
cdn: "https://antihashed.us-east-1.linodeobjects.com"

rss.xml result line in https://antihashed.xyz/podcast/index.xml:
<enclosure url="https:/antihashed.us-east-1.linodeobjects.com/episode_005.m4a" type="audio/mpeg"/>

The url in the xml is missing a / after https:, so some podcast players can't fetch the file (while others handles it apparently).
Updated to the latest version of the template, and hugo.

Problem with syntax highlighting

Hi,

when formatting a code block with Hugo's standard syntax highlighting, some of the code is barely readable due to the foreground colour being too dark.

Example blog post demonstrating the issue

I guess, the issue stems from the fact that _reset.scss sets the foreground colour for code elements, but Hugo's syntax highlighting sets the foreground color on the surrounding pre element.

Different Zen theme settings for each language

Is it possible to provide params for each language in a multilingual site. Am following the new config structure provide by HUGO Docs project

Am declaring Zen theme params in config/_default/params.toml

[en]
contact = "ACME"
copyright = "© ACME 2023"
description = "ACME Project"

[de]
contact = "ACME"
copyright = " © ACME 2023"
description = "ACME Projekt"

Missing tags component

In commit 1d6e507 on assets/sass/styles.scss the following import references a file which does not exist:

@import 'components/tags/tags'

Docs: Switching to Version 3.x

Please kindly provide any instructions in README to switch to version 3.x of hugo-theme-zen them. This would help early adopters to give early feedback.

Error building site: TOCSS: failed to transform "sass/styles.scss"

I installed your latest Zen theme update:

$ git submodule update --remote --merge

And I am now seeing a build error:

george@imac1:~/Hugo/apcom
$ hugo server
Start building sites … 
hugo v0.99.1+extended darwin/amd64 BuildDate=unknown
Error: Error building site: TOCSS: failed to transform "sass/styles.scss" (text/x-scss): "/Users/george/Hugo/apcom/themes/zen/assets/sass/reset/sections/_sections.scss:80:16": Undefined variable: "$max-line-width".
Built in 532 ms

Minor contact form issue

I have been testing my Contact form to verify that it's working ok. I have noticed a minor issue in the message body. Roughly about every 69 characters, spaces between words are getting dropped. Here's one of my test messages:

"Ok, I saw something strange. It looked like there was spacing betweenwords after they wrapped around in the message box. This test messagestarted a 2nd line after "around" just before "in the". Let's see whathappened (after "Let's see")."

I thought that it may had been happening at the word wrap in the message box, but that wasn't the case. I was very careful to make sure there were spaces between each word.

I must confess that I have been experimenting with a couple of different themes, but I keep coming back to yours for the quality of the code and the contact form. I think that if I could learn how to add a "feature image," your theme would be my first choice. I'll keep researching and experimenting.

George

Logo Not Changing

Hi Fredrik,

Thank you for creating this theme

I tried changing the logo of my website but it doesn't seem to work. The default theme logo is still showing

I followed README.md instructions and have my logo relative path as static/images/logo.png. ( It's also present under public directory and has the following relative path public/images/logo.png.)

Though this shouldn't change anything, I also tried changing logo flag in config.toml to true, and that didn't work too

I don't think I changed anything in baseof.html, but here it is just for safety:

<!DOCTYPE html>
<html class="nojs" lang="{{ .Site.Language.Lang }}" dir="{{ .Site.Language.LanguageDirection | default "ltr" }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">

<title>{{ block "title" . }}{{ .Title }} – {{ .Site.Title }}{{ end }}</title>
{{ partial "meta.html" . }}
{{ partialCached "styles.html" . }}
{{- block "head" . }}{{ end }}
{{ partial "meta_json_ld.html" . }}
{{ partial "scripts.html" . }}
{{ partialCached "tracking.html" . }}
</head>

<body class="{{ if .IsPage }}single-page{{ else }}list-page{{ end }}{{ if .IsHome }} front{{ end }}">
<div class="page layout__page{{ if $.Param "sidebar" | default true }} layout__sidebar-second{{ end }}">
<header class="header layout__header">
{{ if $.Param "logo" | default true }}<a href="{{ "/" | relLangURL }}" title="Home" rel="home" class="header__logo"> <img src="{{ "/images/logo.png" | relURL }}" alt="Home" class="header__logo-image"></a>{{ end }}
<h1 class="header__site-name">
<a href="{{ "/" | relLangURL }}" title="Home" class="header__site-link" rel="home"><span>{{ .Site.Title }}</span></a>
</h1>
<div class="region header__region">
{{ if .Site.IsMultiLingual }}{{ partial "language-selector.html" . }}{{ end -}}
</div>
</header>

{{ partial "menu.html" . }}

{{ block "main" . }}{{ end }}

{{ if $.Param "sidebar" }}{{ partial "sidebar.html" . }}{{ end -}}

<footer class="footer layout__footer">
{{ if $.Param "feedlinks" }}{{ partial "feedlinks.html" . }}{{ end -}}
<p>{{ with $.Param "copyright" }}{{ . | markdownify }}{{ else }}<span>© {{ .Site.Title }}</span>{{ end }}</p>
{{ with $.Param "footer" }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if $.Param "poweredby" }}<p>Powered by <a href="https://gohugo.io/">Hugo</a> and the <a href="https://github.com/frjo/hugo-theme-zen">Zen theme</a>.</p>{{ end }}
</footer>

</div>
{{ if $.Param "mobilemenu" }}{{ partial "mobilemenu.html" . }}{{ end -}}
</body>
</html>

PS: Changing the value of logo.png in baseof.html to something other than logo.png (e.g. custom_logo.png), and having the same file name under static/images fixes it, but I don't think that's the right approach since it requires changing around the theme template

Looking forward to your response
Cheers,
Hakeem

Using figure shortcode for non /static images

Hi

I'm not sure it's the best place to ask/suggest this.
When using the figure shortcode in "plain" Hugo, the images can also come from the page bundles, i.e. they can be next to index.md file. With the figure shortcode from the Zen theme that's impossible, because: {{ with (imageConfig (add "/static/" (.Get "src"))) -}}, so the images are meant to be stored in static only.
Could this be relaxed somehow, so something like this: https://alison.rbind.io/post/2019-02-21-hugo-page-bundles/ works?

Thanks
P.

Please add support for menu.shortcuts

Say I have my home page generated using Hugo+Zen on foo.bar but for my blog I use Jekyll and GitHub pages + custom domain. In short I have my blog at blog.foo.bar. Now I would like to add a menu item to link to my blog but I cannot do this. When I add [[menu.main]] pointing to my blog the autogenerated entries no longer appear in the menu. On the other hand the syntax [[menu.shortcuts]] is also not supported.

My workaround for now is to hack menu.html (I added this after Site.Sections):

{{ if .Site.Menus.shortcuts -}}
{{ range .Site.Menus.shortcuts -}}
<li><a href="{{ .URL | relLangURL }}">{{ .Name }}</a></li>
{{ end -}}
{{ end -}}

And in config.toml:

[[menu.shortcuts]]
name = "Programming Blog"
identifier = "blog"
url = "https://marcin-chwedczuk.github.io/"
weight = 0

This will not generate a proper mobile menu - I guess I need to hack more...

It would be good to have support for shortcuts included out of the box. Even better if we could support it with weights field so that both shortcuts and autogenerated menu entries could be mixed.

No podcast tags on rss despite of parameters exist

RSS file generated from the rss link on the footer does not contain podcast tags for iTunes.
No example given on the exampleSite, so unsure if my implementation is correct.

The config.yaml is

params:
  contact: ...
  ...
  podcast:
    title: ...
    descriptions: ...
    ...

And each entry contains below as its markdown header

author: ...
title: ...
podcast: ...
  mp3: ...
  duration: ...
  image:
    src: ...

logo + mobile results on Lighthouse overlap warning

If one enables a 64x64 logo in params, then Lighthouse complains that the logo and and the mobile menu overlap (the warning is 'inappropriately sized tap targets' and details describe it as an overlap).

Fails to work with hugo quickstart guide

Tried to create a new static site with hugo today, following the quickstart guide. I followed the steps in that guide exactly, with the exception of choosing the zen theme.

When I got to Step 3: Add a Theme, I clicked through to themes.gohugo.io and saw the #2 theme in the list was Zen. It looked nice, so I installed it instead of the suggestion in the quick start guide, using the following commands:

cd quickstart
git init
git submodule add https://github.com/frjo/hugo-theme-zen.git themes/zen
echo 'theme = "zen"' >> config.toml

However, then Step 5: Start the Hugo server failed with the following error message:

$  hugo server -D
Start building sites …
WARN 2020/11/14 23:23:39 .File.UniqueID on zero object. Wrap it in if or with: {{ with .File }}{{ .UniqueID }}{{ end }}
ERROR 2020/11/14 23:23:39 TOCSS: failed to transform "sass/print.scss" (text/x-scss): resource "scss/sass/print.scss_6f664080c634a8edb051ceda3df60601" not found in file cache
Built in 11 ms
Error: Error building site: TOCSS: failed to transform "sass/styles.scss" (text/x-scss): resource "scss/sass/styles.scss_c253c1450adff31bb2ccb2afd691b09e" not found in file cache

I installed

$ hugo version
Hugo Static Site Generator v0.78.2-959724F0 linux/amd64 BuildDate: 2020-11-13T10:08:14Z

and I'm doing this on an Ubuntu 18.04 install on WSL2:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:        18.04
Codename:       bionic
$ uname -r
4.19.128-microsoft-standard

If, instead, I use the theme suggested in the quick start guide, the server starts successfully, so I suspect it was my choice of theme that was the issue.

list-style-type can't be overridden?

This is probably my fault, but I have exhausted my Google-fu and imagination. :)

I can't get list-style-type to be honored. I have tried _custom.scss and even style attribute in HTML.

  1. Allow unsafe HTML in config.yaml
  2. Add an HTML list in about.md:
<ul>
<li style="list-style-type:none; color:green;">Foo</li>
<li>Bar</li>
</ul>
  1. First list item is green, but the circle is visible. I had expected it to not show.

Is there some !important setting in the sass code making it impossible to override?

Disable submission dates in Search results

The search results doesn't seem to check if submitted = false. It will always show submitted dates in search results.

example-screenshot

Am using following language specific settings in config/_default/languages.toml

[en]
languageCode = "en-US"
languageName = "English"
weight = 1
contact = "OFDN"
copyright = "© OFDN 2023"
description = "OFDN Library Project"
dateformat = "January 2, 2006"
feedlinks = false
realfavicongenerator = true
relatedposts = true
footer = "OFDN Library Prototype."
imageMaxWidth = 400
mobileMenu = true
poweredby = false
submitted = false
sidebar = true
pluralizelisttitles = false
removePathAccents = true
paginate = 10
paginatePath = "page"
rssLimit = 20
searchform = true
menuInHeader = false 

[or]
languageCode = "or"
languageName = "Odia"
weight = 2
title = "OFDN ଲାଇବ୍ରେରୀ ପ୍ରୋଟୋଟାଇପ୍ |"
description = "OFDN ଲାଇବ୍ରେରୀ ପ୍ରୋଜେକ୍ଟ |"
contact = "Odia OFDN"
copyright = "Odia © OFDN 2023"
dateformat = "January 2, 2006"
feedlinks = false
realfavicongenerator = true
relatedposts = true
footer = "OFDN ଲାଇବ୍ରେରୀ ପ୍ରୋଟୋଟାଇପ୍ |"
imageMaxWidth = 400
mobileMenu = true
poweredby = false
submitted = false
sidebar = true
pluralizelisttitles = false
removePathAccents = true
paginate = 10
paginatePath = "page"
rssLimit = 20
searchform = true
menuInHeader = false 

Customize Fonts

Hi,

I'm checking out this theme and I'm wondering what's the best way to customize things like fonts. For example I want to use a different font family for the body text.

Is there a way to customize the SASS variables on the project level? I tried copying _variables.scss to `assets/sass/, but that doesn't seem to work.

Thanks!

Search Form in Sidebar,

I have added the following code to top of sidebar partial in my layouts folder. I would like to post to /search page that contains search partial and show results.

  <section>
  <form id="search-form" class="search-form" action="/search" method="post" accept-charset="UTF-8" role="search">
    <label for="query" class="visually-hidden">{{ i18n "search_title" }}</label>
    <input type="search" id="query" name="query" class="search-text" placeholder="{{ i18n "search_placeholder" }}" maxlength="128">
    <button type="submit" name="submit" class="form-submit" >{{ i18n "search_title" }}</button>
  </form>
 </section>

The search.md page contains the following.

---
title: "Search"
searchform: true

---

{{< search >}}

Max image width does not work when the sidebar is set to false

I have these settings in my config.yaml file:

imageMaxWidth: 600
sidebar: false

I have noticed that the max image width is not working when sidebar is set to false. It works fine when set to true. This is an example. I currently have sidebar set to false. The actual image width is 1280. I know that I can set the desired width in the figure short code. But I would have to do that for every image.

I have also installed a notice short code that is using an SVG image for the background color, and I noticed that it is also expanding the beyond the 600 width.

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.