我的结构在content:
content
|-post
| |-00.md
| |-01.md
| |-02.md
|-about.md
Run Code Online (Sandbox Code Playgroud)
在帖子的单个模板中,我希望有一个页脚:
在伪模板代码中,这意味着:
{{ if nextpost.exists }} #. becomes nexpost here
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ end }}
Run Code Online (Sandbox Code Playgroud)
nextpostcurrentpost + 1 在哪里
如何创建这种链接?
当我使用{% load static %}然后将这样的图像添加到模板中时:
<img src="{% static 'logo.png' %}">
Run Code Online (Sandbox Code Playgroud)
仅当图像存储在static同一应用程序中的方向上时,我才会获得图像。但是我要在整个项目中使用徽标,并且也要在整个项目的模板中使用徽标。当图像static以内部项目文件夹中的方向存储时,该功能不起作用。
如何在整个项目中使用静态文件?以及如何从模板访问它们?(我是一个业余开发人员,所以不在生产中;-)我的设置几乎与创建项目时的设置相同。(我只添加了一些其他的模板方向。)
谢谢您阅读此篇
如何防止页脚行与内容行重叠?
这就是我得到的:
body {
display: grid;
grid-template-rows: 3.7rem auto auto;
grid-template-columns: 3rem 3fr 2fr;
}
*[role="banner"] {
grid-row: 1;
grid-column: 2/4;
background-color: green;
height: 3rem;
}
*[role="main"] {
grid-row: 2;
grid-column: 2;
background-color: yellow;
height: 100px;
}
*[role="contentinfo"] {
grid-row: 3;
grid-column: 2/3;
border-top: 1px solid black;
}
*[role="contentinfo"] img {
height: 100px;
}Run Code Online (Sandbox Code Playgroud)
<div role="banner"></div>
<article role="main"><p>Some Text.</p><p>Some more text</p><p>the last text</p></article>
<footer role="contentinfo"><img src="https://s14-eu5.ixquick.com/cgi-bin/serveimage?url=https%3A%2F%2Fdata.motor-talk.de%2Fdata%2Fgalleries%2F0%2F147%2F9424%2F43109894%2Fbild--7008737403287221413.jpg&sp=6a4eaf3bd8ff58ca9d9bba2e3519888e"></footer>Run Code Online (Sandbox Code Playgroud)
我有一个布尔值列表。我想对||它们中的每一个应用(“或”),并得到结果。(所以,一个新的布尔值。)
列表没有固定长度,所以我不能简单地将代码写成value = l[0] || ... l[length-1]. (对于长列表,这也很丑陋。)
我的做法:
let index = 0;
let value = true;
while(index < list.length && value == value || list[index]) {
index += 1;
}
Run Code Online (Sandbox Code Playgroud)
我想这是可能的一种说法。如何?
有没有之间的差异new Class[]{}和new Class[0]?如果是,有什么不同?