Giter Club home page Giter Club logo

hugo-theme-stack's People

Contributors

0xmehedi avatar alexhua avatar andrewmoise avatar aynh avatar bhedouin avatar brandonszeto avatar caijimmy avatar clh021 avatar cmpute avatar cobalto avatar deining avatar fariszr avatar farrelf avatar grisu48 avatar jamesmcmurry avatar kkkk-source avatar miclnl avatar mikdal002 avatar nella17 avatar romainx avatar simbafs avatar sot-tech avatar tanmx avatar tesujimath avatar thejiahao avatar totoroot avatar utybo avatar vlourme avatar weltolk avatar zhixuan2333 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hugo-theme-stack's Issues

i18n translation key renaming

Related with #62, I thought about renaming some i18n translation keys.

For example, searchPlaceholder to search.placeholder, grouping translations by context.

The result would be something like:

toggleMenu:
    other: Toggle Menu

article:
    relatedContents:
        other: Related contents
    lastUpdatedOn:
        other: Last updated on

notFound:
    title:
        other: Not Found
    subtitle:
        other: This page does not exist.

widget:
    archives:
        title:
            other: Archives
        more:
            other: More
    tagCloud:
        title:
            other: Tags

search:
    title:
        other: Search
    placeholder:
        other: Type something...
    resultTitle:
        other: '#PAGES_COUNT pages (#TIME_SECONDS seconds)'

footer:
    builtWith:
        other: 'Built with {{ .Generator }}'
    designedBy:
        other: 'Theme {{ .Theme }} designed by {{ .DesignedBy }}'

Cannot translate section title with given key

I am new at Hugo. So may be this is not a bug or it is not related theme. I am not sure.

I try to translate section title on layout but not succesed.
In single category or tag page, it shown in English: https://iozcelik.github.io/iozcelik/categories/yazilim/
However in archive page, it shown my translated language: https://iozcelik.github.io/iozcelik/archives/

Also when translating my language
<h3 class="section-count">{{ T "list.page" (len .Pages) }}</h3> ,
Hugo give a warning because it doesn't find in i18n. I add manuelly but I think it is wrong.

Better icon file missing error handling

Is your feature request related to a problem? Please describe.

Currently, for sidebar menu, if the user introduces an icon file name which doesn't exist under assets/icons, an error will pop out:

image

However, this error message is very unclear.

Describe the solution you'd like

Implement a helper called icon. It receives as argument the name of the icon and returns its content. An error will be throw if no such icon is found under assets/icons.

Error message could be something like: Error: icon ${iconName}.svg not found under assets/icons folder

不知道是不是bug custom.scss 不起作用

Describe the bug

我在 custom.scss 里添加东西之后
css 不会添加 custom.scss 里的东西

和 更改后scss无变化

Desktop:

  • OS: win10
  • Browser: chrome
  • Version: 87.0.4280.88

希望大佬可以适配一下Gridea

hugo hexo这样的纯代码工具对于非程序员来说,实在是太麻烦了点。
Gridea的可视化操作就简单多了,适配Gridea会让更多人用上这个漂亮的主题!
非常感谢!

hugo server时遇到问题

我Clone了这个主题以后,hugo server 遇到了如下的问题,而换用hugo默认主题ananke则成功部署,请问我应该怎么解决

linhk@ubuntu:~/文档/quickstart$ hugo server
Building sites … WARN 2020/09/05 22:33:01 found no layout file for "HTML" for kind "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/09/05 22:33:01 found no layout file for "HTML" for kind "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
Built in 36 ms
Error: Error building site: failed to render pages: render of "home" failed: execute of template failed: template: index.html:8:11: executing "index.html" at <partial "footer/script.html" .>: error calling partial: "/home/linhk/文档/quickstart/themes/stack/layouts/partials/footer/script.html:5:43": execute of template failed: template: partials/footer/script.html:5:43: executing "partials/footer/script.html" at <js>: can't evaluate field Build in type string

根目录下的config.toml

baseURL = "http://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
theme = "stack"

Error when deploying using Netlify

Describe the bug
I'm trying to deploy my website using Netlify but I'm getting an error:

Error: "/opt/build/repo/themes/hugo-theme-stack/layouts/partials/article/components/details.html:8:1": parse failed: template: partials/article/components/details.html:8: illegal number syntax: "-"

To Reproduce
Steps to reproduce the behavior:

  1. Create a new project using Netlify
  2. Follow the instructions on the screen to set up the project on GitHub
  3. Start to "Deploy your site"
  4. See error happening in the logs

Expected behavior
The website should not be prevented from deploying due to syntax errors

Screenshots
image

Error when running hugo server -D

Describe the bug
Start building sites …
ERROR 2020/12/31 05:27:33 render of "page" failed: execute of template failed: template: _default/single.html:4:12: executing "_default/single.html" at <partial "head/head.html" .>: error calling partial: execute of template failed: template: partials/head/head.html:14:4: executing "partials/head/head.html" at <partial "head/opengraph/include.html" .>: error calling partial: execute of template failed: template: partials/head/opengraph/include.html:1:3: executing "partials/head/opengraph/include.html" at <partial "head/opengraph/provider/base" .>: error calling partial: execute of template failed: template: partials/head/opengraph/provider/base.html:40:13: executing "partials/head/opengraph/provider/base.html" at <partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph">: error calling partialCached: "/Users/irfanirawansukirman/Documents/personal_projects/8droid/themes/stack/layouts/partials/helper/image.html:27:31": execute of template failed: template: partials/helper/image.html:27:31: executing "partials/helper/image.html" at <index .Context.Site.Params.defaultImage .Type>: error calling index: index of untyped nil
ERROR 2020/12/31 05:27:33 render of "section" failed: execute of template failed: template: _default/list.html:4:12: executing "_default/list.html" at <partial "head/head.html" .>: error calling partial: execute of template failed: template: partials/head/head.html:14:4: executing "partials/head/head.html" at <partial "head/opengraph/include.html" .>: error calling partial: execute of template failed: template: partials/head/opengraph/include.html:1:3: executing "partials/head/opengraph/include.html" at <partial "head/opengraph/provider/base" .>: error calling partial: execute of template failed: template: partials/head/opengraph/provider/base.html:40:13: executing "partials/head/opengraph/provider/base.html" at <partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph">: error calling partialCached: "/Users/irfanirawansukirman/Documents/personal_projects/8droid/themes/stack/layouts/partials/helper/image.html:27:31": execute of template failed: template: partials/helper/image.html:27:31: executing "partials/helper/image.html" at <index .Context.Site.Params.defaultImage .Type>: error calling index: index of untyped nil
ERROR 2020/12/31 05:27:33 render of "taxonomy" failed: execute of template failed: template: _default/list.html:4:12: executing "_default/list.html" at <partial "head/head.html" .>: error calling partial: execute of template failed: template: partials/head/head.html:14:4: executing "partials/head/head.html" at <partial "head/opengraph/include.html" .>: error calling partial: execute of template failed: template: partials/head/opengraph/include.html:1:3: executing "partials/head/opengraph/include.html" at <partial "head/opengraph/provider/base" .>: error calling partial: execute of template failed: template: partials/head/opengraph/provider/base.html:40:13: executing "partials/head/opengraph/provider/base.html" at <partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph">: error calling partialCached: "/Users/irfanirawansukirman/Documents/personal_projects/8droid/themes/stack/layouts/partials/helper/image.html:27:31": execute of template failed: template: partials/helper/image.html:27:31: executing "partials/helper/image.html" at <index .Context.Site.Params.defaultImage .Type>: error calling index: index of untyped nil
ERROR 2020/12/31 05:27:33 render of "taxonomy" failed: execute of template failed: template: _default/list.html:4:12: executing "_default/list.html" at <partial "head/head.html" .>: error calling partial: execute of template failed: template: partials/head/head.html:14:4: executing "partials/head/head.html" at <partial "head/opengraph/include.html" .>: error calling partial: execute of template failed: template: partials/head/opengraph/include.html:1:3: executing "partials/head/opengraph/include.html" at <partial "head/opengraph/provider/base" .>: error calling partial: execute of template failed: template: partials/head/opengraph/provider/base.html:40:13: executing "partials/head/opengraph/provider/base.html" at <partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph">: error calling partialCached: "/Users/irfanirawansukirman/Documents/personal_projects/8droid/themes/stack/layouts/partials/helper/image.html:27:31": execute of template failed: template: partials/helper/image.html:27:31: executing "partials/helper/image.html" at <index .Context.Site.Params.defaultImage .Type>: error calling index: index of untyped nil
Built in 69 ms
Error: Error building site: failed to render pages: render of "home" failed: execute of template failed: template: index.html:4:12: executing "index.html" at <partial "head/head.html" .>: error calling partial: execute of template failed: template: partials/head/head.html:14:4: executing "partials/head/head.html" at <partial "head/opengraph/include.html" .>: error calling partial: execute of template failed: template: partials/head/opengraph/include.html:1:3: executing "partials/head/opengraph/include.html" at <partial "head/opengraph/provider/base" .>: error calling partial: execute of template failed: template: partials/head/opengraph/provider/base.html:40:13: executing "partials/head/opengraph/provider/base.html" at <partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph">: error calling partialCached: "/Users/irfanirawansukirman/Documents/personal_projects/8droid/themes/stack/layouts/partials/helper/image.html:27:31": execute of template failed: template: partials/helper/image.html:27:31: executing "partials/helper/image.html" at <index .Context.Site.Params.defaultImage .Type>: error calling index: index of untyped nil
irfanirawansukirman@Irfans-MacBook-Pro-2 8droid %
irfanirawansukirman@Irfans-MacBook-Pro-2 8droid % hugo server -D
Start building sites …
ERROR 2020/12/31 05:27:37 render of "taxonomy" failed: execute of template failed: template: _default/list.html:4:12: executing "_default/list.html" at <partial "head/head.html" .>: error calling partial: execute of template failed: template: partials/head/head.html:14:4: executing "partials/head/head.html" at <partial "head/opengraph/include.html" .>: error calling partial: execute of template failed: template: partials/head/opengraph/include.html:1:3: executing "partials/head/opengraph/include.html" at <partial "head/opengraph/provider/base" .>: error calling partial: execute of template failed: template: partials/head/opengraph/provider/base.html:40:13: executing "partials/head/opengraph/provider/base.html" at <partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph">: error calling partialCached: "/Users/irfanirawansukirman/Documents/personal_projects/8droid/themes/stack/layouts/partials/helper/image.html:27:31": execute of template failed: template: partials/helper/image.html:27:31: executing "partials/helper/image.html" at <index .Context.Site.Params.defaultImage .Type>: error calling index: index of untyped nil
ERROR 2020/12/31 05:27:37 render of "page" failed: execute of template failed: template: _default/single.html:4:12: executing "_default/single.html" at <partial "head/head.html" .>: error calling partial: execute of template failed: template: partials/head/head.html:14:4: executing "partials/head/head.html" at <partial "head/opengraph/include.html" .>: error calling partial: execute of template failed: template: partials/head/opengraph/include.html:1:3: executing "partials/head/opengraph/include.html" at <partial "head/opengraph/provider/base" .>: error calling partial: execute of template failed: template: partials/head/opengraph/provider/base.html:40:13: executing "partials/head/opengraph/provider/base.html" at <partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph">: error calling partialCached: "/Users/irfanirawansukirman/Documents/personal_projects/8droid/themes/stack/layouts/partials/helper/image.html:27:31": execute of template failed: template: partials/helper/image.html:27:31: executing "partials/helper/image.html" at <index .Context.Site.Params.defaultImage .Type>: error calling index: index of untyped nil
ERROR 2020/12/31 05:27:37 render of "home" failed: execute of template failed: template: index.html:4:12: executing "index.html" at <partial "head/head.html" .>: error calling partial: execute of template failed: template: partials/head/head.html:14:4: executing "partials/head/head.html" at <partial "head/opengraph/include.html" .>: error calling partial: execute of template failed: template: partials/head/opengraph/include.html:1:3: executing "partials/head/opengraph/include.html" at <partial "head/opengraph/provider/base" .>: error calling partial: execute of template failed: template: partials/head/opengraph/provider/base.html:40:13: executing "partials/head/opengraph/provider/base.html" at <partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph">: error calling partialCached: "/Users/irfanirawansukirman/Documents/personal_projects/8droid/themes/stack/layouts/partials/helper/image.html:27:31": execute of template failed: template: partials/helper/image.html:27:31: executing "partials/helper/image.html" at <index .Context.Site.Params.defaultImage .Type>: error calling index: index of untyped nil
ERROR 2020/12/31 05:27:37 render of "taxonomy" failed: execute of template failed: template: _default/list.html:4:12: executing "_default/list.html" at <partial "head/head.html" .>: error calling partial: execute of template failed: template: partials/head/head.html:14:4: executing "partials/head/head.html" at <partial "head/opengraph/include.html" .>: error calling partial: execute of template failed: template: partials/head/opengraph/include.html:1:3: executing "partials/head/opengraph/include.html" at <partial "head/opengraph/provider/base" .>: error calling partial: execute of template failed: template: partials/head/opengraph/provider/base.html:40:13: executing "partials/head/opengraph/provider/base.html" at <partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph">: error calling partialCached: "/Users/irfanirawansukirman/Documents/personal_projects/8droid/themes/stack/layouts/partials/helper/image.html:27:31": execute of template failed: template: partials/helper/image.html:27:31: executing "partials/helper/image.html" at <index .Context.Site.Params.defaultImage .Type>: error calling index: index of untyped nil
Built in 46 ms
Error: Error building site: failed to render pages: render of "section" failed: execute of template failed: template: _default/list.html:4:12: executing "_default/list.html" at <partial "head/head.html" .>: error calling partial: execute of template failed: template: partials/head/head.html:14:4: executing "partials/head/head.html" at <partial "head/opengraph/include.html" .>: error calling partial: execute of template failed: template: partials/head/opengraph/include.html:1:3: executing "partials/head/opengraph/include.html" at <partial "head/opengraph/provider/base" .>: error calling partial: execute of template failed: template: partials/head/opengraph/provider/base.html:40:13: executing "partials/head/opengraph/provider/base.html" at <partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph">: error calling partialCached: "/Users/irfanirawansukirman/Documents/personal_projects/8droid/themes/stack/layouts/partials/helper/image.html:27:31": execute of template failed: template: partials/helper/image.html:27:31: executing "partials/helper/image.html" at <index .Context.Site.Params.defaultImage .Type>: error calling index: index of untyped nil

To Reproduce
Steps to reproduce the behavior:
If you do not have git installed, you can download the archive of the latest version of this theme from: https://github.com/CaiJimmy/hugo-theme-stack/archive/master.zip
Extract that .zip file to get a “gohugo-theme-stack-master” directory.
Rename that directory to “stack”, and move it into the “themes/” directory.

Expected behavior
Implementation hugo theme

Build relative link using relLangURL

Is your feature request related to a problem? Please describe.
Currently, this theme builds links to taxonomy using expressions like {{ .Site.BaseURL }}tags

Describe the solution you'd like
Build relative link using relLangURL function

error on installing the theme

Hello i tried to install the theme today but i got this error can you please tell me how i can fix that 1:27:46 PM: Error: Error building site: failed to render pages: render of "home" failed: "/opt/build/repo/themes/stack/layouts/rss.xml:37:90": execute of template failed: template: rss.xml:37:90: executing "rss.xml" at <$image.resource.Width>: nil pointer evaluating interface {}.Width

you can find my repo here : https://github.com/SamHamou/Animoo

Inconsistent style with taxonomy name

Describe the bug

Currently, tags at the end of the article are shown in uppercase using CSS property text-transform: uppercase;

image

However, this doesn't happen with tag clouds widget and article categories, which are shown in its raw format.


Another bug I observed is that taxonomies names like PHP will be transformed into P h p due to humanize function:

image


Also, force uppercase could make words like macOS looking strange.

Propose

  • Remove humanize function
  • Remove force uppercase style of tag cloud

ERROR: Failed to get JSON resource

After I following the instruction on the official documentation, I got some errors when building site.

Here's the error message:

# rem @ rem in ~/Blog/test [16:56:26] 
$ hugo                
Start building sites … 
ERROR 2020/10/22 16:57:00 Failed to get JSON resource "https://api.instagram.com/oembed/?url=https://www.instagram.com/p/BGvuInzyFAe/&amp;maxwidth=640&amp;omitscript=true": Get "https://api.instagram.com/oembed/?url=https://www.instagram.com/p/BGvuInzyFAe/&amp;maxwidth=640&amp;omitscript=true": dial tcp 104.31.143.88:443: i/o timeout
Total in 30140 ms
Error: Error building site: "/home/rem/Blog/test/content/post/rich-content/index.md:1:1": timed out initializing value. You may have a circular loop in a shortcode, or your site may have resources that take longer to build than the `timeout` limit in your Hugo config file.

I found that the test content in the exampleSite directory has some unsupported format, which will cause fatal error. I recommend to remove hugo-theme-stack/exampleSite/content/post/rich-content/ to avoid errors.

Featured image in about page

Is there a way to have a featured image on the about page? I've tried adding

image = "image.jpg"

in about.md and placing the image file in various places (in the page directory, in a new sub-directory of "page" called "about" with about.md, and in assets/img). It doesn't seem to work in my case:

about

I'm using Hugo extended version 0.79.0 on Windows 7.

Theme documentation

I recently migrated this theme's documentation from Notion.so to GitBook (#47). Documentation files are hosted in this repo: https://github.com/CaiJimmy/stack-docs

This is my first time using GitBook. I'm not sure if it fits, but at least now people can contribute to documentation.


Some documentation that I think is missing currently:

  • How to accelerate build by caching resources folder of Hugo
  • How to set external avatar (#53)

PRs are welcome.


If you have any suggestion, please leave it below 😀

Migrate to YAML

Something I've planning to do is replace config.toml with config.yaml. I think it's clearer and easier to write.

Using TOML (current)

baseurl = "https://example.com"
languageCode = "en-us"
theme = "hugo-theme-stack"
paginate = 5
title = "Example Site"
disqusShortname = "hugo-theme-stack"            # Change it to your Disqus shortname before using
DefaultContentLanguage = "en"                   # Theme i18n support

[permalinks]
    post = "/p/:slug/"
    page = "/:slug/"
    
[params]
    mainSections = ["post"]
    featuredImageField = "image"
    rssFullContent = true
    
    [params.dateFormat]
        published = "Jan 02, 2006"
        lastUpdated = "Jan 02, 2006 15:04 MST"
        
    [params.sidebar]
        emoji = "🍥"
        avatar = "img/avatar.png"
        subtitle = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
        
    [params.article]
        math = false
        [params.article.license]
            enabled = true 
            default = "Licensed under CC BY-NC-SA 4.0"
            
    [params.comments]
        enabled = true
        provider = "disqus"         # Available: disqus, utterances    
        [params.comments.utterances]
            repo = ""
            issueTerm = "pathname"
            label = ""             # Optional
            theme = "preferred-color-scheme"
            
    [params.widgets]
        enabled = ['search', 'archives', 'tag-cloud']
        [params.widgets.archives]
            limit = 5
            ### Archives page relative URL
            path = "archives"       
        [params.widgets.tagCloud]
            limit = 10
            
    [params.opengraph]
        [params.opengraph.twitter]
            site = ""
            card = "summary_large_image"
            
    [params.defaultImage]
        [params.defaultImage.opengraph]
            enabled = false
            local = false
            src = ""
            
[menu]
    [[menu.main]]
        identifier = "home"
        name = "Home"
        url = "/"
        weight = -100
        pre = "home"
    [[menu.main]]
        identifier = "about-cn"
        name = "About"
        url = "about"
        weight = -90
        pre = "user"
    [[menu.main]]
        identifier = "archives"
        name = "Archives"
        url = "archives"
        weight = -70
        pre = "archives"
    [[menu.main]]
        identifier = "search"
        name = "Search"
        url = "search"
        weight = -60
        pre = "search"

[related]
    includeNewer = true
    threshold = 60
    toLower = false

    [[related.indices]]
        name = "tags"
        weight = 100

    [[related.indices]]
        name = "categories"
        weight = 200

[markup]
    [markup.highlight]
        noClasses = false

Using YAML

baseurl: 'https://example.com'
languageCode: en-us
theme: hugo-theme-stack
paginate: 5
title: Example Site
disqusShortname: hugo-theme-stack
DefaultContentLanguage: en
permalinks:
    post: '/p/:slug/'
    page: '/:slug/'
params:
    mainSections:
        - post
    featuredImageField: image
    rssFullContent: true
    dateFormat:
        published: 'Jan 02, 2006'
        lastUpdated: 'Jan 02, 2006 15:04 MST'
    sidebar:
        emoji: "🍥"
        avatar: img/avatar.png
        subtitle: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'
    article:
        math: false
        license:
            enabled: true
            default: Licensed under CC BY-NC-SA 4.0
    comments:
        enabled: true
        provider: disqus
        utterances:
            repo: ''
            issueTerm: pathname
            label: ''
            theme: preferred-color-scheme
    widgets:
        enabled:
            - search
            - archives
            - tag-cloud
        archives:
            limit: 5
            path: archives
        tagCloud:
            limit: 10
    opengraph:
        twitter:
            site: ''
            card: summary_large_image
    defaultImage:
        opengraph:
            enabled: false
            local: false
            src: ''
menu:
    main:
        -
            identifier: home
            name: Home
            url: /
            weight: -100
            pre: home
        -
            identifier: about-cn
            name: About
            url: about
            weight: -90
            pre: user
        -
            identifier: archives
            name: Archives
            url: archives
            weight: -70
            pre: archives
        -
            identifier: search
            name: Search
            url: search
            weight: -60
            pre: search
related:
    includeNewer: true
    threshold: 60
    toLower: false
    indices:
        -
            name: tags
            weight: 100
        -
            name: categories
            weight: 200
markup:
    highlight:
        noClasses: false

The old config.toml will continue to work.


It's not decided yet. Opinions are welcome :)

Migrate documentation from Notion.so

Currently this theme's documentation is hosted on Notion.so. I feel that it should be moved to a GitHub repository, so it's easier to contribute to it.

I'm planning on using Gitbook.com as alternative.

没有归档和搜索页面

Hi,我执行hugo server命令预览时,没有归档页和搜索页,请问这个不是自动创建的吗?

Can avatar support external url?

I'd like to use https://avatars3.githubusercontent.com/u/xxx as my avatar so that it's the same as github's avatar. Is it possible? I know little about go and hugo.

左侧菜单栏在切换至“关于”页面时高亮失败

使用的版本是从 releases 页面下载的 v1.0.2 版本,在路由到 /about 页面时,左侧菜单栏中的 关于 并没有高亮。

name = "关于" 时不会高亮,只有 name = "About" 才会高亮。这个主题的菜单栏的高亮匹配机制是什么?难道匹配的不是 url 而是 name?我该怎么配置才能让左侧菜单栏在路由至相应页面时正确地高亮?

并且 /content/page/about.mdtitle在修改后,还会出现 404 page not found 的错误,无法正确访问 /about 页面。无法修改“关于”页面的 title,这也同样令我困惑。

# config.toml
# ...
[menu]
    [[menu.main]]
        identifier = "home"
        name = "Home"
        url = "/"
        weight = -100
        pre = "home"
    [[menu.main]]
        identifier = "about-cn"
        name = "关于"
        url = "/about/"
        weight = -90
        pre = "user"
    [[menu.main]]
        identifier = "archives"
        name = "Archives"
        url = "/archives/"
        weight = -70
        pre = "archives"
# ...

Staticman for comments

Is your feature request related to a problem? Please describe.
Instead of using Disqus, have you considered adding a web form which we can use for Staticman?

Describe the solution you'd like
I'm not quite sure how it will look, and it may be difficult due to the dynamic number of input fields a user can have: https://staticman.net/docs/getting-started.html

Describe alternatives you've considered
No alternatives, just staticman is the request.

Additional context

Unable to use my own avatar image

Describe the bug
I'm unable to specify my own avatar image.

If I place my own image in static/img/avatar.png, the place holder (grey circle with 150x150 written in the middle) is still there.

Source is

<img src="/img/avatar_huda2458f72ce188392d75c5d51cd8e24e_373_300x300_resize_box_2.png" width="300" height="300" class="site-logo" loading="lazy" alt="Avatar">

See this live on https://new.cookadam.co.uk. My config.toml is simply:

    [params.sidebar]
        emoji = "🙃"
        avatar = "img/avatar.png"

To Reproduce
Steps to reproduce the behavior:

  1. Store avatar.png (Which is different to default) in static/img/avatar.png
  2. Execute hugo server
  3. Observe previously described state.

Expected behavior
My own image to appear, not the default.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Edge (chromium)
  • Version [e.g. 22] Version 85.0.564.68 (Official build) (64-bit)

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Configuration for Dark Theme

Hey there,

I really love this theme. I'm only having one problem: I fail to see how to enable dark mode.
It is advertised in the README.md but I couldn't find anywhere where to enable the dark mode. Interestingly it seems to work in my Firefox because I had it enabled in the old theme, but if I open the same page on another Computer or e.g. in Chromium, then I get the light theme.

It would be super cool, if there is a way in the config.toml file to enable dark theme by default and then a button on the webpage to turn it on/off (e.g. as done in the diary theme). I'm thinking about something like enableAutoDarkMode in the config.toml file:

[params]
title = "Example toml config"
description = "This is my awesome blog"
enableAutoDarkMode = true

Anyways, I really love this theme and it would be super cool to also include this one.

Thanks 🙂

为带空格的英文分类添加封面

你好,

我尝试对不同类别添加封面,正如你的博客中这样

image

然而,当我的分类变成英文,且带有空格时

title: test
date: 2020-12-30
categories: ["Machine Learning"]

我应该怎么去操作呢?

现在的方法是在content/categories/目录下建立包含_index.md的文件夹,其文件目录及_index.md内容如下:

content/categories/
└── ml
    ├── cover.jpg
    └── _index.md

_index.md:
---
title: "Machine Learning"
description: "posts for machine learning"
slug: "ml"
image: "cover.jpg"
style:
    background: "#2a9d8f"
    color: "#fff"
---

然而此时,archive的category界面会有两个Machine Learning的分类,其中一个是自动生成的,另外一个是因为刚刚的操作生成的。我应该怎么样让他们合并为一个,并且成功添加上封面图片呢?

感谢!

better custom scss support

Is your feature request related to a problem? Please describe.
Custom SCSS support could be handled directly with a custom.scss file, like for the header/footer html partials. (Plain css can be added to the custom html already, of course.)

Describe the solution you'd like
Add the ability for a custom.scss file to automatically be used if it is available. While not a huge deal, makes it a little simpler to extend the theme.

Describe alternatives you've considered
Right now custom scss can be included via the header (or footer I suppose) custom html, e.g. I tried

{{ $sass := resources.Get "scss/custom.scss" }}
{{ $style := $sass | resources.ToCSS | minify }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">

to use the file assets/scss/custom.scss, which worked.

Additional context
Love the theme, thanks!

Add config to set external CDN URL

Currently, this theme uses JSDelivr for external libraries like PhotoSwipe or Vibrancy.js. All those URLs are hardcoded in HTML file or JS file in case of PhotoSwipe:

/**
* Load PhotoSwipe library dynamically
*/
function loadPhotoSwipe() {
const tasks = [
loadScript("https://cdn.jsdelivr.net/npm/[email protected]/dist/photoswipe.min.js"),
loadScript("https://cdn.jsdelivr.net/npm/[email protected]/dist/photoswipe-ui-default.min.js"),
loadStyle("https://cdn.jsdelivr.net/npm/[email protected]/dist/photoswipe.min.css"),
loadStyle("https://cdn.jsdelivr.net/npm/[email protected]/dist/default-skin/default-skin.min.css")
];
return Promise.all(tasks);
}

I think it's good to add a new field in config.yaml, something like:

params:
    external:
        photoswipe: 
            - JS File 1
            - JS File 2
            - CSS 1
            - CSS 2
        vibrancy: JS File 3

Because that Hugo does not have config file overwrite feature (?), those URLs will still be hardcoded, but by adding this new section of the configuration, users will be able to change them without modifying the source code.


For the case of PhotoSwipe, the library is loaded asynchronously using JavaScript. To pass the URL, I'm considering using this new feature introduced in Hugo v0.78.0:

image

https://gohugo.io/news/0.78.0-relnotes/

Dark Mode Toggle is changing position on short pages

Describe the bug
When the page has a total height smaller than vertical resolution the dark mode toggle is moving up on the screen instead of stay on the bottom of the page.

To Reproduce
Steps to reproduce the behavior:

  1. Access the site
  2. Go to the search page
  3. Dark Mode toggle will be right below the last sidebar item instead of the bottom like in all the other pages

Expected behavior
The toggle stay put on a consistent position 🤔

Screenshots
image
image
image
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Edge Chromium
  • Version: 89.0.744.0

Additional context
I really liked that toggle.

Multiple images on one page in same image presentation

Describe the bug
If you put multiple images on one page like on this page https://theme-stack.jimmycai.com/p/test-chinese/
But you put them on a new line they end up in another image presentation

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://theme-stack.jimmycai.com/p/test-chinese/'
  2. Click on 'an image'
  3. Press arrows to navigate
  4. You can only navigate to images that are put on the same line

Expected behavior
I would expect that you can navigate to all the images on the same page.
Or at least have an option to put the navigation on to all the images on the same page.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox and Chrome

Smartphone (please complete the following information):

  • Device: iPhone SE2020 and Samsung Galaxy S51

搜索结果无法跳转到文章

搜索页面下,鼠标放在搜索结果上只会出现图片的链接,而不能导航到文章,浏览器是最新版的Edge。

image

Bug: Extra thumbnails being generated with defaultImages

Describe the bug
Extra thumbnails being generated with defaultImages.

To Reproduce
Steps to reproduce the behavior:

  1. Set params.defaultImage.opengraph to:
enabled = true
local = true
src = "img/logo.png"
  1. Generate site

Expected behavior
No thumbnail should be generated, as Open Graph template takes directly the original image:

{{ $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink }}
{{- if $image.exists -}}
<meta property='og:image' content='{{ absURL $image.permalink }}' />
{{- end -}}

{{- $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink -}}
{{- if $image.exists -}}
<meta name="twitter:card" content="{{ .Site.Params.opengraph.twitter.card }}">
<meta name="twitter:image" content='{{ absURL $image.permalink }}' />
{{- end -}}

Screenshots
image
image

Support for sub-sub-folders

Is your feature request related to a problem? Please describe.
Describe the bug
The following is what I tried:

  1. Create a contents/notes/ folder, within which there is another folder content/notes/alpine
  2. All the contents of content/notes/alpine show up in example.com/notes/

Describe the solution you'd like
I would prefer if,

  1. I can create an _index.md in content/notes/alpine and add a title and description of that sub-subfolder
  2. example.com/notes show a list of cards for every subfolder within it.

Please let me know if that makes sense, and if that is aligned with your design goals for this project. If not, I can always use tags and categories.
Thanks for a beautiful theme. :)

Twitter rich content now showing properly on dark theme

Describe the bug
On dark theme, twitter content inserted from shortcode doesn't apply the theme correctly

To Reproduce
Steps to reproduce the behavior:

  1. Access the demo site with dark theme
  2. Access the Rich Content page
  3. Scroll to Twitter content

Expected behavior
Better visibility for the content

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Edge Chromium
  • Version: 89.0.744.0

SCSS Variables Doesn't Apply to The Pages

Describe the bug
Though having edited /themes/hugo-theme-stack/assets/scss/variables.scss, nothing changed in /public.

I've tried hugo --forceSyncStatic but only /resource changed and still nothing happend in public.

When running hugo --ignoreCache, it returned Error: Error building site: TOCSS: failed to transform "scss/style.scss" (text/x-scss): resource "scss/scss/style.scss_b95b077eb505d5c0aff8055eaced30ad" not found in file cache .

By the way, I have already tick the disable cache option in dev tools in Firefox and cleaned the whole browser cache for times.

To Reproduce
Steps to reproduce the behavior:

  1. Modify --body-text-color in /themes/hugo-theme-stack/assets/scss/variables.scss
  2. Run hugo at repo root

Expected behavior
The color of text should be changed.

Screenshots
1
2

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox
  • Version: 83

Unmarshal failed: Near line 0 (last key parsed ''): bare keys cannot contain ':'

Describe the bug

Error: "<directory>\config.toml:1:1": unmarshal failed: Near line 0 (last key parsed ''): bare keys cannot contain ':'

To Reproduce
Steps to reproduce the behavior:

  1. Hugo Quickstart
  2. Git clone the theme to theme
  3. hugo server -D

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Brave
  • Version: Hugo Static Site Generator v0.55.6-A5D4C82D windows/amd64 BuildDate: 2019-05-18T07:57:00Z

Add favicon in config.toml

There is currently no place in the config.toml of the hugo site to specify where to add a favicon file.

I have found a workaround to this (step-by-step):

  1. I made a static/ directory in the directory which contains the source files for the hugo site
  2. In the static/ directory I made another directory, in this case, I made it favicon/
  3. In favicon/ I added the favicon.png file.
  4. Then I went into themes/hugo-theme-stack/layouts/partials/head and modified head.html to include:
<link rel="icon" type="image/png" href="img/favicon.png">

I think there could be an easier way to add a favicon; you could perhaps make a toggle in the config.toml file to specify where the favicon should be and then when hugo builds the site it will take that location of the favicon file and automatically include that as the favicon for all the static .html pages.

Wrong redirection on search widget + missing i18n

Describe the bug
After changing the default path/slug of the search page, the search widget on the sidebar keep redirecting to the default "search" page.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the home page
  2. Search anything on the sidebar search widget
  3. Site will redirect to the 404 page
  4. Address bar will show the default page path

Expected behavior
Form action send the search to the current search page instead of default address.
Since it's the widget form error, the search page works just fine.
Aditionaly, the search partials have a i18n missing.
I KNOW I can change all of this manually, but I think it will be nice to have this kind of thing set with just parameterization

Screenshots

Search on widget
image

Wrong redirection
image

Same search directly on the search page
image

Desktop (please complete the following information):

  • OS: Any
  • Browser: Any, really.
  • Version: Any, yeah yeah

Additional context

My setup:

# config.yaml
menu:
  - identifier: busca
    name: Busca
    url: busca
    weight: -60
    pre: search
# content/page/busca.md
---
title: "Busca"
slug: "busca"
layout: "search"
outputs:
    - html
    - json
---

~stack/layouts/partials/widget/search.html

~stack/layouts/partials/widget/search.html

  • Line 1: The action="/search" is hardcoded.
  • Line 6: Missing i18n.

~stack/layouts/page/search.html

~stack/layouts/page/search.html

  • Line 14: Missing i18n.

Final Notes

Sorry for making everything as a issue instead of PR, at least the translations.
Thanks for the awesome theme and Happy New Year, Jimmy 🍾🎆

Error calling partial: partial "widget/archive" not found

您好,感谢分享的主题

我是初次使用hugo,在编译构建时遇到了找不到”widget/archive“的错误,怀疑时路径配置的问题,但一直没法解决,只好来这里开issue寻求帮助

报错如下

ERROR 2020/09/23 22:21:05 render of "taxonomy" failed: execute of template failed: template: _default/list.html:18:7: executing "right-sidebar" at <partialCached "sidebar/right.html" .>: error calling partialCached: "/Users/kagaya/Repos/kagaya85.github.io/themes/hugo-theme-stack/layouts/partials/sidebar/right.html:5:15": execute of template failed: template: partials/sidebar/right.html:5:15: executing "partials/sidebar/right.html" at <partial (printf "widget/%s" $widget) $context>: error calling partial: partial "widget/archive" not found

OS: macOS Catalina 10.15.6
Hugo: v0.75.1

部分配置文件如下

[params]
  mainSections = ["post"]
  featuredImageField = "image"
  [params.widgets]
    enabled = ['archive', 'tag-cloud']
    [params.widgets.archive]
      limit = 5
      ### Archive page relative URL
      path = "archive"       
    [params.widgets.tagCloud]
      limit = 10
  [params.opengraph]
    [params.opengraph.twitter]
      site = "kagaya_85"
      card = "summary_large_image"
  [params.defaultImage]
    [params.defaultImage.article]
      enabled = false
      local = false
      src = ""
    [params.defaultImage.articleList]
      enabled = false
      local = true
      src = ""
    [params.defaultImage.opengraph]
      enabled = false
      local = false
      src = ""

期待回复😃

如何添加favicon

现在添加到了asserts里的img下面和头像一起 但是不会打包到public

Categoris color different on posts and changes when opening a post

Describe the bug
The color of a category shows differently on different post and change upon clicking

To Reproduce
Steps to reproduce the behavior:
In main page

  1. Go to Demo website
  2. Multiple post in Test but they are in different colors

In archive

  1. Open post in Test
  2. Color of the category change for a brief moment

Expected behavior
Posts in the same category should show the same color for consistency

No changing color when opening a post

Screenshots
Screenshot on clicking on Safari macOS Catalina show change of change upon opening

bug.mov
bug_slow_down_20x.mp4

Desktop (please complete the following information):

  • OS: macOS
  • Browser chrome, safari
  • Version chrome Version 87.0.4280.88 (Official Build) (x86_64), safari: Version 14.0 (15610.1.28.1.9, 15610)

Smartphone (please complete the following information):

  • Device: iPhone XS Max
  • OS: iOS 14.0
  • Browser safari
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Fail to Build on Netlify

Describe the bug
Unable to build on netlify

To Reproduce
Hi, I simply created a hugo site using your theme as a submodule. I copied the Examplesite documents to the main folder, pushed to github ask Netlify to build it for me.

The error seems to come from one of your partial:
Error: "/opt/build/repo/themes/hugo-theme-stack/layouts/partials/article/components/details.html:8:1": parse failed: template: partials/article/components/details.html:8: illegal number syntax: "-"

Expected behavior
Having a site ready to go

Additional context
Log file from Netlify:
9:50:38 AM: ┌───────────────────────────────────┐
9:50:38 AM: │ 1. Build command from Netlify app │
9:50:38 AM: └───────────────────────────────────┘
9:50:38 AM: ​
9:50:38 AM: $ hugo
9:50:39 AM: Error: "/opt/build/repo/themes/hugo-theme-stack/layouts/partials/article/components/details.html:8:1": parse failed: template: partials/article/components/details.html:8: illegal number syntax: "-"
9:50:39 AM: ​
9:50:39 AM: ┌─────────────────────────────┐
9:50:39 AM: │ "build.command" failed │
9:50:39 AM: └─────────────────────────────┘

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.