From a1b2fd3bdcdd42871721a24614e6fe442594aa57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 20 Jul 2017 08:28:53 +0200 Subject: [PATCH] Remove the code fence language codes See #61 --- content/content-management/archetypes.md | 20 ++--- content/content-management/authors.md | 16 ++-- content/content-management/comments.md | 4 +- .../content-management/cross-references.md | 16 ++-- content/content-management/formats.md | 12 +-- content/content-management/front-matter.md | 8 +- content/content-management/menus.md | 10 +-- content/content-management/multilingual.md | 14 ++-- content/content-management/organization.md | 16 ++-- content/content-management/sections.md | 2 +- content/content-management/shortcodes.md | 58 +++++++-------- content/content-management/summaries.md | 2 +- content/content-management/taxonomies.md | 16 ++-- content/content-management/toc.md | 6 +- content/content-management/types.md | 2 +- content/content-management/urls.md | 22 +++--- content/contribute/development.md | 54 +++++++------- content/contribute/documentation.md | 50 ++++++------- content/contribute/themes.md | 6 +- content/functions/GetPage.md | 2 +- content/functions/abslangurl.md | 2 +- content/functions/absurl.md | 4 +- content/functions/adddate.md | 4 +- content/functions/after.md | 4 +- content/functions/apply.md | 14 ++-- content/functions/base64.md | 6 +- content/functions/chomp.md | 2 +- content/functions/countrunes.md | 2 +- content/functions/countwords.md | 2 +- content/functions/default.md | 14 ++-- content/functions/delimit.md | 10 +-- content/functions/dict.md | 4 +- content/functions/findRe.md | 2 +- content/functions/first.md | 2 +- content/functions/format.md | 2 +- content/functions/i18n.md | 2 +- content/functions/imageConfig.md | 2 +- content/functions/index-function.md | 8 +- content/functions/intersect.md | 4 +- content/functions/len.md | 4 +- content/functions/math.md | 6 +- content/functions/md5.md | 4 +- content/functions/now.md | 4 +- content/functions/partialCached.md | 2 +- content/functions/printf.md | 2 +- content/functions/querify.md | 4 +- content/functions/readfile.md | 2 +- content/functions/ref.md | 2 +- content/functions/relLangURL.md | 2 +- content/functions/relref.md | 2 +- content/functions/relurl.md | 4 +- content/functions/render.md | 2 +- content/functions/replacere.md | 2 +- content/functions/safeHTML.md | 6 +- content/functions/safeHTMLAttr.md | 2 +- content/functions/safeURL.md | 10 +-- content/functions/seq.md | 4 +- content/functions/sha.md | 4 +- content/functions/shuffle.md | 4 +- content/functions/slice.md | 2 +- content/functions/sort.md | 2 +- content/functions/time.md | 2 +- content/functions/union.md | 4 +- content/functions/uniq.md | 2 +- content/functions/unix.md | 2 +- content/functions/urlize.md | 6 +- content/functions/where.md | 18 ++--- content/functions/with.md | 2 +- content/getting-started/configuration.md | 18 ++--- .../getting-started/directory-structure.md | 2 +- content/getting-started/installing.md | 46 ++++++------ content/getting-started/quick-start.md | 72 +++++++++--------- content/getting-started/usage.md | 20 ++--- .../deployment-with-rsync.md | 12 +-- .../deployment-with-wercker.md | 28 +++---- .../hosting-on-bitbucket.md | 12 +-- .../hosting-on-firebase.md | 12 +-- .../hosting-on-github.md | 18 ++--- .../hosting-on-gitlab.md | 6 +- .../hosting-on-netlify.md | 4 +- content/news/0-22-1.md | 4 +- content/news/0-22.md | 2 +- content/news/0-24.md | 4 +- content/news/0-25.md | 2 +- content/news/release-notes.md | 8 +- content/templates/404.md | 4 +- content/templates/alternatives.md | 2 +- content/templates/base.md | 8 +- content/templates/data-templates.md | 12 +-- content/templates/files.md | 10 +-- content/templates/homepage.md | 2 +- content/templates/internal.md | 18 ++--- content/templates/introduction.md | 74 +++++++++---------- content/templates/lists.md | 66 ++++++++--------- content/templates/lookup-order.md | 8 +- content/templates/menu-templates.md | 8 +- content/templates/ordering-and-grouping.md | 54 +++++++------- content/templates/output-formats.md | 10 +-- content/templates/pagination.md | 6 +- content/templates/partials.md | 6 +- content/templates/robots.md | 4 +- content/templates/rss.md | 10 +-- content/templates/section-templates.md | 12 +-- content/templates/shortcode-templates.md | 50 ++++++------- content/templates/single-page-templates.md | 2 +- content/templates/sitemap-template.md | 4 +- content/templates/taxonomy-templates.md | 24 +++--- content/templates/template-debugging.md | 12 +-- content/templates/views.md | 8 +- content/themes/creating.md | 2 +- content/themes/customizing.md | 8 +- content/themes/installing-and-using-themes.md | 12 +-- content/tools/syntax-highlighting.md | 18 ++--- .../accented-characters-in-urls.md | 2 +- content/troubleshooting/eof-error.md | 2 +- content/variables/page.md | 14 ++-- content/variables/site.md | 4 +- content/variables/taxonomy.md | 2 +- 118 files changed, 643 insertions(+), 643 deletions(-) diff --git a/content/content-management/archetypes.md b/content/content-management/archetypes.md index d6d30b3f3..1c473b6b7 100644 --- a/content/content-management/archetypes.md +++ b/content/content-management/archetypes.md @@ -31,14 +31,14 @@ See above The `hugo new` generator for archetypes assumes your working directory is the content folder at the root of your project. Hugo is able to infer the appropriate archetype by assuming the content type from the content section passed to the CLI command: -```bash +``` hugo new / ``` We can use this pattern to create a new `.md` file in the `posts` section: {{% code file="archetype-example.sh" %}} -```bash +``` hugo new posts/my-first-post.md ``` {{% /code %}} @@ -50,7 +50,7 @@ To override the content type Hugo infers from `[content-section]`, add the `--ki Running this command in a new site that does not have default or custom archetypes will create the following file: {{% output file="content/posts/my-first-post.md" %}} -```toml +``` +++ date = "2017-02-01T19:20:04-07:00" title = "my first post" @@ -101,7 +101,7 @@ When you create a new Hugo project using `hugo new site`, you'll notice that Hug The following examples are from a site that's 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" %}} -```toml +``` +++ tags = ["golang", "hugo"] categories = ["web development"] @@ -118,7 +118,7 @@ If you get an `EOF error` when using `hugo new`, add a carriage return after the With an `archetypes/default.md` in place, we can use the CLI to create a new post in the `posts` content section: {{% code file="new-post-from-default.sh" %}} -```bash +``` $ hugo new posts/my-new-post.md ``` {{% /code %}} @@ -126,7 +126,7 @@ $ hugo new posts/my-new-post.md Hugo then creates a new markdown file with the following front matter: {{% output file="content/posts/my-new-post.md" %}} -```toml +``` +++ categories = ["web development"] date = "2017-02-01T19:20:04-07:00" @@ -149,7 +149,7 @@ Suppose your site's `posts` section requires more sophisticated front matter tha ### Create a Custom Archetype {{% code file="archetypes/posts.md"%}} -```toml +``` +++ description = "" tags = "" @@ -163,7 +163,7 @@ categories = "" With an `archetypes/posts.md` in place, you can use the Hugo CLI to create a new post with your preconfigured front matter in the `posts` content section: {{% code file="new-post-from-custom.sh" %}} -```bash +``` $ hugo new posts/post-from-custom.md ``` {{% /code %}} @@ -171,7 +171,7 @@ $ hugo new posts/post-from-custom.md This time, Hugo recognizes our custom `archetypes/posts.md` archetype and uses it instead of `archetypes/default.md`. The generated file will now include the full list of front matter parameters, as well as the base archetype's `title` and `date`: {{% output file="content/posts/post-from-custom-archetype.md" %}} -```toml +``` +++ categories = "" date = 2017-02-13T17:24:43-08:00 @@ -187,7 +187,7 @@ title = "post from custom archetype" As an example of archetypes in practice, the following is the `functions` archetype from the Hugo docs: {{% code file="archetypes/functions.md" %}} -```yaml +``` {{< readfile file="/themes/gohugoioTheme/archetypes/functions.md" >}} ``` {{% /code %}} diff --git a/content/content-management/authors.md b/content/content-management/authors.md index 80a783912..85606df81 100644 --- a/content/content-management/authors.md +++ b/content/content-management/authors.md @@ -31,7 +31,7 @@ You can create a profile containing metadata for each author on your website. Th Let's suppose Alice Allison is a blogger. A simple unique identifier would be `alice`. Now, we have to create a file called `alice.toml` in the `data/_authors/` directory. The following example is the standardized template written in TOML: {{% code file="data/_authors/alice.toml" %}} -```toml +``` givenName = "Alice" # or firstName as alias familyName = "Allison" # or lastName as alias displayName = "Alice Allison" @@ -67,7 +67,7 @@ The `params` section can contain arbitrary data much like the same-named section Earlier it was mentioned that content can be associated with an author through their corresponding identifier. In our case, blogger Alice has the identifier `alice`. In the front matter of a content file, you can create a list of identifiers and assign it to the `authors` variable. Here are examples for `alice` using YAML and TOML, respectively. -```yaml +``` --- title: Why Hugo is so Awesome date: 2016-08-22T14:27:502:00 @@ -77,7 +77,7 @@ authors: ["alice"] Nothing to read here. Move along... ``` -```toml +``` +++ title = Why Hugo is so Awesome date = "2016-08-22T14:27:502:00" @@ -117,7 +117,7 @@ This is can be done with the `.Social.URL` function. Its only parameter is the n Most articles feature a small section with information about the author at the end. Let's create one containing the author's name, a thumbnail, a (summarized) biography and links to all social networks: {{% code file="layouts/partials/author-info.html" download="author-info.html" %}} -```html +``` {{ with .Author }}

{{ .DisplayName }}

{{ .DisplayName }} @@ -137,12 +137,12 @@ That question can be answered with a list of all authors and another list contai In order to let Hugo know that we want to group content based on their author, we have to create a new taxonomy called `author` (the name corresponds to the variable in the front matter). Here is the snippet in a `config.yaml` and `config.toml`, respectively: -```yaml +``` taxonomies: author: authors ``` -```toml +``` [taxonomies] author = "authors" ``` @@ -153,7 +153,7 @@ taxonomies: In the next step we can create a template to list all authors of your website. Later, the list can be accessed at `www.example.com/authors/`. Create a new template in the `layouts/taxonomy/` directory called `authors.term.html`. This template will be exclusively used for this taxonomy. {{% code file="layouts/taxonomy/author.term.html" download="author.term.html" %}} -```html +```
    {{ range $author, $v := .Data.Terms }} {{ $profile := $.Authors.Get $author }} @@ -176,7 +176,7 @@ Last but not least, we have to create the second list that contains all publicat The layout for this page can be defined in the template `layouts/taxonomy/author.html`. {{% code file="layouts/taxonomy/author.html" download="author.html" %}} -```html +``` {{ range .Data.Pages }}

    {{ .Title }}

    written by {{ .Author.DisplayName }} diff --git a/content/content-management/comments.md b/content/content-management/comments.md index 33387e570..2db449738 100644 --- a/content/content-management/comments.md +++ b/content/content-management/comments.md @@ -29,11 +29,11 @@ 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]. The following show the configuration variable in a `config.toml` and `config.yml`, respectively: -```toml +``` disqusShortname = "yourdiscussshortname" ``` -```yaml +``` disqusShortname: "yourdiscussshortname" ``` diff --git a/content/content-management/cross-references.md b/content/content-management/cross-references.md index 9a2795330..acecc56d3 100644 --- a/content/content-management/cross-references.md +++ b/content/content-management/cross-references.md @@ -20,7 +20,7 @@ toc: true ## Use `ref` and `relref` -```md +``` {{}} {{}} {{}} @@ -35,14 +35,14 @@ The single parameter to `ref` is a string with a content `documentname` (e.g., ` The `documentname` is the name of a document, including the format extension; this may be just the filename, or the relative path from the `content/` directory. With a document `content/blog/post.md`, either format will produce the same result: -```md +``` {{}} => `/blog/post/` {{}} => `/blog/post/` ``` If you have the same filename used across multiple sections, you should only use the relative path format; otherwise, the behavior will be `undefined`. This is best illustrated with an example `content` directory: -```bash +``` . └── content ├── events @@ -58,7 +58,7 @@ If you have the same filename used across multiple sections, you should only use To be sure to get the correct reference in this case, use the full path: {{% code file="content/meta/my-article.md" copy="false" %}} -```md +``` {{}} => /events/my-birthday/ ``` {{% /code %}} @@ -66,7 +66,7 @@ To be sure to get the correct reference in this case, use the full path: {{< todo >}}Remove this warning when https://github.com/gohugoio/hugo/issues/3703 is released.{{< /todo >}} A relative document name must *not* begin with a slash (`/`). -```md +``` {{}} => "" ``` @@ -82,14 +82,14 @@ If the page exists in multiple [output formats][], `ref` or `relref` can be used When an `anchor` is provided by itself, the current page’s unique identifier will be appended; when an `anchor` is provided appended to `documentname`, the found page's unique identifier will be appended: -```md +``` {{}} => #anchors:9decaf7 {{}} => /blog/post/#who:badcafe ``` The above examples render as follows for this very page as well as a reference to the "Content" heading in the Hugo docs features pageyoursite -```md +``` {{}} => #who:9decaf7 {{}} => /blog/post/#who:badcafe ``` @@ -113,7 +113,7 @@ Ensuring heading uniqueness across the site is accomplished with a unique identi `ref` and `relref` were added so you can make these reference links without having to know the document’s unique identifier. (The links in document tables of contents are automatically up-to-date with this value.) -```md +``` {{}} /content-management/cross-references/#hugo-heading-anchors:77cd9ea530577debf4ce0f28c8dca242 ``` diff --git a/content/content-management/formats.md b/content/content-management/formats.md index ae6276db3..f3b6f8a6c 100644 --- a/content/content-management/formats.md +++ b/content/content-management/formats.md @@ -42,7 +42,7 @@ Hugo supports [GitHub-styled task lists (i.e., TODO lists)][gfmtasks] for the Bl #### Example Task List Input {{% code file="content/my-to-do-list.md" %}} -```markdown +``` - [ ] a task list item - [ ] list syntax required - [ ] incomplete @@ -54,7 +54,7 @@ Hugo supports [GitHub-styled task lists (i.e., TODO lists)][gfmtasks] for the Bl The preceding markdown produces the following HTML in your rendered website: -```html +```
    • a task list item
    • list syntax required
    • @@ -98,7 +98,7 @@ As Hugo ships with Mmark, using the syntax is as easy as changing the extension In the event that you want to only use Mmark in specific files, you can also define the Mmark syntax in your content's front matter: -```yaml +``` --- title: My Post date: 2017-04-01 @@ -121,7 +121,7 @@ This is not an introduction into actually using MathJax to render typeset mathem The first step is to enable MathJax on pages that you would like to have typeset math. There are multiple ways to do this (adventurous readers can consult the [Loading and Configuring](http://docs.mathjax.org/en/latest/configuration.html) section of the MathJax documentation for additional methods of including MathJax), but the easiest way is to use the secure MathJax CDN by include a ` ``` @@ -150,7 +150,7 @@ There are multiple ways to remedy this problem. One solution is to simply escape Another option is to tell Markdown to treat the MathJax code as verbatim code and not process it. One way to do this is to wrap the math expression inside a `
      ` `
      ` block. Markdown would ignore these sections and they would get passed directly on to MathJax and processed correctly. This works great for display style mathematics, but for inline math expressions the line break induced by the `
      ` is not acceptable. The syntax for instructing Markdown to treat inline text as verbatim is by wrapping it in backticks (`` ` ``). You might have noticed, however, that the text included in between backticks is rendered differently than standard text (on this site these are items highlighted in red). To get around this problem, we could create a new CSS entry that would apply standard styling to all inline verbatim text that includes MathJax code. Below I will show the HTML and CSS source that would accomplish this (note this solution was adapted from [this blog post](http://doswa.com/2011/07/20/mathjax-in-markdown.html)---all credit goes to the original author). {{% code file="mathjax-markdown-solution.html" %}} -```js +``` ``` @@ -270,7 +270,7 @@ To embed slides from [Speaker Deck][], click on "< /> Embed" (u Extract the value from the field `data-id` and pass it to the shortcode: {{% code file="speakerdeck-example-input.md" %}} -```md +``` {{}} ``` {{% /code %}} @@ -278,7 +278,7 @@ Extract the value from the field `data-id` and pass it to the shortcode: #### `speakerdeck` Example Output {{% output file="speakerdeck-example-input.md" %}} -```html +``` {{< speakerdeck 4e8126e72d853c0060001f97 >}} ``` {{% /output %}} @@ -302,7 +302,7 @@ https://twitter.com/spf13/status/877500564405444608 Pass the tweet's ID from the URL as a parameter to the `tweet` shortcode: {{% code file="example-tweet-input.md" %}} -```md +``` {{}} ``` {{% /code %}} @@ -312,7 +312,7 @@ Pass the tweet's ID from the URL as a parameter to the `tweet` shortcode: Using the preceding `tweet` example, the following HTML will be added to your rendered website's markup: {{% output file="example-tweet-output.html" %}} -```html +``` {{< tweet 877500564405444608 >}} ``` {{% /output %}} @@ -336,7 +336,7 @@ https://vimeo.com/channels/staffpicks/146022717 Extract the ID from the video's URL and pass it to the `vimeo` shortcode: {{% code file="example-vimeo-input.md" %}} -```md +``` {{}} ``` {{% /code %}} @@ -346,7 +346,7 @@ Extract the ID from the video's URL and pass it to the `vimeo` shortcode: Using the preceding `vimeo` example, the following HTML will be added to your rendered website's markup: {{% output file="example-vimeo-output.html" %}} -```html +``` {{< vimeo 146022717 >}} ``` {{% /output %}} @@ -354,7 +354,7 @@ Using the preceding `vimeo` example, the following HTML will be added to your re {{% tip %}} If you want to further customize the visual styling of the YouTube or Vimeo output, add a `class` named parameter when calling the shortcode. The new `class` will be added to the `
      ` that wraps the ` @@ -173,7 +173,7 @@ Would load the template at `/layouts/shortcodes/youtube.html`: {{% /code %}} {{% code file="youtube-embed.html" copy="false" %}} -```html +```
      @@ -258,7 +258,7 @@ Would load the template found at `/layouts/shortcodes/vimeo.html`: Would be rendered as: {{% code file="vimeo-iframes.html" copy="false" %}} -```html +```
      @@ -273,7 +273,7 @@ Would be rendered as: The following is taken from `highlight`, which is a [built-in shortcode][] that ships with Hugo. {{% code file="highlight-example.md" %}} -```markdown +``` {{}} This HTML @@ -284,14 +284,14 @@ The following is taken from `highlight`, which is a [built-in shortcode][] that The template for the `highlight` shortcode uses the following code, which is already included in Hugo: -```golang +``` {{ .Get 0 | highlight .Inner }} ``` The rendered output of the HTML example code block will be as follows: {{% code file="syntax-highlighted.html" copy="false" %}} -```html +```
      <html>
           <body> This HTML </body>
       </html>
      @@ -310,7 +310,7 @@ Hugo's [`.Parent` shortcode variable][parent] returns a boolean value depending
       The following example is contrived but demonstrates the concept. Assume you have a `gallery` shortcode that expects one named `class` parameter:
       
       {{% code file="layouts/shortcodes/gallery.html" %}}
      -```html
      +```
       
      {{.Inner}}
      @@ -320,7 +320,7 @@ The following example is contrived but demonstrates the concept. Assume you have You also have an `image` shortcode with a single named `src` parameter that you want to call inside of `gallery` and other shortcodes so that the parent defines the context of each `image`: {{% code file="layouts/shortcodes/image.html" %}} -```html +``` {{- $src := .Get "src" -}} {{- with .Parent -}} @@ -332,7 +332,7 @@ You also have an `image` shortcode with a single named `src` parameter that you You can then call your shortcode in your content as follows: -```markdown +``` {{}} {{}} {{}} @@ -342,7 +342,7 @@ You can then call your shortcode in your content as follows: This will output the following HTML. Note how the first two `image` shortcodes inherit the `class` value of `content-gallery` set with the call to the parent `gallery`, whereas the third `image` only uses `src`: -```html +```