Use example.com in examples

Avoid linking to existing domain yoursite.com.
This commit is contained in:
Bjørn Erik Pedersen
2017-07-20 21:46:10 +02:00
parent 7129213473
commit 83ff50c2e0
14 changed files with 69 additions and 69 deletions
@@ -96,8 +96,8 @@ More information about document unique identifiers and headings can be found [be
### Examples
* `{{</* ref "blog/post.md" */>}}` => `http://yoursite.com/blog/post/`
* `{{</* ref "post.md#tldr" */>}}` => `http://yoursite.com/blog/post/#tldr:caffebad`
* `{{</* ref "blog/post.md" */>}}` => `http://example.com/blog/post/`
* `{{</* ref "post.md#tldr" */>}}` => `http://example.com/blog/post/#tldr:caffebad`
* `{{</* relref "post.md" */>}}` => `/blog/post/`
* `{{</* relref "blog/post.md#tldr" */>}}` => `/blog/post/#tldr:caffebad`
* `{{</* ref "#tldr" */>}}` => `#tldr:badcaffe`
+14 -14
View File
@@ -34,20 +34,20 @@ While Hugo supports content nested at any level, the top levels (i.e. `content/<
.
└── content
└── about
| └── _index.md // <- http://yoursite.com/about/
| └── _index.md // <- http://example.com/about/
├── post
| ├── firstpost.md // <- http://yoursite.com/post/firstpost/
| ├── firstpost.md // <- http://example.com/post/firstpost/
| ├── happy
| | └── ness.md // <- http://yoursite.com/post/happy/ness/
| └── secondpost.md // <- http://yoursite.com/post/secondpost/
| | └── ness.md // <- http://example.com/post/happy/ness/
| └── secondpost.md // <- http://example.com/post/secondpost/
└── quote
├── first.md // <- http://yoursite.com/quote/first/
└── second.md // <- http://yoursite.com/quote/second/
├── first.md // <- http://example.com/quote/first/
└── second.md // <- http://example.com/quote/second/
```
## Path Breakdown in Hugo
The following demonstrates the relationships between your content organization and the output URL structure for your Hugo website when it renders. These examples assume you are [using pretty URLs][pretty], which is the default behavior for Hugo. The examples also assume a key-value of `baseurl = "http://yoursite.com"` in your [site's configuration file][config].
The following demonstrates the relationships between your content organization and the output URL structure for your Hugo website when it renders. These examples assume you are [using pretty URLs][pretty], which is the default behavior for Hugo. The examples also assume a key-value of `baseurl = "http://example.com"` in your [site's configuration file][config].
### Index Pages: `_index.md`
@@ -76,7 +76,7 @@ At build, this will output to the following destination with the associated valu
⊢--------^---------⊣⊢-^-⊣
permalink
⊢----------^-------------⊣
http://yoursite.com/posts/index.html
http://example.com/posts/index.html
```
### Single Pages in Sections
@@ -102,7 +102,7 @@ At the time Hugo builds your site, the content will be output to the following d
⊢--------^--------⊣⊢-^--⊣⊢-------^---------⊣
permalink
⊢--------------------^---------------------⊣
http://yoursite.com/posts/my-first-hugo-post/index.html
http://example.com/posts/my-first-hugo-post/index.html
```
### Section with Nested Directories
@@ -120,7 +120,7 @@ To continue the example, the following demonstrates destination paths for a file
⊢--------^--------⊣ ⊢------^-----⊣⊢----^------⊣
permalink
⊢----------------------^-----------------------⊣
http://yoursite.com/events/chicago/lollapalooza/
http://example.com/events/chicago/lollapalooza/
```
{{% note %}}
@@ -166,7 +166,7 @@ The following items are defined in this order for a specific reason: items expla
### `filename`
This isn't in the front matter, but is the actual name of the file minus the extension. This will be the name of the file in the destination (e.g., `content/posts/my-post.md` becomes `yoursite.com/posts/my-post/`).
This isn't in the front matter, but is the actual name of the file minus the extension. This will be the name of the file in the destination (e.g., `content/posts/my-post.md` becomes `example.com/posts/my-post/`).
### `slug`
@@ -182,7 +182,7 @@ slug: "new-post"
This will render to the following destination according to Hugo's default behavior:
```
yoursite.com/posts/new-post/
example.com/posts/new-post/
```
### `section`
@@ -216,10 +216,10 @@ url: /blog/new-url/
---
{{< /code >}}
Assuming your `baseURL` is [configured][config] to `https://yoursite.com`, the addition of `url` to the front matter will make `old-url.md` render to the following destination:
Assuming your `baseURL` is [configured][config] to `https://example.com`, the addition of `url` to the front matter will make `old-url.md` render to the following destination:
```
https://yoursite.com/blog/new-url/
https://example.com/blog/new-url/
```
You can see more information on how to control output paths in [URL Management][urls].
+13 -13
View File
@@ -34,21 +34,21 @@ The following example shows a content directory structure for a website that has
.
└── content
├── authors
| ├── _index.md // <- yoursite.com/authors/
| ├── john-doe.md // <- yoursite.com/authors/john-doe/
| └── jane-doe.md // <- yoursite.com/authors/jane-doe/
| ├── _index.md // <- example.com/authors/
| ├── john-doe.md // <- example.com/authors/john-doe/
| └── jane-doe.md // <- example.com/authors/jane-doe/
└── events
| ├── _index.md // <- yoursite.com/events/
| ├── event-1.md // <- yoursite.com/events/event-1/
| ├── event-2.md // <- yoursite.com/events/event-2/
| └── event-3.md // <- yoursite.com/events/event-3/
| ├── _index.md // <- example.com/events/
| ├── event-1.md // <- example.com/events/event-1/
| ├── event-2.md // <- example.com/events/event-2/
| └── event-3.md // <- example.com/events/event-3/
└── posts
| ├── _index.md // <- yoursite.com/posts/
| ├── event-1.md // <- yoursite.com/posts/event-1/
| ├── event-2.md // <- yoursite.com/posts/event-2/
| ├── event-3.md // <- yoursite.com/posts/event-3/
| ├── event-4.md // <- yoursite.com/posts/event-4/
| └── event-5.md // <- yoursite.com/posts/event-5/
| ├── _index.md // <- example.com/posts/
| ├── event-1.md // <- example.com/posts/event-1/
| ├── event-2.md // <- example.com/posts/event-2/
| ├── event-3.md // <- example.com/posts/event-3/
| ├── event-4.md // <- example.com/posts/event-4/
| └── event-5.md // <- example.com/posts/event-5/
```
## Content Section Lists
+1 -1
View File
@@ -94,7 +94,7 @@ disableKinds = ["taxonomy","taxonomyTerm"]
When taxonomies are used---and [taxonomy templates][] are provided---Hugo will automatically create both a page listing all the taxonomy's terms and individual pages with lists of content associated with each term. For example, a `categories` taxonomy declared in your your configuration and used in your content front matter will create the following pages:
* A single page at `yoursite.com/categories/` that lists all the [terms within the taxonomy][]
* A single page at `example.com/categories/` that lists all the [terms within the taxonomy][]
* [Individual taxonomy list pages][taxonomy templates] (e.g., `/categories/development/`) for each of the terms that shows a listing of all pages marked as part of that taxonomy within any content file's [front matter][]
## Configure Taxonomies
+23 -23
View File
@@ -43,7 +43,7 @@ permalinks:
post = "/:year/:month/:title/"
{{< /code >}}
Only the content under `post/` will have the new URL structure. For example, the file `content/post/sample-entry.md` with `date: 2017-02-27T19:20:00-05:00` in its front matter will render to `public/2017/02/sample-entry/index.html` at build time and therefore be reachable at `http://yoursite.com/2013/11/sample-entry/`.
Only the content under `post/` will have the new URL structure. For example, the file `content/post/sample-entry.md` with `date: 2017-02-27T19:20:00-05:00` in its front matter will render to `public/2017/02/sample-entry/index.html` at build time and therefore be reachable at `http://example.com/2013/11/sample-entry/`.
### Permalink Configuration Values
@@ -113,7 +113,7 @@ aliases:
---
{{< /code >}}
Now when you visit any of the locations specified in aliases---i.e., *assuming the same site domain*---you'll be redirected to the page they are specified on. For example, a visitor to `yoursite.com/posts/my-original-url/` will be immediately redirected to `yoursite.com/posts/my-awesome-blog-post/`.
Now when you visit any of the locations specified in aliases---i.e., *assuming the same site domain*---you'll be redirected to the page they are specified on. For example, a visitor to `example.com/posts/my-original-url/` will be immediately redirected to `example.com/posts/my-awesome-blog-post/`.
### Example: Aliases in Multilingual
@@ -141,22 +141,22 @@ aliases: [/posts/my-old-url/]
---
```
Assuming a `baseURL` of `yoursite.com`, the contents of the auto-generated alias `.html` found at `https://yoursite.com/posts/my-old-url/ will contain the following:`
Assuming a `baseURL` of `example.com`, the contents of the auto-generated alias `.html` found at `https://example.com/posts/my-old-url/ will contain the following:`
```
<!DOCTYPE html>
<html>
<head>
<title>http://yoursite.com/posts/my-intended-url</title>
<link rel="canonical" href="http://yoursite.com/posts/my-intended-url"/>
<title>http://example.com/posts/my-intended-url</title>
<link rel="canonical" href="http://example.com/posts/my-intended-url"/>
<meta name=\"robots\" content=\"noindex\">
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta http-equiv="refresh" content="0; url=http://yoursite.com/posts/my-intended-url"/>
<meta http-equiv="refresh" content="0; url=http://example.com/posts/my-intended-url"/>
</head>
</html>
```
The `http-equiv="refresh"` line is what performs the redirect, in 0 seconds in this case. If an end user of your website goes to `https://yoursite.com/posts/my-old-url`, they will now be automatically redirected to the newer, correct URL. The addition of `<meta name=\"robots\" content=\"noindex\">` lets search engine bots know they they should not crawl and index your new alias page.
The `http-equiv="refresh"` line is what performs the redirect, in 0 seconds in this case. If an end user of your website goes to `https://example.com/posts/my-old-url`, they will now be automatically redirected to the newer, correct URL. The addition of `<meta name=\"robots\" content=\"noindex\">` lets search engine bots know they they should not crawl and index your new alias page.
### Customize
You may customize this alias page by creating an `alias.html` template in the
@@ -183,14 +183,14 @@ The following demonstrates the concept:
```
content/posts/_index.md
=> yoursite.com/posts/index.html
=> example.com/posts/index.html
content/posts/post-1.md
=> yoursite.com/posts/post-1/
=> example.com/posts/post-1/
```
## Ugly URLs
If you would like to have are often referred to as "ugly URLs" (e.g., yoursite.com/urls.html), set `uglyurls = true` or `uglyurls: true` in your site's `config.toml` or `config.yaml`, respectively. You can also use the `--uglyURLs=true` [flag from the command line][usage] with `hugo` or `hugo server`..
If you would like to have are often referred to as "ugly URLs" (e.g., example.com/urls.html), set `uglyurls = true` or `uglyurls: true` in your site's `config.toml` or `config.yaml`, respectively. You can also use the `--uglyURLs=true` [flag from the command line][usage] with `hugo` or `hugo server`..
If you want a specific piece of content to have an exact URL, you can specify this in the [front matter][] under the `url` key. The following are examples of the same content directory and what the eventual URL structure will be when Hugo runs with its default behavior.
@@ -200,15 +200,15 @@ See [Content Organization][contentorg] for more details on paths.
.
└── content
└── about
| └── _index.md // <- http://yoursite.com/about/
| └── _index.md // <- http://example.com/about/
├── post
| ├── firstpost.md // <- http://yoursite.com/post/firstpost/
| ├── firstpost.md // <- http://example.com/post/firstpost/
| ├── happy
| | └── ness.md // <- http://yoursite.com/post/happy/ness/
| └── secondpost.md // <- http://yoursite.com/post/secondpost/
| | └── ness.md // <- http://example.com/post/happy/ness/
| └── secondpost.md // <- http://example.com/post/secondpost/
└── quote
├── first.md // <- http://yoursite.com/quote/first/
└── second.md // <- http://yoursite.com/quote/second/
├── first.md // <- http://example.com/quote/first/
└── second.md // <- http://example.com/quote/second/
```
Here's the same organization run with `hugo --uglyURLs`:
@@ -217,15 +217,15 @@ Here's the same organization run with `hugo --uglyURLs`:
.
└── content
└── about
| └── _index.md // <- http://yoursite.com/about/index.html
| └── _index.md // <- http://example.com/about/index.html
├── post
| ├── firstpost.md // <- http://yoursite.com/post/firstpost.html
| ├── firstpost.md // <- http://example.com/post/firstpost.html
| ├── happy
| | └── ness.md // <- http://yoursite.com/post/happy/ness.html
| └── secondpost.md // <- http://yoursite.com/post/secondpost.html
| | └── ness.md // <- http://example.com/post/happy/ness.html
| └── secondpost.md // <- http://example.com/post/secondpost.html
└── quote
├── first.md // <- http://yoursite.com/quote/first.html
└── second.md // <- http://yoursite.com/quote/second.html
├── first.md // <- http://example.com/quote/first.html
└── second.md // <- http://example.com/quote/second.html
```
@@ -233,7 +233,7 @@ Here's the same organization run with `hugo --uglyURLs`:
By default, all relative URLs encountered in the input are left unmodified, e.g. `/css/foo.css` would stay as `/css/foo.css`. The `canonifyURLs` field in your site `config` has a default value of `false`.
By setting `canonifyURLs` to `true`, all relative URLs would instead be *canonicalized* using `baseURL`. For example, assuming you have `baseURL = https://yoursite.com/`, the relative URL `/css/foo.css` would be turned into the absolute URL `http://yoursite.com/css/foo.css`.
By setting `canonifyURLs` to `true`, all relative URLs would instead be *canonicalized* using `baseURL`. For example, assuming you have `baseURL = https://example.com/`, the relative URL `/css/foo.css` would be turned into the absolute URL `http://example.com/css/foo.css`.
Benefits of canonicalization include fixing all URLs to be absolute, which may aid with some parsing tasks. Note, however, that all modern browsers handle this on the client without issue.
+1 -1
View File
@@ -64,7 +64,7 @@ name = ""
license = "MIT"
licenselink = "https://github.com/<YOURNAME>/<YOURTHEME>/blob/master/LICENSE.md"
description = ""
homepage = "http://yoursite.com/"
homepage = "http://example.com/"
tags = []
features = []
min_version = 0.19
+2 -2
View File
@@ -20,9 +20,9 @@ aliases: []
Both `absLangURL` and [`relLangURL`](/functions/rellangurl/) are similar to their [`absURL`](/functions/absurl/) and [`relURL`](/functions/relurl) relatives but will add the correct language prefix when the site is configured with more than one language.
So for a site `baseURL` set to `http://yoursite.com/hugo/` and the current language is `en`:
So for a site `baseURL` set to `http://example.com/hugo/` and the current language is `en`:
```
{{ "blog/" | absLangURL }} → "http://yoursite.com/hugo/en/blog/"
{{ "blog/" | absLangURL }} → "http://example.com/hugo/en/blog/"
{{ "blog/" | relLangURL }} → "/hugo/en/blog/"
```
+2 -2
View File
@@ -18,10 +18,10 @@ deprecated: false
aliases: []
---
Both `absURL` and `relURL` consider the configured value of `baseURL` in your site's [`config` file][configuration]. Given a `baseURL` set to `http://yoursite.com/hugo/`:
Both `absURL` and `relURL` consider the configured value of `baseURL` in your site's [`config` file][configuration]. Given a `baseURL` set to `http://example.com/hugo/`:
```
{{ "mystyle.css" | absURL }} → "http://yoursite.com/hugo/mystyle.css"
{{ "mystyle.css" | absURL }} → "http://example.com/hugo/mystyle.css"
{{ "mystyle.css" | relURL }} → "/hugo/mystyle.css"
{{ "http://gohugo.io/" | relURL }} → "http://gohugo.io/"
{{ "http://gohugo.io/" | absURL }} → "http://gohugo.io/"
+1 -1
View File
@@ -30,7 +30,7 @@ The following shows `after` being used in conjunction with the [`slice` function
## Example of `after` with `first`: 2nd&ndash;4th Most Recent Articles
You can use `after` in combination with the [`first` function][] and Hugo's [powerful sorting methods][lists]. Let's assume you have a list page at `yoursite.com/articles`. You have 10 articles, but you want your templating for the [list/section page][] to show only two rows:
You can use `after` in combination with the [`first` function][] and Hugo's [powerful sorting methods][lists]. Let's assume you have a list page at `example.com/articles`. You have 10 articles, but you want your templating for the [list/section page][] to show only two rows:
1. The top row is titled "Featured" and shows only the most recently published article (i.e. by `publishdate` in the content files' front matter).
2. The second row is titled "Recent Articles" and shows only the 2nd- to 4th-most recently published articles.
+1 -1
View File
@@ -38,7 +38,7 @@ You can also use the `add` function with strings. You may like this functionalit
For example, social media sharing with [Twitter Cards][cards] requires the following `meta` link in your site's `<head>` to display Twitter's ["Summary Card with Large Image"][twtsummary]:
```
<meta name="twitter:image" content="http://yoursite.com/images/my-twitter-image.jpg">
<meta name="twitter:image" content="http://example.com/images/my-twitter-image.jpg">
```
Let's assume you have an `image` field in the front matter of each of your content files:
+2 -2
View File
@@ -20,10 +20,10 @@ aliases: []
`absLangURL` and `relLangURL` functions are similar to their [`absURL`](/functions/absurl/) and [`relURL`](/functions/relurl/) relatives but will add the correct language prefix when the site is configured with more than one language. (See [Configuring Multilingual][multiliconfig].)
So for a site `baseURL` set to `http://yoursite.com/hugo/` and the current language is `en`:
So for a site `baseURL` set to `http://example.com/hugo/` and the current language is `en`:
```
{{ "blog/" | absLangURL }} → "http://yoursite.com/hugo/en/blog/"
{{ "blog/" | absLangURL }} → "http://example.com/hugo/en/blog/"
{{ "blog/" | relLangURL }} → "/hugo/en/blog/"
```
+2 -2
View File
@@ -18,10 +18,10 @@ deprecated: false
aliases: []
---
Both `absURL` and `relURL` consider the configured value of `baseURL` in your site's [`config` file][configuration]. Given a `baseURL` set to `http://yoursite.com/hugo/`:
Both `absURL` and `relURL` consider the configured value of `baseURL` in your site's [`config` file][configuration]. Given a `baseURL` set to `http://example.com/hugo/`:
```
{{ "mystyle.css" | absURL }} → "http://yoursite.com/hugo/mystyle.css"
{{ "mystyle.css" | absURL }} → "http://example.com/hugo/mystyle.css"
{{ "mystyle.css" | relURL }} → "/hugo/mystyle.css"
{{ "http://gohugo.io/" | relURL }} → "http://gohugo.io/"
{{ "http://gohugo.io/" | absURL }} → "http://gohugo.io/"
+4 -4
View File
@@ -117,7 +117,7 @@ You can now access this `_index.md`'s' content in your list template:
This above will output the following HTML:
{{< code file="yoursite.com/post/index.html" copy="false" >}}
{{< code file="example.com/post/index.html" copy="false" >}}
<!--top of your baseof code-->
<main>
<article>
@@ -141,7 +141,7 @@ You do *not* have to create an `_index.md` file for every list page (i.e. sectio
Using this same `layouts/_default/list.html` template and applying it to the the `quotes` section above will render the following output. Note that `quotes` does not have an `_index.md` file to pull from:
{{< code file="yoursite.com/quote/index.html" copy="false" >}}
{{< code file="example.com/quote/index.html" copy="false" >}}
<!--baseof-->
<main>
<article>
@@ -151,8 +151,8 @@ Using this same `layouts/_default/list.html` template and applying it to the the
</header>
</article>
<ul>
<li><a href="https://yoursite.com/quote/quotes-01/">Quote 1</a></li>
<li><a href="https://yoursite.com/quote/quotes-02/">Quote 2</a></li>
<li><a href="https://example.com/quote/quotes-01/">Quote 1</a></li>
<li><a href="https://example.com/quote/quotes-02/">Quote 2</a></li>
</ul>
</main>
<!--baseof-->
+1 -1
View File
@@ -48,7 +48,7 @@ A taxonomy will be rendered at /`PLURAL`/`TERM`/ (e.g., http://spf13.com/topics/
### Taxonomy Terms Templates Lookup Order
A taxonomy terms page will be rendered at `yoursite.com/<PLURALTAXONOMYNAME>`/ (e.g., http://spf13.com/topics/) according to the following lookup order:
A taxonomy terms page will be rendered at `example.com/<PLURALTAXONOMYNAME>`/ (e.g., http://spf13.com/topics/) according to the following lookup order:
1. `/layouts/taxonomy/<SINGULAR>.terms.html`
2. `/layouts/_default/terms.html`