mirror of
https://github.com/gohugoio/hugo.git
synced 2026-09-02 03:32:38 +00:00
Update amber and ace sections
This commit is contained in:
@@ -472,7 +472,7 @@ Let's assume you would like to have a shortcode to be replaced by the current ye
|
||||
```
|
||||
{{% /input %}}
|
||||
|
||||
More shortcode examples can be found in the [shortcodes directory for spf13.com][] and [shortcodes directory for the Hugo docs][].
|
||||
More shortcode examples can be found in the [shortcodes directory for spf13.com][] and the [shortcodes directory for the Hugo docs][].
|
||||
|
||||
[cross-references]: /content-management/cross-references/
|
||||
[Instagram]: https://www.instagram.com/
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Ace Templating
|
||||
linktitle:
|
||||
description:
|
||||
godocref: https://godoc.org/github.com/yosssi/ace
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
@@ -15,4 +16,50 @@ toc: false
|
||||
notes:
|
||||
---
|
||||
|
||||
> Without the fear of falling, there is no joy in flight. - [Ryan Watters](https://www.google.com)
|
||||
In addition to [Go templates][] and [Amber templates][], Hugo supports the powerful Ace templates.
|
||||
|
||||
For template documentation, follow the links from the [Ace project](https://github.com/yosssi/ace).
|
||||
|
||||
* Ace templates must be named with the ace-suffix; e.g., `list.ace`
|
||||
* It's possible to use both Go templates and Ace templates side by side and even include one into the other
|
||||
* Full Go template syntax support, including all the useful helper [template functions][]
|
||||
* Partials can be included both with the Ace and the Go template syntax. For example, the following two will have the same output in Ace:
|
||||
* `= include partials/foo.html .`
|
||||
* `{{ partial "foo" . }}`
|
||||
|
||||
One noticeable difference between Ace and the other templating engines in Hugo is [Ace's inheritance support through base and inner templates][].
|
||||
|
||||
In Hugo, the Ace base template will be chosen with the same rule set as for [Go base templates][].
|
||||
|
||||
```
|
||||
.:
|
||||
index.ace
|
||||
|
||||
./blog:
|
||||
single.ace
|
||||
baseof.ace
|
||||
|
||||
./_default:
|
||||
baseof.ace list.ace single.ace single-baseof.ace
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
Note that the `html` suffix is needed, even if the filename is suffixed `ace`. This does not work from inside a theme ([issue #763](https://github.com/spf13/hugo/issues/763)).
|
||||
{{% /note %}}
|
||||
|
||||
Some examples for the layout files above:
|
||||
|
||||
* Home page: `./index.ace` + `./_default/baseof.ace`
|
||||
* Single page in the `blog` section: `./blog/single.ace` + `./blog/baseof.ace`
|
||||
* Single page in another section: `./_default/single.ace` + `./_default/single-baseof.ace`
|
||||
* Taxonomy page in any section: `./_default/list.ace` + `./_default/baseof.ace`
|
||||
|
||||
{{% note %}}
|
||||
In most cases, one `baseof.ace` in `_default` will suffice. An Ace template without a reference to a base section (e.g., `= content`) will be handled as a standalone template.
|
||||
{{% /note %}}
|
||||
|
||||
[Ace's inheritance support through base and inner templates]: https://github.com/yosssi/ace/tree/master/examples/base_inner_template
|
||||
[Amber templates]: /templates/amber-templating/
|
||||
[template functions]: /functions/
|
||||
[Go templates]: /templates/go-template-primer/
|
||||
[Go base templates]: /templates/base-templates-and-blocks/
|
||||
@@ -9,8 +9,22 @@ weight:
|
||||
tags: [amber,layout]
|
||||
categories: [templates]
|
||||
draft: false
|
||||
slug:
|
||||
slug: [/templates/amber/]
|
||||
aliases:
|
||||
toc: false
|
||||
notes:
|
||||
---
|
||||
---
|
||||
|
||||
Amber templates are another template type which Hugo supports, in addition to [Go templates][] and [Ace templates][] templates.
|
||||
|
||||
For template documentation, follow the links from the [Amber project][].
|
||||
|
||||
* Amber templates must be named with the amber-suffix, e.g. `list.amber`
|
||||
* Partials in Amber or HTML can be included with the Amber template syntax:
|
||||
* `import ../partials/test.html `
|
||||
* `import ../partials/test_a.amber `
|
||||
|
||||
[Ace templates]: /templates/ace-templating/
|
||||
[Amber project]: https://github.com/eknkc/amber
|
||||
[Go templates]: /templates/go-template-primer/
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Base Templates and Blocks
|
||||
linktitle:
|
||||
description:
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
@@ -10,7 +11,7 @@ tags: [blocks,base]
|
||||
categories: [templates]
|
||||
draft: false
|
||||
slug:
|
||||
aliases:
|
||||
aliases: [/templates/blocks/]
|
||||
toc: false
|
||||
notes:
|
||||
---
|
||||
|
||||
@@ -10,7 +10,7 @@ tags: []
|
||||
categories: [templates]
|
||||
draft: false
|
||||
slug:
|
||||
aliases:
|
||||
aliases: [/templates/go-templates/]
|
||||
toc: false
|
||||
notes:
|
||||
---
|
||||
@@ -32,7 +32,7 @@ templates:
|
||||
url: "templates"
|
||||
haschildren: true
|
||||
sortsubpagesby: "weight"
|
||||
desc: "Pagination, homepage, rss/sitemap, template types and lookup order, and data"
|
||||
desc: "Pagination, homepage, rss, sitemap, lookup order, and data templates"
|
||||
functions:
|
||||
order: 6
|
||||
title: "Functions"
|
||||
@@ -60,7 +60,7 @@ hostinganddeployment:
|
||||
url: "hosting-and-deployment"
|
||||
haschildren: true
|
||||
sortsubpagesby: "weight"
|
||||
desc: "Site builds and community-aggregated tutorials on automated deploymentsand popular hosting solutions"
|
||||
desc: "Site builds, automated deployments, and popular hosting solutions, as explained by the Hugo community"
|
||||
# migratingtohugo:
|
||||
# order: 10
|
||||
# title: "Migrating to Hugo"
|
||||
@@ -74,7 +74,7 @@ tutorials:
|
||||
url: "tutorials"
|
||||
haschildren: true
|
||||
sortsubpagesby: "weight"
|
||||
desc: "Community-aggregated articles on methods to approaching different projects using Hugo"
|
||||
desc: "Community-aggregated articles and code examples for approaching different projects using Hugo"
|
||||
developertools:
|
||||
order: 12
|
||||
title: "Developer Tools"
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
<div class="content-header-links">
|
||||
{{- if .Params.godocref -}}
|
||||
<a target="_blank" class="tooltip godoc-link" data-tooltip="Golang Ref" href="{{.Params.godocref}}" >
|
||||
<a target="_blank" class="tooltip right godoc-link" data-tooltip="See the related Godocs for {{.Title}}" href="{{.Params.godocref}}" >
|
||||
{{ partial "svg-icons/godoc-icon.html" .}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
@@ -53,8 +53,8 @@ a.tooltip {
|
||||
}
|
||||
&.right {
|
||||
&:hover::before {
|
||||
left: 0px;
|
||||
right: auto;
|
||||
right: 0px;
|
||||
left: auto;
|
||||
}
|
||||
}
|
||||
&.edit-link:hover {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.breadcrumbs {
|
||||
list-style: none;
|
||||
display: inline-block;
|
||||
margin-top:3px;
|
||||
margin-top: 3px;
|
||||
li {
|
||||
float: left;
|
||||
a {
|
||||
@@ -22,11 +22,11 @@
|
||||
// filter:grayscale(100%);
|
||||
}
|
||||
span {
|
||||
margin-left:4px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
}
|
||||
&:nth-child(even) {
|
||||
margin-left:-8px;
|
||||
margin-left: -8px;
|
||||
a {
|
||||
background-color: $breadcrumb-navigation-bg-color;
|
||||
&:before {
|
||||
@@ -49,7 +49,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
&:last-child {
|
||||
&:last-child::not(first-child) {
|
||||
a {
|
||||
padding-right: 15px;
|
||||
@include border-radius(0 4px 4px 0);
|
||||
@@ -80,9 +80,9 @@
|
||||
}
|
||||
&:hover {
|
||||
background-color: $breadcrumb-navigation-bg-color-active;
|
||||
color:$breadcrumb-navigation-text-color-active;
|
||||
color: $breadcrumb-navigation-text-color-active;
|
||||
img {
|
||||
filter:grayscale(0%);
|
||||
filter: grayscale(0%);
|
||||
}
|
||||
&:before {
|
||||
border-color: $breadcrumb-navigation-bg-color-active;
|
||||
@@ -94,4 +94,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user