mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-18 20:54:38 -04:00
Add js icon to code blocks and fix prev/next icons in content footer
This commit is contained in:
parent
fb25d25558
commit
a5a7e87346
33
content/functions/union.md
Normal file
33
content/functions/union.md
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
title: union
|
||||
linktitle: union
|
||||
description: Given two arrays or slices, returns a new array that contains the elements or objects that belong to either or both arrays/slices.
|
||||
godocref:
|
||||
date: 2017-03-12
|
||||
publishdate: 2017-03-12
|
||||
lastmod: 2017-03-12
|
||||
categories: [functions]
|
||||
tags: [filtering,lists]
|
||||
signature:
|
||||
workson: []
|
||||
hugoversion: 0.20
|
||||
relatedfuncs: [intersect,where]
|
||||
deprecated: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
Given two arrays (or slices) A and B, this function will return a new array that contains the elements or objects that belong to either A or to B or to both. The elements supported are strings, integers, and floats (only float64).
|
||||
|
||||
```golang
|
||||
{{ union (slice 1 2 3) (slice 3 4 5) }}
|
||||
<!-- returns [1 2 3 4 5] -->
|
||||
|
||||
{{ union (slice 1 2 3) nil }}
|
||||
<!-- returns [1 2 3] -->
|
||||
|
||||
{{ union nil (slice 1 2 3) }}
|
||||
<!-- returns [1 2 3] -->
|
||||
|
||||
{{ union nil nil }}
|
||||
<!-- returns an error because both arrays/slices have to be of the same type -->
|
||||
```
|
@ -49,19 +49,36 @@ It can also be used with the logical operators `!=`, `>=`, `in`, etc. Without an
|
||||
|
||||
The following logical operators are vailable with `where`:
|
||||
|
||||
* `=`, `==`, `eq`: True if a given field value equals a matching value
|
||||
* `!=`, `<>`, `ne`: True if a given field value doesn't equal a matching value
|
||||
* `>=`, `ge`: True if a given field value is greater than or equal to a matching value
|
||||
* `>`, `gt`: True if a given field value is greater than a matching value
|
||||
* `<=`, `le`: True if a given field value is lesser than or equal to a matching value
|
||||
* `<`, `lt`: True if a given field value is lesser than a matching value
|
||||
* `in`: True if a given field value is included in a matching value. A matching value must be an array or a slice
|
||||
* `not in`: True if a given field value isn't included in a matching value. A matching value must be an array or a slice
|
||||
* `intersect`: True if a given field value that is a slice / array of strings or integers contains elements in common with the matching value. It follows the same rules as the intersect function.
|
||||
`=`, `==`, `eq`
|
||||
: `true` if a given field value equals a matching value
|
||||
|
||||
`!=`, `<>`, `ne`
|
||||
: `true` if a given field value doesn't equal a matching value
|
||||
|
||||
`>=`, `ge`
|
||||
: `true` if a given field value is greater than or equal to a matching value
|
||||
|
||||
`>`, `gt`
|
||||
: `true` if a given field value is greater than a matching value
|
||||
|
||||
`<=`, `le`
|
||||
: `true` if a given field value is lesser than or equal to a matching value
|
||||
|
||||
`<`, `lt`
|
||||
: `true` if a given field value is lesser than a matching value
|
||||
|
||||
`in`
|
||||
: `true` if a given field value is included in a matching value; a matching value must be an array or a slice
|
||||
|
||||
`not in`
|
||||
: `true` if a given field value isn't included in a matching value; a matching value must be an array or a slice
|
||||
|
||||
`intersect`
|
||||
: `true` if a given field value that is a slice/array of strings or integers contains elements in common with the matching value; it follows the same rules as the [`intersect` function][intersect].
|
||||
|
||||
## Using `where` with `intersect`
|
||||
|
||||
```golang
|
||||
```html
|
||||
{{ range where .Site.Pages ".Params.tags" "intersect" .Params.tags }}
|
||||
{{ if ne .Permalink $.Permalink }}
|
||||
{{ .Render "summary" }}
|
||||
@ -69,17 +86,37 @@ The following logical operators are vailable with `where`:
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
You can also put the returned value of the `where` clauses into a variable:
|
||||
|
||||
{{% code file="where-intersect-variables.html" %}}
|
||||
```html
|
||||
{{ $v1 := where .Site.Pages "Params.a" "v1" }}
|
||||
{{ $v2 := where .Site.Pages "Params.b" "v2" }}
|
||||
{{ $filtered := $v1 | intersect $v2 }}
|
||||
{{ range $filtered }}
|
||||
{{ end }}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
## Using `where` with `first`
|
||||
|
||||
```golang
|
||||
The following grabs the first five content files in `post` using the [default ordering](/templates/ordering-and-grouping/) for lists (i.e., `weight => date`):
|
||||
|
||||
{{% code file="where-with-first.html" %}}
|
||||
```html
|
||||
{{ range first 5 (where .Data.Pages "Section" "post") }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
## Nesting `where` Clauses
|
||||
|
||||
**Needs Example**
|
||||
You can also nest `where` clauses to drill down on lists of content by more than one parameter. The following first grabs all pages in the "blog" section and then ranges through the result of the first `where` clause and finds all pages that are *not* featured:
|
||||
|
||||
```
|
||||
{{ range where (where .Data.Pages "Section" "blog" ) ".Params.featured" "!=" "true" }}
|
||||
```
|
||||
|
||||
## Unset Fields
|
||||
|
||||
@ -92,9 +129,10 @@ Only the following operators are available for `nil`
|
||||
* `=`, `==`, `eq`: True if the given field is not set.
|
||||
* `!=`, `<>`, `ne`: True if the given field is set.
|
||||
|
||||
```golang
|
||||
```html
|
||||
{{ range where .Data.Pages ".Params.specialpost" "!=" nil }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
[intersect]: /functions/intersect/
|
@ -458,6 +458,7 @@ you need to install the Python-based Pygments program. The procedure is outlined
|
||||
Now that you've installed Hugo, read the [Quick Start guide][quickstart] and explore the rest of the documentation. If you have questions, ask the Hugo community directly by visiting the [Hugo Discussion Forum][forum].
|
||||
|
||||
[brew]: https://brew.sh/
|
||||
[Chocolatey]: https://chocolatey.org/
|
||||
[highlight shortcode]: /content-management/shortcodes/#highlight
|
||||
[forum]: https://discuss.gohugo.io
|
||||
[installgit]: (http://git-scm.com/)
|
||||
|
17
content/hosting-and-deployment/hosting-on-firebase.md
Normal file
17
content/hosting-and-deployment/hosting-on-firebase.md
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
title: Hosting on Firebase
|
||||
linktitle: Hosting on Firebase
|
||||
description: You can use Firebase's free tier to host your static website; this also gives you access to Firebase's NOSQL API.
|
||||
date: 2017-03-12
|
||||
publishdate: 2017-03-12
|
||||
lastmod: 2017-03-12
|
||||
categories: [hosting and deployment]
|
||||
tags: [hosting,firebase]
|
||||
authors: []
|
||||
weight: 40
|
||||
draft: true
|
||||
toc: true
|
||||
aliases: []
|
||||
wip: true
|
||||
---
|
||||
|
@ -3,7 +3,7 @@
|
||||
{{$section := .Section}}
|
||||
{{ if .NextInSection }}
|
||||
<a href="{{.NextInSection.Permalink}}" class="cf-link prev-page">
|
||||
<i class="fa fa-chevron-left"></i>
|
||||
<i class="icon-prev"></i>
|
||||
<div class="page-info">
|
||||
<span>Previous</span>
|
||||
<h5 class="{{$section}}">{{if eq .Section "functions"}}{{- replace (.NextInSection.LinkTitle) "and" "<em>and</em>" | safeHTML -}}{{else}}{{.NextInSection.Title | markdownify}}{{end}}</h5>
|
||||
@ -13,7 +13,7 @@
|
||||
{{ with .Site.GetPage "section" $section }}
|
||||
<a href="{{.Permalink}}" class="cf-link prev-page">
|
||||
|
||||
<i class="fa fa-chevron-left"></i>
|
||||
<i class="icon-prev"></i>
|
||||
|
||||
<div class="page-info">
|
||||
<span>Previous</span>
|
||||
@ -28,7 +28,7 @@
|
||||
<span>Next</span>
|
||||
<h5 class="{{$section}}">{{if eq .Section "functions"}}{{- replace (.LinkTitle) "and" "<em>and</em>" | safeHTML -}}{{else}}{{.Title | markdownify}}{{end}}</h5>
|
||||
</div>
|
||||
<i class="fa fa-chevron-right"></i>
|
||||
<i class="icon-next"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{if eq .Kind "section"}}
|
||||
@ -39,7 +39,7 @@
|
||||
<h5 class="{{.Section}}">{{.Title}}</h5>
|
||||
</div>
|
||||
|
||||
<i class="fa fa-chevron-right"></i>
|
||||
<i class="icon-next"></i>
|
||||
|
||||
</a>
|
||||
{{end}}
|
||||
|
File diff suppressed because one or more lines are too long
@ -19,7 +19,7 @@ const sassfiles = ["./scss/**/*.scss"];
|
||||
const sourcemaps = require('gulp-sourcemaps');
|
||||
const uglify = require('gulp-uglify');
|
||||
|
||||
/**
|
||||
/*
|
||||
*
|
||||
* Styles
|
||||
* - Compile
|
||||
|
@ -86,6 +86,8 @@
|
||||
.icon-home:before { content: '\e813'; } /* '' */
|
||||
.icon-html:before { content: '\f13b'; } /* '' */
|
||||
.icon-hugo:before { content: '\e802'; } /* '' */
|
||||
.icon-javascript:before { content: '\e81d'; } /* '' */
|
||||
.icon-js:before { content: '\e81d'; } /* '' */
|
||||
.icon-ie:before { content: '\e843'; } /* '' */
|
||||
.icon-link-external:before { content: '\f08e'; } /* '' */
|
||||
.icon-link:before { content: '\e812'; } /* '' */
|
||||
@ -93,9 +95,11 @@
|
||||
.icon-mail-alt:before { content: '\f0e0'; } /* '' */
|
||||
.icon-md:before { content: '\e818'; } /* '' */
|
||||
.icon-netlify:before { content: '\e80b'; } /* '' */
|
||||
.icon-next:before { content: '\e81b'; } /* '' */
|
||||
.icon-opera:before { content: '\e842'; } /* '' */
|
||||
.icon-pencil:before { content: '\e807'; } /* '' */
|
||||
.icon-pin:before { content: '\e811'; } /* '' */
|
||||
.icon-prev:before { content: '\e81c'; } /* '' */
|
||||
.icon-quote-left:before { content: '\e819'; } /* '' */
|
||||
.icon-quote-right:before { content: '\e81a'; } /* '' */
|
||||
.icon-search:before { content: '\e803'; } /* '' */
|
||||
|
@ -74,18 +74,6 @@ code[class^="language-"] {
|
||||
}
|
||||
}
|
||||
|
||||
code.language-html:after {
|
||||
font-family: 'FontAwesome';
|
||||
content: '\f13b';
|
||||
}
|
||||
|
||||
code.language-js:after {
|
||||
font-family: 'fontello';
|
||||
content: '\e802';
|
||||
font-size: 16px;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
code.language-git:after {
|
||||
font-family: 'fontello';
|
||||
content: '\f1d3';
|
||||
@ -100,6 +88,30 @@ code.language-golang:after {
|
||||
content: '\e801';
|
||||
}
|
||||
|
||||
code.language-html:after {
|
||||
font-family: 'fontello';
|
||||
content: '\f13b';
|
||||
}
|
||||
|
||||
code.language-javascript:after,
|
||||
code.language-js:after {
|
||||
font-family: 'fontello';
|
||||
content: '\e81d';
|
||||
}
|
||||
|
||||
code.language-json:after {
|
||||
content: 'JSON';
|
||||
font-size: .8em;
|
||||
padding-right: .3em;
|
||||
font-family: $code-font-family;
|
||||
}
|
||||
|
||||
code.language-md:after,
|
||||
code.language-markdown:after {
|
||||
font-family: 'fontello';
|
||||
content: '\e818';
|
||||
}
|
||||
|
||||
code.language-sass:after,
|
||||
code.language-scss:after {
|
||||
font-family: 'fontello';
|
||||
@ -128,19 +140,6 @@ code.language-yml:after {
|
||||
font-family: $code-font-family;
|
||||
}
|
||||
|
||||
code.language-json:after {
|
||||
content: 'JSON';
|
||||
font-size: .8em;
|
||||
padding-right: .3em;
|
||||
font-family: $code-font-family;
|
||||
}
|
||||
|
||||
code.language-md:after,
|
||||
code.language-markdown:after {
|
||||
font-family: 'fontello';
|
||||
content: '\e818';
|
||||
}
|
||||
|
||||
.copy-button + .code-copy-content {
|
||||
code[class^="language-"] {
|
||||
&:after {
|
||||
|
2
static/css/style.min.css
vendored
2
static/css/style.min.css
vendored
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -60,6 +60,12 @@
|
||||
|
||||
<glyph glyph-name="quote-right" unicode="" d="M18 685l335 0 0-334q0-140-98-238t-237-97l0 111q92 0 158 65t65 159l-223 0 0 334z m558 0l335 0 0-334q0-140-98-238t-237-97l0 111q92 0 158 65t65 159l-223 0 0 334z" horiz-adv-x="928" />
|
||||
|
||||
<glyph glyph-name="next" unicode="" d="M618 361l-414-415q-11-10-25-10t-25 10l-93 93q-11 11-11 25t11 25l296 297-296 296q-11 11-11 25t11 25l93 93q10 11 25 11t25-11l414-414q10-11 10-25t-10-25z" horiz-adv-x="714.3" />
|
||||
|
||||
<glyph glyph-name="prev" unicode="" d="M654 682l-297-296 297-297q10-10 10-25t-10-25l-93-93q-11-10-25-10t-25 10l-414 415q-11 10-11 25t11 25l414 414q10 11 25 11t25-11l93-93q10-10 10-25t-10-25z" horiz-adv-x="714.3" />
|
||||
|
||||
<glyph glyph-name="icon-js" unicode="" d="M960 732c0 34-28 62-62 62l-734 0c-34 0-61-28-61-62l0-775c0-34 27-62 61-62l734 0c34 0 62 28 62 62l0 775z m-167-463c-26-3-48-12-64-28-17-17-25-37-25-63 0-38 16-65 51-87 9-5 21-11 42-20 29-13 40-18 47-26 8-9 11-23 5-34-1-3-4-6-6-9-8-8-21-12-37-12-27 0-47 11-63 35-2 3-4 6-5 6 0 0-53-31-54-32-1 0 0-2 3-6 21-36 53-56 98-62 11-2 33-2 44 0 28 4 49 13 65 29 18 16 26 38 26 65 0 17-3 31-9 44-4 9-9 15-17 23-14 15-33 26-71 42-28 12-38 18-44 24-6 7-9 14-8 24 0 7 3 12 7 17 7 7 14 10 26 10 13 0 22-3 31-12 3-3 7-8 9-11 2-3 4-5 4-5 2 1 52 33 52 34 0 0-2 4-6 9-6 10-18 22-26 28-16 10-32 15-53 16-11 1-12 1-22 1z m-215-126l0-122-2-6c-2-8-4-12-8-16-6-6-14-9-26-9-18 0-29 8-41 29-2 3-4 6-4 6 0 0-13-8-28-17l-27-16 2-5c12-24 34-43 60-51 27-10 62-9 87 2 31 12 49 38 54 76 0 4 1 47 1 128l0 123-34 0-34 0 0-122z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="firefox" unicode="" d="M504-137c-216 0-387 126-466 306-87 200-17 521 139 663l-6-156c8 9 68 12 78-1 32 62 136 109 220 110-32-26-106-124-99-174 40-13 103-13 136-15 10-6 8-40-12-68-27-36-97-49-97-49l8-106-77 38c-26-64 35-120 97-110 69 12 94 57 142 54 49-2 68-29 61-54-7-30-59-25-59-25-44-70-103-100-198-92 144-119 338-11 387 86 50 97 7 242-43 283 59-25 99-51 120-107 11 124-46 266-149 349 193-56 311-205 314-444 3-239-211-488-496-488z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="chrome" unicode="" d="M498 850c-147-1-291-67-387-186l154-237c39 111 150 182 267 170l414-22c-42 84-108 157-196 208-79 46-166 67-252 67z m-416-226c-52-79-82-173-82-274 0-250 183-457 423-494l128 252c-116-22-233 39-281 146l-188 370z m885-94l-282-15c76-89 82-221 13-317l-226-347c94-6 190 15 278 66 216 125 304 387 217 613z m-467-11c-93 0-169-76-169-169s76-169 169-169 169 76 169 169-76 169-169 169z" horiz-adv-x="1000" />
|
||||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 26 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
static/images/showcase/lucumt.jpg
Normal file
BIN
static/images/showcase/lucumt.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
Loading…
x
Reference in New Issue
Block a user