Git Product home page Git Product logo

Comments (5)

yihui avatar yihui commented on July 28, 2024 2

menu中指定的url: "/en/about/"实则指向的是content文件夹中的en-about.md文件

因为我自定义链接了:https://github.com/yihui/yihui.org/blob/master/content/en-about.md?plain=1#L3

请问如何指向某文件夹下的子文件夹呢?

我不太明白这个问题。子文件夹的链接是什么,这里就填什么。

若有后续问题,我建议你去论坛提问,如 https://d.cosx.org 或 Hugo 论坛 https://discourse.gohugo.io。我个人实在精力有限,无法当私人顾问。请谅解。

from hugo-ivy.

yihui avatar yihui commented on July 28, 2024 1

.IsHome 变量控制:https://github.com/yihui/hugo-ivy/blob/master/layouts/_default/list.html 时间精力所限,只能帮你到这儿了。

from hugo-ivy.

4fee8fea avatar 4fee8fea commented on July 28, 2024

谢谢!

https://bookdown.org/yihui/blogdown/templates.html#a-minimal-example

blogdown文档中记载了.IsHome的用法,或许查阅blogdown文档是我可以继续做下去的

from hugo-ivy.

4fee8fea avatar 4fee8fea commented on July 28, 2024

image
image

yihui大大,我观察到如下现象:

如图,menu中指定的url: "/en/about/"实则指向的是content文件夹中的en-about.md文件

请问如何指向某文件夹下的子文件夹呢?
(即:content文件夹下有名为subdir的子文件夹,如何在url中以形如"subdir"的方式指定呢)


另外我发现当指定某文件夹,意在显示其中的全部内容而不指定_index.md时,title位置会以s结尾...

from hugo-ivy.

chuxinyuan avatar chuxinyuan commented on July 28, 2024

修改 themes/hugo-ivy/layouts/_default/ 路径下的 list.html 文件,代码如下:

{{ partial "header.html" . }}

{{ .Content }}

{{ if not .IsHome }}
<ul>
  {{ range (where .Pages "Section" "!=" "") }}
  <li>
    <span class="date">{{ .Date.Format "2006/01/02" }}</span>
    <a href="{{ .RelPermalink }}">{{ .Title }}</a>
  </li>
  {{ end }}
</ul>
{{ end }}

{{ partial "footer.html" . }}

from hugo-ivy.

Related Issues (9)

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.