Skip to content

Commit

Permalink
Namespace all functions and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring committed Nov 3, 2023
1 parent 4021277 commit 9544eec
Show file tree
Hide file tree
Showing 678 changed files with 19,658 additions and 5,762 deletions.
5 changes: 3 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
"مدونتي"
],
"language": "en,en-US,de,fr",
"allowCompoundWords": true,
"allowCompoundWords": false,
"files": [
"**/*.md"
],
Expand All @@ -354,7 +354,8 @@
"**/node_modules/**",
"*.min.*",
"**/news/*",
"**/showcase/*"
"**/showcase/*",
"**/content-management/emoji-shortcodes.md"
],
"useGitignore": true,
"enabled": true
Expand Down
393 changes: 200 additions & 193 deletions LICENSE.md

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ Spelling fixes are most welcomed, and if you want to contribute longer sections
* For example, try to find short snippets that teaches people about the concept. If the example is also useful as-is (copy and paste), then great. Don't list long and similar examples just so people can use them on their sites.
* Hugo has users from all over the world, so easy to understand and [simple English](https://simple.wikipedia.org/wiki/Basic_English) is good.


## Edit the theme

If you want to do docs-related theme changes, the simplest way is to have both `hugoDocs` and `gohugoioTheme` cloned as sibling directories, and then run:

```
```sh
HUGO_MODULE_WORKSPACE=hugo.work hugo server --ignoreVendorPaths "**"
```

Expand All @@ -37,15 +36,15 @@ HUGO_MODULE_WORKSPACE=hugo.work hugo server --ignoreVendorPaths "**"

To view the documentation site locally, you need to clone this repository:

```bash
```sh
git clone https://github.com/gohugoio/hugoDocs.git
```

Also note that the documentation version for a given version of Hugo can also be found in the `/docs` sub-folder of the [Hugo source repository](https://github.com/gohugoio/hugo).

Then to view the docs in your browser, run Hugo and open up the link:

```bash
```sh
▶ hugo server

Started building sites ...
Expand Down
9 changes: 3 additions & 6 deletions archetypes/functions.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: {{ replace .File.ContentBaseName "-" " " | title }}
description:
categories: [functions]
categories: []
keywords: []
menu:
docs:
parent: functions
function:
action:
aliases: []
related: []
returnType:
signatures: []
relatedFunctions: []
---
10 changes: 10 additions & 0 deletions archetypes/methods.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: {{ replace .File.ContentBaseName "-" " " | title }}
description:
categories: []
keywords: []
action:
related: []
returnType:
signatures: []
---
5 changes: 2 additions & 3 deletions archetypes/showcase/bio.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ Add some **general info** about {{ replace .Name "-" " " | title }} here.

The site is built by:

* [Person 1](https://example.com)
* [Person 1](https://example.com)

* [Person 1](https://example.org)
* [Person 1](https://example.org)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/examples/zion-national-park.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/logos/logo-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/logos/logo-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/logos/logo-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/logos/logo-64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/logos/logo-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion config/_default/menus/menus.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@
url = "/functions/"

[[docs]]
name = "Variables"
name = "Methods"
weight = 80
identifier = "methods"
url = "/methods/"

[[docs]]
name = "Variables"
weight = 85
identifier = "variables"
url = "/variables/"

Expand Down
3 changes: 3 additions & 0 deletions config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ flex_box_interior_classes = "flex-auto w-100 w-40-l mr3 mb3 bg-white ba b--moon-

[social]
twitter = "GoHugoIO"

[render_hooks.link]
errorLevel = 'warning' # ignore (default), warning, or error (fails the build)
8 changes: 4 additions & 4 deletions content/en/about/hugo-and-gdpr.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ toc: true

Below are all privacy settings and their default value. These settings need to be put in your site configuration (e.g. `hugo.toml`).

{{< code-toggle file="hugo" >}}
{{< code-toggle file=hugo >}}
[privacy]
[privacy.disqus]
disable = false
Expand Down Expand Up @@ -58,7 +58,7 @@ privacyEnhanced = false

An example privacy configuration that disables all the relevant services in Hugo. With this configuration, the other settings will not matter.

{{< code-toggle file="hugo" >}}
{{< code-toggle file=hugo >}}
[privacy]
[privacy.disqus]
disable = true
Expand Down Expand Up @@ -98,7 +98,7 @@ simple

**Note:** If you use the _simple mode_ for Instagram and a site styled with Bootstrap 4, you may want to disable the inline styles provided by Hugo:

{{< code-toggle file="hugo" >}}
{{< code-toggle file=hugo >}}
[services]
[services.instagram]
disableInlineCSS = true
Expand All @@ -114,7 +114,7 @@ simple

**Note:** If you use the _simple mode_ for Twitter, you may want to disable the inline styles provided by Hugo:

{{< code-toggle file="hugo" >}}
{{< code-toggle file=hugo >}}
[services]
[services.twitter]
disableInlineCSS = true
Expand Down
184 changes: 52 additions & 132 deletions content/en/about/license.md

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions content/en/content-management/_common/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
cascade:
_build:
list: never
publishResources: false
render: never
---

<!--
Files within this headless branch bundle are markdown snippets. Each file must contain front matter delimiters, though front matter fields are not required.
Include the rendered content using the "include" shortcode.
-->
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
---
# Do not remove front matter.
---

| Kind | Description | Example |
|----------------|--------------------------------------------------------------------|-------------------------------------------------------------------------------|
| `home` | The landing page for the home page | `/index.html` |
| `page` | The landing page for a given page | `my-post` page (`/posts/my-post/index.html`) |
| `section` | The landing page of a given section | `posts` section (`/posts/index.html`) |
| `taxonomy` | The landing page for a taxonomy | `tags` taxonomy (`/tags/index.html`) |
| `term` | The landing page for one taxonomy's term | term `awesome` in `tags` taxonomy (`/tags/awesome/index.html`) |

Four other page kinds unrelated to content are `robotsTXT`, `RSS`, `sitemap`, and `404`. Although primarily for internal use, you can specify the name when disabling one or more page kinds on your site. For example:

{{< code-toggle file=hugo >}}
disableKinds = ['robotsTXT','404']
{{< /code-toggle >}}
27 changes: 13 additions & 14 deletions content/en/content-management/archetypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ A content file consists of [front matter] and markup. The markup is typically ma

The `hugo new content` command creates a new file in the `content` directory, using an archetype as a template. This is the default archetype:

{{< code-toggle file="archetypes/default.md" copy=false fm=true >}}
{{< code-toggle file="archetypes/default.md" fm=true >}}
title = '{{ replace .File.ContentBaseName `-` ` ` | title }}'
date = '{{ .Date }}'
draft = true
{{< /code-toggle >}}

When you create new content, Hugo evaluates the [template actions] within the archetype. For example:

```text
```sh
hugo new content posts/my-first-post.md
```

With the default archetype shown above, Hugo creates this content file:

{{< code-toggle file="content/posts/my-first-post.md" copy=false fm=true >}}
{{< code-toggle file="content/posts/my-first-post.md" fm=true >}}
title = 'My First Post'
date = '2023-08-24T11:49:46-07:00'
draft = true
Expand All @@ -53,7 +53,7 @@ Hugo looks for archetypes in the `archetypes` directory in the root of your proj

For example, with this command:

```text
```sh
hugo new content posts/my-first-post.md
```

Expand All @@ -75,7 +75,7 @@ Archetypes receive the following objects and values in [context]:
- `.Date`
- `.Type`
- `.Site` (see [details](/variables/site/))
- `.File` (see [details](/variables/files/))
- `.File` (see [details](/variables/file/))

As shown above, the default archetype passes `.File.ContentBaseName` as the argument to the `replace` function when populating the title in front matter.

Expand All @@ -85,8 +85,7 @@ Although typically used as a front matter template, you can also use an archetyp

For example, in a documentation site you might have a section (content type) for functions. Every page within this section should follow the same format: a brief description, the function signature, examples, and notes. We can pre-populate the page to remind content authors of the standard format.


{{< code file="archetypes/functions.md" copy=false >}}
{{< code file="archetypes/functions.md" >}}
---
date: '{{ .Date }}'
draft: true
Expand Down Expand Up @@ -125,17 +124,17 @@ Create an archetype for galleries:
```text
archetypes/
├── galleries/
   ├── images/
   │   └── .gitkeep
   └── index.md <-- same format as default.md
├── images/
└── .gitkeep
└── index.md <-- same format as default.md
└── default.md
```

Subdirectories within an archetype must contain at least one file. Without a file, Hugo will not create the subdirectory when you create new content. The name and size of the file are irrelevant. The example above includes a&nbsp;`.gitkeep` file, an empty file commonly used to preserve otherwise empty directories in a Git repository.


To create a new gallery:
```text

```sh
hugo new galleries/bryce-canyon
```

Expand Down Expand Up @@ -166,13 +165,13 @@ archetypes/

To create an article using the articles archetype:

```text
```sh
hugo new content articles/something.md
```

To create an article using the tutorials archetype:

```text
```sh
hugo new content --kind tutorials articles/something.md
```

Expand Down
8 changes: 4 additions & 4 deletions content/en/content-management/build-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ If set to `true` (default) the [Bundle's Resources](/content-management/page-bun
Setting this to `false` will still publish Resources on demand (when a resource's `.Permalink` or `.RelPermalink` is invoked from the templates) but will skip the others.

{{% note %}}
Any page, regardless of their build options, will always be available using the [`.GetPage`](/functions/getpage) methods.
Any page, regardless of their build options, will always be available using the [`.GetPage`](/methods/page/getpage) methods.
{{% /note %}}

### Illustrative use cases
Expand All @@ -60,14 +60,14 @@ Any page, regardless of their build options, will always be available using the

Project needs a "Who We Are" content file for front matter and body to be used by the homepage but nowhere else.

{{< code-toggle file="content/who-we-are.md" fm=true copy=false >}}
{{< code-toggle file="content/who-we-are.md" fm=true >}}
title: Who we are
_build:
list: false
render: false
{{< /code-toggle >}}

{{< code file="layouts/index.html" copy=false >}}
{{< code file="layouts/index.html" >}}
<section id="who-we-are">
{{ with site.GetPage "who-we-are" }}
{{ .Content }}
Expand All @@ -91,7 +91,7 @@ cascade:
list: true # default
{{< /code-toggle >}}

{{< code file="layouts/_defaults/testimonials.html" copy=false >}}
{{< code file="layouts/_defaults/testimonials.html" >}}
<section id="testimonials">
{{ range first 5 .Pages }}
<blockquote cite="{{ .Params.cite }}">
Expand Down
5 changes: 2 additions & 3 deletions content/en/content-management/comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ Hugo comes with all the code you need to load Disqus into your templates. Before

Disqus comments require you set a single value in your [site's configuration file][configuration] like so:

{{< code-toggle file="hugo" >}}
[services.disqus]
shortname = 'your-disqus-shortname'
{{< code-toggle file=hugo >}}
disqusShortname = "yourDisqusShortname"
{{</ code-toggle >}}

For many websites, this is enough configuration. However, you also have the option to set the following in the [front matter] of a single content file:
Expand Down
4 changes: 1 addition & 3 deletions content/en/content-management/cross-references.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ The `ref` and `relref` shortcodes require a single parameter: the path to a cont

The pages can be referenced as follows:


```text
{{</* ref "document2" */>}} // <- From pages/document1.md, relative path
{{</* ref "document2#anchor" */>}}
Expand Down Expand Up @@ -138,15 +137,14 @@ produces this HTML:

## Ref and RelRef Configuration

The behavior can, since Hugo 0.45, be configured in `hugo.toml`:
The behavior can be configured in `hugo.toml`:

refLinksErrorLevel ("ERROR")
: When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this log level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`).

refLinksNotFoundURL
: URL to be used as a placeholder when a page reference cannot be found in `ref` or `relref`. Is used as-is.


[lists]: /templates/lists/
[output formats]: /templates/output-formats/
[shortcode]: /content-management/shortcodes/
3 changes: 0 additions & 3 deletions content/en/content-management/diagrams.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ Created from <https://arthursonzogni.com/Diagon/#Tree>
└─Fedora
```


### Sequence diagram

<https://arthursonzogni.com/Diagon/#Sequence>
Expand All @@ -186,7 +185,6 @@ Created from <https://arthursonzogni.com/Diagon/#Tree>
```


### Flowchart

<https://arthursonzogni.com/Diagon/#Flowchart>
Expand Down Expand Up @@ -232,7 +230,6 @@ Created from <https://arthursonzogni.com/Diagon/#Tree>
```


### Table

<https://arthursonzogni.com/Diagon/#Table>
Expand Down
Loading

0 comments on commit 9544eec

Please sign in to comment.