Closed wu0407 closed 3 years ago
Is it shit particular block you're talking about?
{{- range $paginator.Pages -}}
{{ .Render "summary" }}
{{ end -}}
</section>
I moved it back here to have a look at it, but I don't think this is a bug (it has a million tests).
So, every Page
in the loop above will get its own "what summary template do I get" evaluation. What I think you're seeing is that $paginator.Pages
returns pages not only from the posts
section.
Yes, I want to override the theme of summary template, so all section to use /layouts/_default/summary.html
.
You mean the evaluation search summary template order is expected.
You mean the evaluation search summary template order is expected.
You have a summary overridden for a given section (post) -- but then you have content living in 2 sections, for the latter I would expect the "default summary" template would be used.
I suggest that you only query the regular pages inside posts
(which I suspect is what you want).
yes , other section of page use default summary, only the post section use themes summary. so add layout/post/summary.html it works.
full tree
+---archetypes
| default.md
|
+---content
| +---kubernetes
| | node-lifecycle-controller-manager.md
| |
| +---osd
| | osd-new.md
| |
| \---post
| new.md
| new1.md
|
+---data
+---docs
| | 404.html
| | android-chrome-192x192.png
| | android-chrome-512x512.png
| | apple-touch-icon.png
| | browserconfig.xml
| | favicon-16x16.png
| | favicon-32x32.png
| | favicon.ico
| | index.html
| | index.xml
| | manifest.json
| | mstile-150x150.png
| | robots.txt
| | safari-pinned-tab.svg
| | sitemap.xml
| | sitemap.xsl
| |
| +---categories
| | index.html
| | index.xml
| |
| +---fonts
| | +---chancery
| | | apple-chancery-webfont.eot
| | | apple-chancery-webfont.svg
| | | apple-chancery-webfont.ttf
| | | apple-chancery-webfont.woff
| | | apple-chancery-webfont.woff2
| | |
| | \---iconfont
| | iconfont.eot
| | iconfont.svg
| | iconfont.ttf
| | iconfont.woff
| |
| +---img
| | | spinner.svg
| | |
| | \---reward
| | alipay.png
| | wechat.png
| |
| +---js
| | main.min.c12618f9a600c40bd024996677e951e64d3487006775aeb22e200c990006c5c7.js
| |
| +---lib
| | +---fancybox
| | | jquery.fancybox-3.1.20.min.css
| | | jquery.fancybox-3.1.20.min.js
| | |
| | +---flowchartDiagrams
| | | flowchart-1.8.0.min.js
| | | raphael-2.2.7.min.js
| | |
| | +---highlight
| | | highlight.pack.js
| | |
| | +---jquery
| | | jquery-3.2.1.min.js
| | |
| | +---js-sequence-diagrams
| | | danielbd.woff2
| | | sequence-diagram-2.0.1.min.css
| | | sequence-diagram-2.0.1.min.js
| | | snap.svg-0.5.1.min.js
| | | underscore-1.8.3.min.js
| | | webfontloader-1.6.28.js
| | |
| | +---slideout
| | | slideout-1.0.1.min.js
| | |
| | \---timeago
| | timeago-3.0.2.min.js
| | timeago.locales-3.0.2.min.js
| |
| +---page
| | \---1
| | index.html
| |
| +---sass
| | main.min.c7bc1becf36bcf6a9ebd25d2947e43a2eb745ddb0c9a32b43126fd7fa460c351.css
| |
| \---tags
| index.html
| index.xml
|
+---layouts
| | index.html
| |
| +---post
| | summary.html
| |
| \---_default
| summary.html
|
+---resources
| \---_gen
| +---assets
| | \---scss
| | \---sass
| | main.scss_48b060fe05b0a273d182ef83c0605941.content
| | main.scss_48b060fe05b0a273d182ef83c0605941.json
| |
| \---images
+---static
\---themes
\---even
| .gitignore
| CHANGELOG.md
| LICENSE.md
| Makefile
| netlify.toml
| README-zh.md
| README.md
| theme.toml
|
+---archetypes
| default.md
|
+---assets
| +---js
| | even.js
| | main.js
| |
| \---sass
| | main.scss
| | _base.scss
| | _iconfont.scss
| | _variables.scss
| |
| +---_common
| | _animation.scss
| | _normalize.scss
| | _utils.scss
| |
| +---_custom
| | _custom.scss
| |
| \---_partial
| | _404.scss
| | _archive.scss
| | _back-to-top.scss
| | _footer.scss
| | _header.scss
| | _mobile.scss
| | _pagination.scss
| | _post.scss
| | _slideout.scss
| | _terms.scss
| |
| +---_footer
| | _copyright.scss
| | _social.scss
| |
| +---_header
| | _logo.scss
| | _menu.scss
| |
| \---_post
| _admonition.scss
| _code.scss
| _content.scss
| _copyright.scss
| _footer.scss
| _header.scss
| _outdated.scss
| _reward.scss
| _toc.scss
|
+---exampleSite
| | config.toml
| |
| \---content
| | about.md
| |
| \---post
| chinese-preview.md
| english-preview.md
| even-preview.md
| hidden-post.md
| japanese-preview.md
| js-flowchart-diagrams.md
| js-sequence-diagrams.md
| shortcodes.md
| syntax-highlighting.md
|
+---i18n
| de.yaml
| en.yaml
| es.yaml
| fr.yaml
| ja.yaml
| ru.yaml
| zh-CN.yaml
| zh-TW.yaml
|
+---images
| screenshot.png
| showcase.png
| tn.png
|
+---layouts
| | 404.html
| | index.html
| | robots.txt
| | sitemap.xml
| |
| +---partials
| | | comments.html
| | | footer.html
| | | head.html
| | | header.html
| | | scripts.html
| | | slideout.html
| | |
| | \---post
| | copyright.html
| | outdated-info-warning.html
| | reward.html
| | toc.html
| |
| +---post
| | single.html
| | summary.html
| |
| +---shortcodes
| | admonition.html
| | bilibili.html
| | center.html
| | left.html
| | music.html
| | right.html
| |
| \---_default
| baseof.html
| section.html
| single.html
| single.md
| taxonomy.html
| terms.html
|
+---resources
| \---_gen
| \---assets
| \---scss
| \---sass
| main.scss_48b060fe05b0a273d182ef83c0605941.content
| main.scss_48b060fe05b0a273d182ef83c0605941.json
|
\---static
| android-chrome-192x192.png
| android-chrome-512x512.png
| apple-touch-icon.png
| browserconfig.xml
| favicon-16x16.png
| favicon-32x32.png
| favicon.ico
| manifest.json
| mstile-150x150.png
| safari-pinned-tab.svg
| sitemap.xsl
|
+---fonts
| +---chancery
| | apple-chancery-webfont.eot
| | apple-chancery-webfont.svg
| | apple-chancery-webfont.ttf
| | apple-chancery-webfont.woff
| | apple-chancery-webfont.woff2
| |
| \---iconfont
| iconfont.eot
| iconfont.svg
| iconfont.ttf
| iconfont.woff
|
+---img
| | spinner.svg
| |
| \---reward
| alipay.png
| wechat.png
|
\---lib
+---fancybox
| jquery.fancybox-3.1.20.min.css
| jquery.fancybox-3.1.20.min.js
|
+---flowchartDiagrams
| flowchart-1.8.0.min.js
| raphael-2.2.7.min.js
|
+---highlight
| highlight.pack.js
|
+---jquery
| jquery-3.2.1.min.js
|
+---js-sequence-diagrams
| danielbd.woff2
| sequence-diagram-2.0.1.min.css
| sequence-diagram-2.0.1.min.js
| snap.svg-0.5.1.min.js
| underscore-1.8.3.min.js
| webfontloader-1.6.28.js
|
+---slideout
| slideout-1.0.1.min.js
|
\---timeago
timeago-3.0.2.min.js
timeago.locales-3.0.2.min.js
Closing. Behavior is expected and documented.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
yes
My project dir tree:
The home page
layouts/index.html
file use{{ .Render "summary" }}
that it will using the content view located at/layouts/_default/summary.html
, but in fact it usethemes/even/layouts/post/summary.html
when render post/one.md .The docs for template lookup order: https://gohugo.io/templates/views/#which-template-will-be-rendered https://gohugo.io/functions/render/
I find lookup order:
layouts/index.html: