【发布时间】:2016-05-17 09:48:12
【问题描述】:
我想在开发者模式下为 Native 模板修改现有的 blog.item 模板。我想知道这是否可能,因为当我修改文件并上传回服务器时,没有识别出任何更改,正如我在 Chrome 开发人员工具中看到的那样。例如,我在 div 中添加了一个类,保存并上传,我的 FTP 管理器显示成功,但是当我在开发人员工具中检查时,该类不存在。我已经注销(FTP)并重新登录。我知道 FTP 工作正常,因为tweak.less 文件工作正常。
另外,我要特别编辑的是文章元数据。为每个帖子显示的作者、日期、喜欢。我的意思是一般来说,因为我认为这与 squarespace 系统变量有关,这可能就是为什么我似乎无法编辑它?
编辑************ 这是 blog.item 文件中的代码
<header>
{.if title}<h1 class="entry-title" data-content-field="title" itemprop="headline">{.passthrough?}<a href="{sourceUrl}">{title} <span>→</span></a>{.or}<a href="{fullUrl}">{title}</a>{.end}</h1>{.end}
<div class="article-meta-top">
{.section location}<div class="location">{.if addressTitle}<a href="//maps.google.com/maps?q={mapLat},{mapLng}" target="_blank" title="View map in new window"><i class="icon-map-marker"></i>{addressTitle}</a>{.end}</div>{.end}
<span class="date"><a href="{fullUrl}"><time class="published" datetime="{addedOn|date %F}" itemprop="datePublished">{addedOn|date %B %d, %Y}</time></a></span>
{.section author}<span class="author"><a href="{collection.fullUrl}?author={id}" rel="author">by {displayName}</a></span>{.end}
{.section categories}<span class="categories">in {.repeated section @}<a href="{collection.fullUrl}?category={@|url-encode}" rel="tag">{@}</a>{.alternates with}, {.end}</span>{.end}
然后我简单地想移动是在帖子页脚那里发布页眉,所以我拿了帖子页脚代码并将它移到那里。
<header>
{.if title}<h1 class="entry-title" data-content-field="title" itemprop="headline">{.passthrough?}<a href="{sourceUrl}">{title} <span>→</span></a>{.or}<a href="{fullUrl}">{title}</a>{.end}</h1>{.end}
<div class="article-meta">
<span class="date"><a href="{fullUrl}"><i class="icon-calendar"></i><time class="published" datetime="{addedOn|date %F}" itemprop="datePublished">{addedOn|date %B %d, %Y}</time></a></span>
{.section author}<span class="author"><span class="delimiter">/</span><a href="{collection.fullUrl}?author={id}" rel="author"><i class="icon-user"></i>{displayName}</a></span>{.end}
{.passthrough?}{.or}{.section sourceUrl}<span class="source"><span class="delimiter">/</span><a href="{sourceUrl}" target="_blank"><i class="icon-share"></i>Source</a></span>{.end}{.end}
{.section tags}<div class="tags"><i class="icon-tag"></i>{.repeated section @}<a href="{collection.fullUrl}?tag={@|url-encode}" rel="tag">{@}</a>{.alternates with}, {.end}</div>{.end}
{.section categories}<div class="categories"><i class="icon-bookmark"></i>{.repeated section @}<a href="{collection.fullUrl}?category={@|url-encode}" rel="tag">{@}</a>{.alternates with}, {.end}</div>{.end}
<div class="shareLoveButtons">
{@|like-button}
{@|social-button-inline}
{postItemInjectCode}
</div>
</div>
我意识到这可能是特定于社区问题的,所以我不是在问如何使这项工作本身,只要它应该工作。如果不是,为什么?我在哪里可以找到这方面的文档?我查看了所有开发人员文档,但没有看到它在哪里谈论这个问题。有没有我遗漏的注释或代码注入?
【问题讨论】:
标签: collections blogs squarespace