mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-25 15:58:53 +00:00
@@ -126,7 +126,7 @@ git commit -a -m "Initial commit"
|
||||
|
||||
## Adding the Project to GitHub
|
||||
|
||||
Now we need to create a new repository on GitHub. Once you are signed in to GitHub, you can add a new repository by clicking on the **+▼** dropdown at the top right or by going to `https://github.com/new`.
|
||||
Now we need to create a new repository on GitHub. Once you are signed in to GitHub, you can add a new repository by clicking on the **+▼** dropdown at the top right or by going to [https://github.com/new](https://github.com)..
|
||||
|
||||
We then choose a name for the project (`hugo-wercker-example`). When clicking on create repository GitHub displays the commands for adding an existing project to the site. The commands shown below are the ones used for this site, if you're following along you will need to use the ones shown by GitHub. Once we've run those commands the project is in GitHub and we can move on to setting up the Wercker configuration. Be sure to replace `YourUserName` with your GitHub account/username:
|
||||
|
||||
|
||||
@@ -174,12 +174,14 @@ your list templates:
|
||||
### By Link Title
|
||||
|
||||
{{% code file="layouts/partials/by-link-title.html" %}}
|
||||
```html
|
||||
{{ range .Data.Pages.ByLinkTitle }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||
<div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
### By Parameter
|
||||
@@ -394,7 +396,7 @@ Sometimes you only want to list a subset of the available content. A common requ
|
||||
2. `number of elements`
|
||||
|
||||
{{% code file="layout/_default/section.html" %}}
|
||||
```golang
|
||||
```html
|
||||
{{ range first 10 .Data.Pages }}
|
||||
{{ .Render "summary" }}
|
||||
{{ end }}
|
||||
@@ -406,7 +408,7 @@ Sometimes you only want to list a subset of the available content. A common requ
|
||||
Using `first` and `where` together can be very powerful:
|
||||
|
||||
{{% code file="first-and-where-together.html" %}}
|
||||
```golang
|
||||
```html
|
||||
{{ range first 5 (where .Data.Pages "Section" "post") }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user