Finish local file templates page

This commit is contained in:
Ryan Watters committed 2017-02-27 16:59:03 -06:00
1 parent fcb147cb08
commit 781574bebe
51 files changed
+170 -119

No files matched your search

-2
View File
@@ -7,9 +7,7 @@ lastmod: ""
categories: [] categories: []
tags: [] tags: []
weight: 00 weight: 00
draft: true
slug: "" slug: ""
aliases: [] aliases: []
toc: false toc: false
z_notesforauthors: "Go to gohugo.io/contribute/documentation for more info on using this archetype."
--- ---
+1 -1
View File
@@ -10,7 +10,7 @@ tags: [cli,command line]
weight: 01 weight: 01
draft: false draft: false
aliases: [/cli/] aliases: [/cli/]
needsreview: true wip: true
--- ---
The following list contains auto-generated and up-to-date (thanks to [Cobra][]) documentation for all the CLI commands in Hugo. The following list contains auto-generated and up-to-date (thanks to [Cobra][]) documentation for all the CLI commands in Hugo.
+20 -22
View File
@@ -11,7 +11,7 @@ weight: 70
draft: false draft: false
aliases: [/content/archetypes/] aliases: [/content/archetypes/]
toc: true toc: true
notesforauthors: wip: true
--- ---
## What are Archetypes? ## What are Archetypes?
@@ -24,7 +24,7 @@ Hugo's generator assumes your working directory is the content folder at the roo
hugo new [content-section/file-name.md] hugo new [content-section/file-name.md]
``` ```
We can use this pattern to create a new `.md` file in the `posts` section of the [example site][]: We can use this pattern to create a new `.md` file in the `posts` section:
{{% code file="archetype-example.sh" %}} {{% code file="archetype-example.sh" %}}
```bash ```bash
@@ -60,8 +60,8 @@ Similar to the lookup order for [templates in the `layouts` directory][], Hugo l
1. `archetypes/posts.md` 1. `archetypes/posts.md`
2. `archetypes/default.md` 2. `archetypes/default.md`
3. `themes/theme-name/archetypes/posts.md` 3. `themes/<THEME>/archetypes/posts.md`
4. `themes/theme-name/archetypes/default.md` 4. `themes/<THEME>/archetypes/default.md`
5. `_internal` (i.e., `title` and `date`) 5. `_internal` (i.e., `title` and `date`)
{{% note "Using a Theme Archetype" %}} {{% note "Using a Theme Archetype" %}}
@@ -76,11 +76,11 @@ You can specify a different default format in your site [configuration file][] f
## Default Archetypes ## Default Archetypes
Default archetypes are convenient if your content's front matter stays consistent across multiple [content sections][]. Default archetypes are convenient if your content's front matter stays consistent across multiple [content sections][sections].
### Creating the Default Archetype ### Creating the Default Archetype
The [example site][] includes `tags` and `categories` as [taxonomies][]. If we assume that all content files will require these two key-values, we can create a `default.md` archetype that *extends* Hugo's base archetype. In this example, we are including "golang" and "hugo" as tags and "web development" as a category. The following examples are from a site using `tags` and `categories` as [taxonomies][]. If we assume that all content files will require these two key-values, we can create a `default.md` archetype that *extends* Hugo's base archetype. In this example, we are including "golang" and "hugo" as tags and "web development" as a category.
{{% code file="archetypes/default.md" %}} {{% code file="archetypes/default.md" %}}
```toml ```toml
@@ -124,15 +124,9 @@ We see that the `title` and `date` key-values have been added in addition to the
You may notice that content files created with `hugo new` do not observe the order of the key-values specified in your archetype files and instead list your front matter alphabetically. This is a [known issue](https://github.com/spf13/hugo/issues/452). You may notice that content files created with `hugo new` do not observe the order of the key-values specified in your archetype files and instead list your front matter alphabetically. This is a [known issue](https://github.com/spf13/hugo/issues/452).
{{% /note %}} {{% /note %}}
### Example Site Default Archetype
The following is the default archetype used in the [example site][].
{{< exfile "static/example/archetypes/default.md" "yaml">}}
## Custom Archetypes ## Custom Archetypes
Suppose the example site's `posts` section requires more sophisticated front matter than what has been specified in `archetypes/default.md`. We can create a custom archetype for our posts at `archetypes/posts.md` that includes the full set of front matter. Suppose your site's `posts` section requires more sophisticated front matter than what has been specified in `archetypes/default.md`. You can create a custom archetype for your posts at `archetypes/posts.md` that includes the full set of front matter to be added to the two default archetypes fields.
### Creating a Custom Archetype ### Creating a Custom Archetype
@@ -148,7 +142,7 @@ categories = ""
### Using a Custom Archetype ### Using a Custom Archetype
With an `archetypes/posts.md` in place, we can use the CLI to create a new posts with custom `posts` metadata in the `posts` content section: With an `archetypes/posts.md` in place, you can use the Hugo CLI to create a new post with your custom `posts` metadata in the `posts` content section:
{{% code file="new-post-from-custom.sh" %}} {{% code file="new-post-from-custom.sh" %}}
```bash ```bash
@@ -170,23 +164,27 @@ title = post from custom
``` ```
{{% /output %}} {{% /output %}}
### Example Site Custom Archetype ### Hugo Docs Custom Archetype
`musicians` in the [example site] require more sophisticated front matter than what has been specified in `archetypes/default.md`. We can create a custom archetype for musicians at `archetypes/musicians.md` that includes the full set of front matter. As an example of archetypes in practice, the following is the `functions` archetype from the Hugo docs:
The following is the `musicians` archetype from the [example site][]: {{% code file="archetypes/functions.md" %}}
```yaml
{{< exfile "static/example/archetypes/musicians.md" "yaml" >}} {{< readfile file="archetypes/functions.md" >}}
```
{{% /code %}}
{{% note %}}
The preceding archetype is kept up to date with every Hugo build by using Hugo's [`readFile` function](/functions/readfile/). For similar examples, see [Local File Templates](/templates/local-file-templates/).
{{% /note %}}
[archetypes directory]: /project-organization/directory-structure/ [archetypes directory]: /project-organization/directory-structure/
[`now()`]: http://golang.org/pkg/time/#Now [`now()`]: http://golang.org/pkg/time/#Now
[configuration file]: /project-organization/configuration/ [configuration file]: /project-organization/configuration/
[content sections]: /sections/ [sections]: /sections/
[content types]: /content-management/content-types/ [content types]: /content-management/content-types/
[example site]: /getting-started/using-the-hugo-docs/#example-site
[front matter]: /content-management/front-matter/ [front matter]: /content-management/front-matter/
[RFC 3339 format]: https://www.ietf.org/rfc/rfc3339.txt [RFC 3339 format]: https://www.ietf.org/rfc/rfc3339.txt
[taxonomies]: /content-management/taxonomies/ [taxonomies]: /content-management/taxonomies/
[templates in the `layouts` directory]: /templates/base-templates-and-blocks/ [templates in the `layouts` directory]: /templates/base-templates-and-blocks/
[templates]: /templates/ [templates]: /templates/
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 140
draft: false draft: false
aliases: [/extras/comments/] aliases: [/extras/comments/]
toc: true toc: true
needsreview: true wip: true
--- ---
As Hugo is a static site generator, the content produced is static and doesn't allow for a high degree of interaction with the website's end users. The most common interaction people ask for in static websites is the ability to add comments. As Hugo is a static site generator, the content produced is static and doesn't allow for a high degree of interaction with the website's end users. The most common interaction people ask for in static websites is the ability to add comments.
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 60
draft: false draft: false
aliases: [/content/types] aliases: [/content/types]
toc: true toc: true
needsreview: true wip: true
--- ---
Hugo provides full support for sites with multiple content types. A **content type** can have a unique set of metadata (i.e., [front matter][]) or customized [template][] and can be created by the `hugo new` command via content [archetypes][]. Hugo provides full support for sites with multiple content types. A **content type** can have a unique set of metadata (i.e., [front matter][]) or customized [template][] and can be created by the `hugo new` command via content [archetypes][].
+1 -1
View File
@@ -10,7 +10,7 @@ tags: ["front matter", "yaml", "toml", "json", "metadata", "archetypes"]
weight: 30 weight: 30
draft: false draft: false
aliases: [/content/front-matter/] aliases: [/content/front-matter/]
needsreview: true wip: true
toc: true toc: true
notesforauthors: notesforauthors:
--- ---
+1 -1
View File
@@ -11,7 +11,7 @@ draft: false
weight: 120 weight: 120
aliases: [/extras/menus/] aliases: [/extras/menus/]
toc: true toc: true
needsreview: true wip: true
--- ---
Hugo's simple yet powerful menu system allows you to add content to menus with a high degree of control and a very low amount of effort on the part of content authors. Hugo's simple yet powerful menu system allows you to add content to menus with a high degree of control and a very low amount of effort on the part of content authors.
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 150
draft: false draft: false
aliases: [/content/multilingual/,/content-management/multilingual/] aliases: [/content/multilingual/,/content-management/multilingual/]
toc: true toc: true
needsreview: true wip: true
--- ---
Hugo supports multiple languages side-by-side (added in `Hugo 0.17`). Define the available languages in a `Languages` section in your top-level `config.toml` (or equivalent). Hugo supports multiple languages side-by-side (added in `Hugo 0.17`). Define the available languages in a `Languages` section in your top-level `config.toml` (or equivalent).
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 10
draft: false draft: false
aliases: [/content-management/sections,/content/sections/] aliases: [/content-management/sections,/content/sections/]
toc: true toc: true
needsreview: true wip: true
--- ---
## Introduction ## Introduction
+17 -18
View File
@@ -19,37 +19,37 @@ Hugo believes that you organize your content with a purpose. The same structure
Following this pattern, Hugo uses the top level of your content organization as the content **section**. Following this pattern, Hugo uses the top level of your content organization as the content **section**.
The [example site][] used throughout the Hugo docs includes three sections: "authors," "events," and "posts". The following illustrates both the source organization and the default URL structure for the rendered files: The following example shows a content directory structure for a website that has three sections: "authors," "events," and "posts":
```bash ```bash
. .
└── content └── content
├── authors ├── authors
| ├── _index.md // <- example.com/authors/ | ├── _index.md // <- yoursite.com/authors/
| ├── john-doe.md // <- example.com/authors/john-doe/ | ├── john-doe.md // <- yoursite.com/authors/john-doe/
| └── jane-doe.md // <- example.com/authors/jane-doe/ | └── jane-doe.md // <- yoursite.com/authors/jane-doe/
└── events └── events
| ├── _index.md // <- example.com/events/ | ├── _index.md // <- yoursite.com/events/
| ├── event-1.md // <- example.com/events/event-1/ | ├── event-1.md // <- yoursite.com/events/event-1/
| ├── event-2.md // <- example.com/events/event-2/ | ├── event-2.md // <- yoursite.com/events/event-2/
| └── event-3.md // <- example.com/events/event-3/ | └── event-3.md // <- yoursite.com/events/event-3/
└── posts └── posts
| ├── _index.md // <- example.com/posts/ | ├── _index.md // <- yoursite.com/posts/
| ├── event-1.md // <- example.com/posts/event-1/ | ├── event-1.md // <- yoursite.com/posts/event-1/
| ├── event-2.md // <- example.com/posts/event-2/ | ├── event-2.md // <- yoursite.com/posts/event-2/
| ├── event-3.md // <- example.com/posts/event-3/ | ├── event-3.md // <- yoursite.com/posts/event-3/
| ├── event-4.md // <- example.com/posts/event-4/ | ├── event-4.md // <- yoursite.com/posts/event-4/
| └── event-5.md // <- example.com/posts/event-5/ | └── event-5.md // <- yoursite.com/posts/event-5/
``` ```
## Content Section Lists ## Content Section Lists
Hugo will automatically create pages for each section root that list all of the content in that section. See the documentation on [list and section templates][listsandsectiontemplatespage] for details on customizing the way these pages are rendered. Hugo will automatically create pages for each section root that list all of the content in that section. See the documentation on [section templates][] for details on customizing the way these pages are rendered.
As of Hugo v0.18, section pages can also have a content file and front matter. These section content files must be placed in their corresponding section folder and named `_index.md` in order for Hugo to correctly render the front matter and content. As of Hugo v0.18, section pages can also have a content file and front matter. These section content files must be placed in their corresponding section folder and named `_index.md` in order for Hugo to correctly render the front matter and content.
{{% warning "`index.md` vs `_index.md`" %}} {{% warning "`index.md` vs `_index.md`" %}}
Hugo themes developed before v0.18 often used an `index.md`(i.e., without the leading underscore) in a content section as a hack to emulate the behavior of `_index.md`. The hack may work...*sometimes*; however, the order of page rendering can be unpredictable in Hugo. What works now may fail to render appropriately as your site grows. It is **strongly advised** to use `_index.md` as content for your section index pages. **Note:** `_index.md`'s layout, as representative of a section, is a [list page template](/templates/section-templates/) and *not* a [single page template](/templates/single-page-templates/). Hugo themes developed before v0.18 often used an `index.md`(i.e., without the leading underscore [`_`]) in a content section as a hack to emulate the behavior of `_index.md`. The hack may work...*sometimes*; however, the order of page rendering can be unpredictable in Hugo. What works now may fail to render appropriately as your site grows. It is **strongly advised** to use `_index.md` as content for your section index pages. **Note:** `_index.md`'s layout, as representative of a section, is a [list page template](/templates/section-templates/) and *not* a [single page template](/templates/single-page-templates/). If you want to alter the new default behavior for `_index.md`, configure `disableKinds` accordingly in your [site's configuration](/getting-started/configuration/).
{{% /warning %}} {{% /warning %}}
## Content *Section* vs Content *Type* ## Content *Section* vs Content *Type*
@@ -58,8 +58,7 @@ By default, everything created within a section will use the [content type][] th
[archetype]: /content-management/archetypes/ [archetype]: /content-management/archetypes/
[content type]: /content-management/content-types/ [content type]: /content-management/content-types/
[example site]: /getting-started/using-the-hugo-docs/
[directory structure]: /getting-started/directory-structure/ [directory structure]: /getting-started/directory-structure/
[listsandsectiontemplatespage]: /templates/section-templates/ [section templates]: /templates/section-templates/
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 130
draft: false draft: false
aliases: [/extras/toc/,/content-management/toc/] aliases: [/extras/toc/,/content-management/toc/]
toc: false toc: false
needsreview: true wip: true
--- ---
Hugo can automatically parse Markdown content and create a Table of Contents you can leverage in your templates to guide readers to sections of longer pages. Hugo can automatically parse Markdown content and create a Table of Contents you can leverage in your templates to guide readers to sections of longer pages.
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 110
draft: false draft: false
aliases: [/extras/permalinks/,/extras/aliases/,/extras/urls/,/doc/redirects/,/doc/alias/,/doc/aliases/] aliases: [/extras/permalinks/,/extras/aliases/,/extras/urls/,/doc/redirects/,/doc/alias/,/doc/aliases/]
toc: true toc: true
needsreview: true wip: true
--- ---
## Permalinks ## Permalinks
+1 -1
View File
@@ -10,7 +10,7 @@ tags: []
weight: 01 weight: 01
draft: false draft: false
slug: slug:
aliases: [/tutorials/how-to-contribute-to-hugo/] aliases: [/tutorials/how-to-contribute-to-hugo/,/community/contributing/]
toc: false toc: false
--- ---
+2 -2
View File
@@ -1,5 +1,5 @@
--- ---
title: Contribute to Hugo Development title: Contribute to Development
linktitle: Contribute to Hugo Development linktitle: Contribute to Hugo Development
description: Hugo relies heavily on contributions from the open source community. You don't need to be a Golang guru to contribute to the project's development. description: Hugo relies heavily on contributions from the open source community. You don't need to be a Golang guru to contribute to the project's development.
date: 2017-02-01 date: 2017-02-01
@@ -12,7 +12,7 @@ weight: 10
draft: false draft: false
aliases: [/contribute/development/] aliases: [/contribute/development/]
toc: true toc: true
needsreview: true wip: true
notesforauthors: notesforauthors:
--- ---
+2 -2
View File
@@ -1,6 +1,6 @@
--- ---
title: Contribute to the Hugo Docs title: Contribute to the Hugo Docs
linktitle: Contribute to the Hugo Docs linktitle: Improve the Docs
description: Documentation is an integral part of any open source project. The Hugo docs are as much a work in progress as the source it attempts to teach its users. description: Documentation is an integral part of any open source project. The Hugo docs are as much a work in progress as the source it attempts to teach its users.
date: 2017-02-01 date: 2017-02-01
publishdate: 2017-02-01 publishdate: 2017-02-01
@@ -11,7 +11,7 @@ weight: 20
draft: false draft: false
aliases: [/contribute/docs/] aliases: [/contribute/docs/]
toc: true toc: true
needsreview: true wip: true
--- ---
Documentation is a critical component of any open-source project. The Hugo docs were completely reworked for the release of v0.19, but there is always room for improvement. Documentation is a critical component of any open-source project. The Hugo docs were completely reworked for the release of v0.19, but there is always room for improvement.
+5 -5
View File
@@ -1,5 +1,5 @@
--- ---
title: title: Add Your Hugo Theme to the Showcase
linktitle: Add Your Theme linktitle: Add Your Theme
description: If you've built a Hugo theme and want to contribute back to the Hugo Community, add your theme to the Hugo Showcase. description: If you've built a Hugo theme and want to contribute back to the Hugo Community, add your theme to the Hugo Showcase.
date: 2017-02-01 date: 2017-02-01
@@ -11,7 +11,7 @@ authors: [digitalcraftsman]
weight: 10 weight: 10
draft: false draft: false
aliases: [/contribute/theme/] aliases: [/contribute/theme/]
needsreview: true wip: true
notesforauthors: notesforauthors:
--- ---
@@ -117,6 +117,6 @@ This is because its content will appear in two places&mdash;i.e., it will appear
1. On your theme's details page at [themes.gohugo.io](http://themes.gohugo.io/); and 1. On your theme's details page at [themes.gohugo.io](http://themes.gohugo.io/); and
1. At GitHub (as usual), on your theme's regular main page. 1. At GitHub (as usual), on your theme's regular main page.
**Note:** If you add screenshots to the README please make use of absolute file paths instead of relative ones like `/images/screenshot.png`. Relative paths work great on GitHub but they don't correspond to the directory structure of [themes.gohugo.io](http://themes.gohugo.io/). Therefore, browsers will not be able to display screenshots on the theme site under the given (relative) path. {{% note "Screenshots"%}}
If you add screenshots to the README, please make use of absolute file paths instead of relative ones like `/images/screenshot.png`. Relative paths work great on GitHub but they don't correspond to the directory structure of [themes.gohugo.io](http://themes.gohugo.io/). Therefore, browsers will not be able to display screenshots on the theme site under the given (relative) path.
{{% /note %}}
+1 -1
View File
@@ -16,7 +16,7 @@ relatedfuncs: []
deprecated: false deprecated: false
draft: false draft: false
aliases: [] aliases: []
needsreview: true wip: true
--- ---
In Hugo, you can declare [site-wide params][sitevars] (i.e. in your [configuration][]), as well as params for [individual pages][pagevars]. In Hugo, you can declare [site-wide params][sitevars] (i.e. in your [configuration][]), as well as params for [individual pages][pagevars].
@@ -9,7 +9,7 @@ categories: [project organization]
tags: [source, organization, directories,fundamentals] tags: [source, organization, directories,fundamentals]
weight: 50 weight: 50
draft: false draft: false
needsreview: true wip: true
aliases: [/overview/source-directory/] aliases: [/overview/source-directory/]
--- ---
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 40
draft: false draft: false
aliases: [/overview/usage/,/extras/livereload/,/doc/usage/] aliases: [/overview/usage/,/extras/livereload/,/doc/usage/]
toc: true toc: true
needsreview: true wip: true
--- ---
## Testing Installation with `hugo help` ## Testing Installation with `hugo help`
@@ -12,9 +12,9 @@ weight: 20
draft: true draft: true
aliases: [/getting-started/using-the-docs/] aliases: [/getting-started/using-the-docs/]
toc: true toc: true
needsreview: true wip: true
notesforauthors: notesforauthors:
needsreview: true wip: true
--- ---
## Example Site ## Example Site
@@ -12,7 +12,7 @@ weight: 20
draft: false draft: false
aliases: [/tutorials/automated-deployments/] aliases: [/tutorials/automated-deployments/]
toc: true toc: true
needsreview: false wip: false
notesforauthors: notesforauthors:
--- ---
@@ -11,7 +11,7 @@ authors: [Riku-Pekka Silvola]
weight: 50 weight: 50
draft: false draft: false
toc: true toc: true
needsreview: false wip: false
aliases: [/tutorials/hosting-on-gitlab/] aliases: [/tutorials/hosting-on-gitlab/]
--- ---
@@ -12,6 +12,6 @@ weight: 20
draft: true draft: true
aliases: [] aliases: []
toc: true toc: true
needsreview: wip:
notesforauthors: notesforauthors:
--- ---
@@ -12,7 +12,7 @@ weight: 20
draft: false draft: false
aliases: [/templates/blocks/] aliases: [/templates/blocks/]
toc: true toc: true
needsreview: true wip: true
--- ---
Go 1.6 includes a powerful new keyword, `block`. This construct allows you to define the outer shell of your pages one or more master template(s), filling in or overriding portions as necessary. Go 1.6 includes a powerful new keyword, `block`. This construct allows you to define the outer shell of your pages one or more master template(s), filling in or overriding portions as necessary.
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 70
draft: false draft: false
aliases: [/templates/views/] aliases: [/templates/views/]
toc: true toc: true
needsreview: true wip: true
--- ---
In addition to the [single page content template][singletemplates], Hugo can render alternative views of your content. These are especially useful in [list templates][listtemplates]. In addition to the [single page content template][singletemplates], Hugo can render alternative views of your content. These are especially useful in [list templates][listtemplates].
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 120
draft: false draft: false
aliases: [/templates/404/] aliases: [/templates/404/]
toc: false toc: false
needsreview: true wip: true
--- ---
When using Hugo with [GitHub Pages](http://pages.github.com/), you can provide your own template for a [custom 404 error page](https://help.github.com/articles/custom-404-pages/) by creating a 404.html template file in your `/layouts` folder. When Hugo generates your site, the `404.html` file will be placed in the root. When using Hugo with [GitHub Pages](http://pages.github.com/), you can provide your own template for a [custom 404 error page](https://help.github.com/articles/custom-404-pages/) by creating a 404.html template file in your `/layouts` folder. When Hugo generates your site, the `404.html` file will be placed in the root.
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 80
draft: false draft: false
aliases: [/extras/datafiles/,/extras/datadrivencontent/,/doc/datafiles/] aliases: [/extras/datafiles/,/extras/datadrivencontent/,/doc/datafiles/]
toc: true toc: true
needsreview: true wip: true
--- ---
<!-- begin data files --> <!-- begin data files -->
+1 -1
View File
@@ -12,7 +12,7 @@ weight: 10
draft: false draft: false
aliases: [/templates/go-template-primer/,/layouts/go-templates/,/layout/go-templates/] aliases: [/templates/go-template-primer/,/layouts/go-templates/,/layout/go-templates/]
toc: true toc: true
needsreview: true wip: true
--- ---
Hugo uses the excellent [Go html/template][gohtmltemplate] library, an extremely lightweight engine that provides just the right amount of logic to be able to create any style of static website. If you have used other template systems from different languages or frameworks, you will find a lot of similarities in Go templates. Hugo uses the excellent [Go html/template][gohtmltemplate] library, an extremely lightweight engine that provides just the right amount of logic to be able to create any style of static website. If you have used other template systems from different languages or frameworks, you will find a lot of similarities in Go templates.
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 22
draft: false draft: false
aliases: [/templates/list/,/layout/indexes/] aliases: [/templates/list/,/layout/indexes/]
toc: true toc: true
needsreview: true wip: true
--- ---
## What is a List Page Template? ## What is a List Page Template?
+56 -12
View File
@@ -12,8 +12,6 @@ weight: 110
draft: false draft: false
aliases: [/extras/localfiles/,/templates/files/] aliases: [/extras/localfiles/,/templates/files/]
toc: true toc: true
needsreview: true
needsexample: true
--- ---
## Traversing Local Files ## Traversing Local Files
@@ -29,7 +27,7 @@ Whether the path is absolute or relative does not matter because---at least for
1. The file system root 1. The file system root
2. The current working directory 2. The current working directory
## Example: List Directory Files ### `readDir` Example: List Directory Files
So, let's create a new shortcode using `readDir`: So, let's create a new shortcode using `readDir`:
@@ -39,29 +37,75 @@ So, let's create a new shortcode using `readDir`:
``` ```
{{% /code %}} {{% /code %}}
For the files in any given directory, this shortcode usefully lists the files' basenames and sizes and also creates a link to each of them. This shortcode creates a link, files' basenames and sizes and creates a link to each of them.
This shortcode [has already been included in this very website][]. So, let's list some of its CSS files. (If you click on their names, you can reveal the contents.) This shortcode [is part of the code for the Hugo docs][dirindex]. list some of its CSS files. (If you click on their names, you can reveal the contents.)
{{< directoryindex path="/static/css" pathURL="/css" >}} {{< directoryindex path="/static/css" pathURL="/css" >}}
The following is the [shortcode declaration][shortcodes] used to render the above output: The following is the [shortcode declaration][sc] used to render the above output:
```html ```html
{{</* directoryindex path="/static/css" pathURL="/css" */>}} {{</* directoryindex path="/static/css" pathURL="/css" */>}}
``` ```
{{% note "Slashes are Important" %}} {{% note "Slashes are Important" %}}
The initial slash `/` in `pathURL` is important. Otherwise, `pathURL` becomes relative to the current web page. The initial slash `/` in `pathURL` is important in the `directoryindex` shortcode. Otherwise, `pathURL` becomes relative to the current web page.
{{% /note %}} {{% /note %}}
## Using `readFile` ## Using `readFile`
The [`readfile` function][reads] returns... The [`readfile` function][reads] reads a file--passed as an argument to the function, including path---from disk and converts it into a string to be manipulated by other Hugo functions or added as-is.
**CONTENT NEEDED**. To use the `readFile` function in your templates, make sure the path is relative to your *Hugo project's root directory*:
[has already been included in this very website]: https://github.com/spf13/hugo/blob/master/docs/layouts/shortcodes/directoryindex.html ```
{{ readFile "content/templates/local-file-templates" }}
```
### `readFile` Example: Add a Project File to Your Content
As `readFile` is a function, it is only available to you in your templates and not your content. However, we can create a simple [shortcode template][sct] that calls `readFile`, passes the first argument through the function, and then allows an options second argument to send the file through the Blackfriday markdown processor. The pattern for adding this shortcode to your content will be as follows:
```
{{</* readfile file="path/to/local/file.txt" markdown="true" */>}}
```
Here is the templating for our new `readfile` shortcode:
{{% code file="layouts/shortcodes/readfile.html" download="readfile.html" %}}
```
{{< readfile file="layouts/shortcodes/readfile.html">}}
```
{{% /code %}}
This shortcode is [also part of the Hugo docs][readfilesource]. The Hugo docs also include this [`testing.txt`][testfile] file. We can call pass this file into our new `readfile` shortcode as follows:
```
{{</* readfile file="testing.txt" */>}}
```
The output "string" for calling this file is as follows:
```markdown
{{< readfile file="testing.txt" >}}
```
However, if we want Hugo to pass this string through Blackfriday, we should add the `markdown="true"` optional parameter:
```html
{{</* readfile file="testing.txt" markdown="true" */>}}
```
And here is it is [called directly in the Hugo docs][] content file used to creat this page and rendered for display:
{{< readfile file="testing.txt" markdown="true">}}
[called directly in the Hugo docs]: https://github.com/spf13/hugo/blob/master/docs/content/templates/local-file-templates.md
[dirindex]: https://github.com/spf13/hugo/blob/master/docs/layouts/shortcodes/directoryindex.html
[osfileinfo]: https://golang.org/pkg/os/#FileInfo [osfileinfo]: https://golang.org/pkg/os/#FileInfo
[reads]: /functions/readdir-and-readfile/ [reads]: /functions/readfile/
[shortcodes]: /content-management/shortcodes/ [sc]: /content-management/shortcodes/
[sct]: /templates/shortcode-templates/
[readfilesource]: https://github.com/spf13/hugo/blob/master/docs/layouts/shortcodes/readfile.html
[testfile]: https://github.com/spf13/hugo/blob/master/docs/testfile
+1 -1
View File
@@ -11,7 +11,7 @@ tags: [lookup,fundamentals]
weight: 15 weight: 15
draft: false draft: false
aliases: [] aliases: []
needsreview: true wip: true
--- ---
Before creating your templates, it's important to know how Hugo looks for files within your project's [directory structure][]. Before creating your templates, it's important to know how Hugo looks for files within your project's [directory structure][].
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 130
draft: false draft: false
aliases: [/templates/menus/] aliases: [/templates/menus/]
toc: true toc: true
needsreview: true wip: true
--- ---
Hugo makes no assumptions about how your rendered HTML will be Hugo makes no assumptions about how your rendered HTML will be
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 140
draft: false draft: false
aliases: [/extras/pagination,/doc/pagination/] aliases: [/extras/pagination,/doc/pagination/]
toc: true toc: true
needsreview: true wip: true
--- ---
Hugo supports pagination for your homepage, section pages, and taxonomies. Hugo's pagination features were designed with ease of use and flexibility in mind. The real power of Hugo pagination shines when combine with the [`where` function][where] and its SQL-like operators: [`first`][], [`last`][], and [`after`][]. You can even [order the content][lists] the way you've become used to with Hugo. Hugo supports pagination for your homepage, section pages, and taxonomies. Hugo's pagination features were designed with ease of use and flexibility in mind. The real power of Hugo pagination shines when combine with the [`where` function][where] and its SQL-like operators: [`first`][], [`last`][], and [`after`][]. You can even [order the content][lists] the way you've become used to with Hugo.
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 90
draft: false draft: false
aliases: [/templates/partial/,/layout/chrome/,/extras/analytics/] aliases: [/templates/partial/,/layout/chrome/,/extras/analytics/]
toc: true toc: true
needsreview: true wip: true
--- ---
## Partials vs Templates ## Partials vs Templates
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 27
draft: false draft: false
aliases: [/templates/ordering/,/templates/grouping/] aliases: [/templates/ordering/,/templates/grouping/]
toc: true toc: true
needsreview: true wip: true
--- ---
![Image demonstrating a hierarchical website sitemap.](/images/site-hierarchy.svg) ![Image demonstrating a hierarchical website sitemap.](/images/site-hierarchy.svg)
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 165
draft: false draft: false
aliases: [/extras/robots-txt/] aliases: [/extras/robots-txt/]
toc: false toc: false
needsreview: true wip: true
--- ---
Hugo can generate a customized [robots.txt][robots] in the same way as any other template. Hugo can generate a customized [robots.txt][robots] in the same way as any other template.
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 150
draft: false draft: false
aliases: [/templates/rss/] aliases: [/templates/rss/]
toc: true toc: true
needsreview: true wip: true
--- ---
## RSS Template Lookup Order ## RSS Template Lookup Order
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 40
draft: false draft: false
aliases: [] aliases: []
toc: true toc: true
needsreview: true wip: true
--- ---
Section page templates are lists and therefore have all the variables and methods available to [list pages][lists]. Section page templates are lists and therefore have all the variables and methods available to [list pages][lists].
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 160
draft: false draft: false
aliases: [/layout/sitemap/,/templates/sitemap/] aliases: [/layout/sitemap/,/templates/sitemap/]
toc: false toc: false
needsreview: true wip: true
--- ---
A single Sitemap template is used to generate the `sitemap.xml` file. A single Sitemap template is used to generate the `sitemap.xml` file.
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 50
draft: false draft: false
aliases: [/taxonomies/displaying/,/templates/terms/,/indexes/displaying/,/taxonomies/templates/,/indexes/ordering/, /templates/taxonomies/, /templates/taxonomy/] aliases: [/taxonomies/displaying/,/templates/terms/,/indexes/displaying/,/taxonomies/templates/,/indexes/ordering/, /templates/taxonomies/, /templates/taxonomy/]
toc: true toc: true
needsreview: true wip: true
--- ---
<!-- NOTE! Check on https://github.com/spf13/hugo/issues/2826 for shifting of terms' pages to .Data.Pages --> <!-- NOTE! Check on https://github.com/spf13/hugo/issues/2826 for shifting of terms' pages to .Data.Pages -->
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 30
draft: false draft: false
aliases: [/themes/creation/] aliases: [/themes/creation/]
toc: true toc: true
needsreview: true wip: true
--- ---
{{% warning "Use Relative Links" %}} {{% warning "Use Relative Links" %}}
+1 -1
View File
@@ -11,7 +11,7 @@ weight: 20
draft: false draft: false
aliases: [/themes/customize/] aliases: [/themes/customize/]
toc: true toc: true
needsreview: true wip: true
--- ---
## Introduction ## Introduction
@@ -11,7 +11,7 @@ weight: 10
draft: false draft: false
aliases: [/themes/usage/,/themes/installing/] aliases: [/themes/usage/,/themes/installing/]
toc: true toc: true
needsreview: true wip: true
--- ---
{{% note "No Default Theme" %}} {{% note "No Default Theme" %}}
@@ -13,7 +13,7 @@ draft: false
hugoversion: 14 hugoversion: 14
toc: true toc: true
aliases: [/tutorials/migrate-from-jekyll/] aliases: [/tutorials/migrate-from-jekyll/]
needsreview: true wip: true
--- ---
{{% note "Support for Jekyll Imports" %}} {{% note "Support for Jekyll Imports" %}}
+1 -1
View File
@@ -11,7 +11,7 @@ draft: false
weight: 40 weight: 40
aliases: [] aliases: []
toc: false toc: false
needsreview: true wip: true
notesforauthors: notesforauthors:
--- ---
+1 -1
View File
@@ -11,7 +11,7 @@ draft: false
weight: 50 weight: 50
aliases: [/extras/gitinfo/,/variables/other-variables/] aliases: [/extras/gitinfo/,/variables/other-variables/]
toc: true toc: true
needsreview: false wip: false
--- ---
## Shortcode Variables ## Shortcode Variables
+1 -1
View File
@@ -11,7 +11,7 @@ draft: false
weight: 30 weight: 30
aliases: [] aliases: []
toc: true toc: true
needsreview: true wip: true
--- ---
### Taxonomy Terms Page Variables ### Taxonomy Terms Page Variables
+1 -1
View File
@@ -1 +1 @@
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;box-sizing:content-box;border-radius:0px !important;outline:none}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}html,body{margin:0px;padding:0px;outline:none;border:none;font-size:18px;font-family:"muli","Helvetica Neue","Helvetica","Roboto","Arial",sans-serif;color:#222;line-height:1.6;font-weight:300;overflow-x:hidden}body{font-size:90%;overflow-x:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}@media only screen and (min-width: 760px){body{font-size:95%}}@media only screen and (min-width: 960px){body{font-size:100%}}strong{font-weight:600;color:#222}p{margin-top:0px;margin-bottom:1.5em;line-height:1.6}@font-face{font-family:'fontello';src:url("/fonts/fontello/fontello.eot");src:url("/fonts/fontello/fontello.woff2") format("woff2"),url("/fonts/fontello/fontello.woff") format("woff"),url("/fonts/fontello/fontello.ttf") format("truetype"),url("/fonts/fontello/fontello.svg?78165468#fontello") format("svg");font-weight:normal;font-style:normal}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:"fontello";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-alert:before{content:'\e810'}.icon-angle-double-right:before{content:'\f101'}.icon-attach:before{content:'\e820'}.icon-attention:before{content:'\e80f'}.icon-bash:before{content:'\e804'}.icon-bell:before{content:'\e80d'}.icon-cancel:before{content:'\e81e'}.icon-caution:before{content:'\e80f'}.icon-chrome:before{content:'\e841'}.icon-clipboard:before{content:'\e817'}.icon-code:before{content:'\f121'}.icon-cog-alt:before{content:'\e814'}.icon-css3:before{content:'\f13c'}.icon-docs:before{content:'\f15c'}.icon-download:before{content:'\e815'}.icon-facebook-official:before{content:'\f230'}.icon-firefox:before{content:'\e840'}.icon-flag:before{content:'\e813'}.icon-forum:before{content:'\f03d';margin-right:.3em}.icon-github:before{content:'\f09b'}.icon-gitter:before{content:'\e819'}.icon-go:before{content:'\e801'}.icon-golang:before{content:'\e801'}.icon-heart:before{content:'\e81d'}.icon-help:before{content:'\e81b'}.icon-home:before{content:'\e812'}.icon-html.input:before{content:'\e81f'}.icon-html5:before{content:'\e800'}.icon-html:before{content:'\e800'}.icon-hugo:before{content:'\e81f'}.icon-ie:before{content:'\e843'}.icon-info:before{content:'\e811'}.icon-instagram:before{content:'\f32d'}.icon-javascript:before{content:'\e802'}.icon-js:before{content:'\e802'}.icon-json:before{content:'\e81c'}.icon-link:before{content:'\e816'}.icon-linkedin:before{content:'\f30c'}.icon-love:before{content:'\e81d'}.icon-mail:before{content:'\e821'}.icon-markdown:before{content:'\e80e'}.icon-md:before{content:'\e80e'}.icon-note:before{content:'\e80d'}.icon-opera:before{content:'\e842'}.icon-pdf:before{content:'\f1c1'}.icon-pencil:before{content:'\e80c'}.icon-picture:before{content:'\e808'}.icon-quLine truncated /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;box-sizing:content-box;border-radius:0px !important;outline:none}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}html,body{margin:0px;padding:0px;outline:none;border:none;font-size:18px;font-family:"muli","Helvetica Neue","Helvetica","Roboto","Arial",sans-serif;color:#222;line-height:1.6;font-weight:300;overflow-x:hidden}body{font-size:90%;overflow-x:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}@media only screen and (min-width: 760px){body{font-size:95%}}@media only screen and (min-width: 960px){body{font-size:100%}}strong{font-weight:600;color:#222}p{margin-top:0px;margin-bottom:1.5em;line-height:1.6}@font-face{font-family:'fontello';src:url("/fonts/fontello/fontello.eot");src:url("/fonts/fontello/fontello.woff2") format("woff2"),url("/fonts/fontello/fontello.woff") format("woff"),url("/fonts/fontello/fontello.ttf") format("truetype"),url("/fonts/fontello/fontello.svg?78165468#fontello") format("svg");font-weight:normal;font-style:normal}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:"fontello";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-alert:before{content:'\e810'}.icon-angle-double-right:before{content:'\f101'}.icon-attach:before{content:'\e820'}.icon-attention:before{content:'\e80f'}.icon-bash:before{content:'\e804'}.icon-bell:before{content:'\e80d'}.icon-cancel:before{content:'\e81e'}.icon-caution:before{content:'\e80f'}.icon-chrome:before{content:'\e841'}.icon-clipboard:before{content:'\e817'}.icon-code:before{content:'\f121'}.icon-cog-alt:before{content:'\e814'}.icon-css3:before{content:'\f13c'}.icon-docs:before{content:'\f15c'}.icon-download:before{content:'\e815'}.icon-facebook-official:before{content:'\f230'}.icon-firefox:before{content:'\e840'}.icon-flag:before{content:'\e813'}.icon-forum:before{content:'\f03d';margin-right:.3em}.icon-github:before{content:'\f09b'}.icon-gitter:before{content:'\e819'}.icon-go:before{content:'\e801'}.icon-golang:before{content:'\e801'}.icon-heart:before{content:'\e81d'}.icon-help:before{content:'\e81b'}.icon-home:before{content:'\e812'}.icon-html.input:before{content:'\e81f'}.icon-html5:before{content:'\e800'}.icon-html:before{content:'\e800'}.icon-hugo:before{content:'\e81f'}.icon-ie:before{content:'\e843'}.icon-info:before{content:'\e811'}.icon-instagram:before{content:'\f32d'}.icon-javascript:before{content:'\e802'}.icon-js:before{content:'\e802'}.icon-json:before{content:'\e81c'}.icon-link:before{content:'\e816'}.icon-linkedin:before{content:'\f30c'}.icon-love:before{content:'\e81d'}.icon-mail:before{content:'\e821'}.icon-markdown:before{content:'\e80e'}.icon-md:before{content:'\e80e'}.icon-note:before{content:'\e80d'}.icon-opera:before{content:'\e842'}.icon-pdf:before{content:'\f1c1'}.icon-pencil:before{content:'\e80c'}.icon-picture:before{content:'\e808'}.icon-quLine truncated
+3
View File
@@ -0,0 +1,3 @@
##### Hello World!
Testing one, **two**, *three*. Don't delete this sample file used in the [templates](/templates/) section of the Hugo docs.
+1 -1
View File
@@ -9,7 +9,7 @@
{{- partial "content-header-links.html" . -}} {{- partial "content-header-links.html" . -}}
{{- partial "tags.html" . -}} {{- partial "tags.html" . -}}
<!-- temporary WIP badge; should be removed before site launch --> <!-- temporary WIP badge; should be removed before site launch -->
{{- if .Params.needsreview -}} {{- if .Params.wip -}}
<div id="beingreviewed">WIP</div> <div id="beingreviewed">WIP</div>
{{- end -}} {{- end -}}
{{ $title := .Title }} {{ $title := .Title }}
@@ -121,7 +121,6 @@ button.download-button {
font-weight: bold; font-weight: bold;
color: $code-copy-button-text-color; color: $code-copy-button-text-color;
font-size: 14px; font-size: 14px;
display: block;
width: 80px; width: 80px;
line-height: 24px; line-height: 24px;
height: 24px; height: 24px;
@@ -138,6 +137,22 @@ button.download-button {
position: absolute; position: absolute;
} }
} }
//hide copy button on iPad and iPhone
button.copy-button {
@include MQ(retinaPortrait) {
display: none;
}
@include MQ(retinaLandscape) {
display: none;
}
}
button.download-button {
display: none;
@include MQ(M) {
display: block;
}
}
a[role="button"].see-code-source { a[role="button"].see-code-source {
position: absolute; position: absolute;
@@ -156,26 +171,27 @@ a[href*="bitbucket"].see-code-source:after {
display: inline-block; display: inline-block;
font-size: 1.3em; font-size: 1.3em;
color: inherit; color: inherit;
margin-left:.2em; margin-left: .2em;
} }
a[href*="github"].see-code-source:after { a[href*="github"].see-code-source:after {
content: '\f09b'; content: '\f09b';
font-family: 'FontAwesome'; font-family: 'FontAwesome';
display: inline-block; display: inline-block;
font-size: 1.3em; font-size: 1.3em;
color: inherit; color: inherit;
margin-left:.2em; margin-left: .2em;
} }
a[href*="gitlab"].see-code-source:after { a[href*="gitlab"].see-code-source:after {
content: '\f296'; content: '\f296';
font-family: 'FontAwesome'; font-family: 'FontAwesome';
display: inline-block; display: inline-block;
font-size: 1.3em; font-size: 1.3em;
color: inherit; color: inherit;
margin-left:.2em; margin-left: .2em;
} }
button.copy-button { button.copy-button {
display: none; display: none;
@include MQ(M) { @include MQ(M) {
@@ -187,14 +203,7 @@ button.copy-button {
} }
} }
button.copy-button {
@include MQ(retinaPortrait) {
display: none;
}
@include MQ(retinaLandscape) {
display: none;
}
}
div.code-copy { div.code-copy {
position: relative; position: relative;