Coder Social home page Coder Social logo

Comments (6)

AmazingRise avatar AmazingRise commented on June 7, 2024

Thanks for your issue. The COVID-19 really influenced a lot. I'm very honored that my theme would help you to help those people. :)
Let's back to our main topic.

First, let's introduce some terms:

  1. recipies is a section of Hugo blog.
  2. categories and ingredients are taxonomies of a blog.

So this feature request can be described as: to implement a taxonomy under each section.
(The original behaviour of taxonomy page is to show all the things, whichever the section they belong to.)

Furst, I found a solution to do this on Hugo forum (see madipse's reply). And this solution needs some modifications to single.html. An annoying point is: if you have some other contents before, they needs to be modified, too.

I think there is a better practice.

GitHub pages enables you to set up a site under every project repositories. (if you have a repo named recipes, and add a branch gh-pages. Then upload some webpages, you will get a sub-site: https://your-github-name.github.io/recipes)

You can establish a seperate site for these recipes. In this way, you need to:

  • Set up a sub-site.(For details, you can see this link.)
  • Rename the default "contents/posts" folder to "contents/recipes"
  • Add two taxonomies in config.toml: categories and ingredients.
  • To classify these contents, you can declare in the frontmatter of each post, for example:
---
title: "An example recipe"
date: 2018-03-18T12:13:32+05:30
description: "This is an example recipe."
ingredients: ["tomato","potato","cheese"]
categories: "simple foods"
---

This solution may also need some small modifications to single.html.(To replace tags with ingredients) It's easier to do, comparing with the first solution.
If you'd like this solution, tell me and i will open a branch to do these small modifications.

Welcome other ideas on this. I'm very glad to help.

from hugo-theme-diary.

bmaeser avatar bmaeser commented on June 7, 2024

hi, thanks for the fast reply.

it wouldnt even have to be that complex. menu is generated via [[menu.main]] entries in config.toml. hugo has support for nesting menues, but the theme does not render it, or has css/js to style it.

just to clarify: i understand the internals of hugo and know how to use them. i am a backend/devops-dude. i just suck hard at frontend work because i never work on js/css.

all i care about is proper rendering, especially on mobile devices because i expect people to bring them into the kitchen - not the laptop ;-)

that would be more than enough
thx

from hugo-theme-diary.

AmazingRise avatar AmazingRise commented on June 7, 2024

hugo has support for nesting menues, but the theme does not render it, or has css/js to style it.

If you are meaning to render something like this,

[[menu.main]]
url = "/recipes/categories"
parent = "recipes"
name = "Categories"
weight = 2

...and there is only submenu not working in this theme:
I've added support for rendering submenu in the lastest commit.
Also adapted for mobile view.
Now, the menu with children items is expandable on sidebar. When click on it, the list will expand, you will see items in it.

And please reply to me if any further things needs to be added. (It's the first time for me to use this feature, not familiar to me.)
Thanks. :)

from hugo-theme-diary.

AmazingRise avatar AmazingRise commented on June 7, 2024

Hi bmaeser,
Could you give me some feedback on this function since this commit?
I think this function is ready to use.
If no further modifications needed, i'll close this issue. :)
Thanks.

from hugo-theme-diary.

AmazingRise avatar AmazingRise commented on June 7, 2024

你好,Rise!感谢你提供的 Hugo 主题,很喜欢它的简约、实用以及中英文显示都很不错,主题配置也很方便。在使用的过程中,没有找到关于站内搜索功能的。如果可以的话,期望在以后的版本中能增加这一功能。最后,再一次谢谢 Rise 分享!

关于站内搜索:#16

感谢你的支持,但是请不要在其他人的 issue 下面发表无关内容。如果有新的功能或建议,请另发 issue,并且建议在提出问题之前翻阅 wiki 和 issues。谢谢合作。

Please do not post unrelated questions under other issues. Thanks for cooperation.

from hugo-theme-diary.

bmaeser avatar bmaeser commented on June 7, 2024

i am so very sorry, i had to abandon the project for lack of time and forgot about it.

it seams to work just fine, thank you very much for this.
sorry for the late feedback.

from hugo-theme-diary.

Related Issues (20)

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.