From c5fbd48e918a6f43281ee4bb81c9b25922fe7758 Mon Sep 17 00:00:00 2001
From: Clément Pannetier <35581688+clement-pannetier@users.noreply.github.com>
Date: Wed, 04 Nov 2020 17:28:31 +0000
Subject: [PATCH] Update variables names to camelCase format for consistency (#473)
---
exampleSite/config.toml | 28 +++++++-------
layouts/_default/baseof.html | 8 ++--
layouts/partials/posts/series.html | 2
layouts/partials/float.html | 2
layouts/partials/home.html | 2
stackbit.yaml | 30 +++++++-------
layouts/partials/list.html | 2
layouts/posts/single.html | 4 +-
layouts/partials/posts/commento.html | 4 +-
exampleSite/content/posts/hugoisforlovers.md | 2
layouts/partials/posts/disqus.html | 2
exampleSite/content/posts/creating-a-new-theme.md | 2
layouts/posts/li.html | 2
exampleSite/content/posts/goisforlovers.md | 2
layouts/partials/footer.html | 4 +-
15 files changed, 48 insertions(+), 48 deletions(-)
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 976a514..7020e38 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -1,16 +1,16 @@
-baseurl = "http://www.example.com"
+baseURL = "http://www.example.com"
title = "johndoe"
theme = "hugo-coder"
-languagecode = "en"
-defaultcontentlanguage = "en"
+languageCode = "en"
+defaultContentLanguage = "en"
paginate = 20
-pygmentsstyle = "b2"
-pygmentscodefences = true
-pygmentscodefencesguesssyntax = true
+pygmentsStyle = "b2"
+pygmentsCodeFences = true
+pygmentsCodeFencesGuessSyntax = true
disqusShortname = "yourdiscussshortname"
@@ -19,11 +19,11 @@
description = "John Doe's personal website"
keywords = "blog,developer,personal"
info = "Full Stack DevOps and Magician"
- avatarurl = "images/avatar.jpg"
+ avatarURL = "images/avatar.jpg"
#gravatar = "john.doe@example.com"
- footercontent = "Enter a text here."
+ footerContent = "Enter a text here."
- dateformat = "January 2, 2006"
+ dateFormat = "January 2, 2006"
hideFooter = false
hideCredits = false
@@ -40,10 +40,10 @@
# "auto" (use preference set by browser)
# "dark" (dark background, light foreground)
# "light" (light background, dark foreground) (default)
- colorscheme = "auto"
+ colorScheme = "auto"
# Hide the toggle button, along with the associated vertical divider
- hidecolorschemetoggle = false
+ hideColorSchemeToggle = false
# Series see also post count
maxSeeAlsoItems = 5
@@ -118,7 +118,7 @@
[languages]
[languages.en]
- languagename = "English"
+ languageName = "English"
[languages.en.menu]
@@ -144,7 +144,7 @@
[languages.pt-br]
- languagename = "Português"
+ languageName = "Português"
title = "João Ninguém"
[languages.pt-br.params]
@@ -152,7 +152,7 @@
info = "Full Stack DevOps e Mágico"
description = "Sítio pessoal de João Ninguém"
keywords = "blog,desenvolvedor,pessoal"
- footercontent = "Coloque algum texto aqui."
+ footerContent = "Coloque algum texto aqui."
[languages.pt-br.menu]
diff --git a/exampleSite/content/posts/creating-a-new-theme.md b/exampleSite/content/posts/creating-a-new-theme.md
index 0db1741..6534287 100644
--- a/exampleSite/content/posts/creating-a-new-theme.md
+++ b/exampleSite/content/posts/creating-a-new-theme.md
@@ -309,7 +309,7 @@
```
$ vi config.toml
theme = "zafta"
-baseurl = ""
+baseURL = ""
languageCode = "en-us"
title = "zafta - totally refreshing"
MetaDataFormat = "toml"
diff --git a/exampleSite/content/posts/goisforlovers.md b/exampleSite/content/posts/goisforlovers.md
index 4e6e7a4..5034b1b 100644
--- a/exampleSite/content/posts/goisforlovers.md
+++ b/exampleSite/content/posts/goisforlovers.md
@@ -241,7 +241,7 @@
{{ $title := .Site.Title }}
{{ range .Params.tags }}
- <li> <a href="{{ $baseurl }}/tags/{{ . | urlize }}">{{ . }}</a> - {{ $title }} </li>
+ <li> <a href="{{ $baseURL }}/tags/{{ . | urlize }}">{{ . }}</a> - {{ $title }} </li>
{{ end }}
Notice how once we have entered the loop the value of {{ . }} has changed. We
diff --git a/exampleSite/content/posts/hugoisforlovers.md b/exampleSite/content/posts/hugoisforlovers.md
index f6a051c..4a009e9 100644
--- a/exampleSite/content/posts/hugoisforlovers.md
+++ b/exampleSite/content/posts/hugoisforlovers.md
@@ -12,7 +12,7 @@
"golang",
]
series = ["Getting Started", "Hugo"]
-featured_image = "https://imgs.xkcd.com/comics/angular_momentum.jpg"
+featuredImage = "https://imgs.xkcd.com/comics/angular_momentum.jpg"
+++
## Step 1. Install Hugo
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index ec7eff4..1bc5222 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -45,7 +45,7 @@
{{ end }}
{{ end }}
- {{ if or (eq .Site.Params.colorscheme "auto") (eq .Site.Params.colorscheme "dark") }}
+ {{ if or (eq .Site.Params.colorScheme "auto") (eq .Site.Params.colorScheme "dark") }}
{{ if .Site.IsServer }}
{{ $cssOpts := (dict "targetPath" "css/coder-dark.css" "enableSourceMap" true ) }}
{{ $styles := resources.Get "scss/coder-dark.scss" | resources.ExecuteAsTemplate "style.coder-dark.css" . | toCSS $cssOpts }}
@@ -91,9 +91,9 @@
</head>
{{ $csClass := "colorscheme-light" }}
- {{ if eq .Site.Params.colorscheme "dark" }}
+ {{ if eq .Site.Params.colorScheme "dark" }}
{{ $csClass = "colorscheme-dark" }}
- {{ else if eq .Site.Params.colorscheme "auto" }}
+ {{ else if eq .Site.Params.colorScheme "auto" }}
{{ $csClass = "colorscheme-auto" }}
{{ end }}
<body class="{{ $csClass }}{{ if .Site.Params.rtl }} rtl{{ end }}"
@@ -110,7 +110,7 @@
{{ partial "footer.html" . }}
</main>
- {{ if not .Site.Params.hidecolorschemetoggle }}
+ {{ if not .Site.Params.hideColorSchemeToggle }}
{{ if .Site.IsServer }}
{{ $script := resources.Get "js/dark-mode.js" }}
<script src="{{ $script.RelPermalink }}"></script>
diff --git a/layouts/partials/float.html b/layouts/partials/float.html
index 2113d07..623047d 100644
--- a/layouts/partials/float.html
+++ b/layouts/partials/float.html
@@ -1,4 +1,4 @@
-{{ if not .Site.Params.hidecolorschemetoggle }}
+{{ if not .Site.Params.hideColorSchemeToggle }}
<div class="float-container">
<a id="dark-mode-toggle" class="colorscheme-toggle">
<i class="fa fa-adjust fa-fw" aria-hidden="true"></i>
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 5131448..c184381 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,7 +1,7 @@
{{ if not .Site.Params.hideFooter | default false }}
<footer class="footer">
<section class="container">
- {{ with .Site.Params.footercontent | safeHTML }}
+ {{ with .Site.Params.footerContent | safeHTML }}
<p>{{ . }}</p>
{{ end }}
{{ if not .Site.Params.hideCopyright }}
@@ -10,7 +10,7 @@
{{ .Site.Params.since }} -
{{ end }}
{{ now.Year }}
- {{ with .Site.Params.Author }} {{ . }} {{ end }}
+ {{ with .Site.Params.author }} {{ . }} {{ end }}
{{ end }}
{{ if not .Site.Params.hideCredits }}
{{ if not .Site.Params.hideCopyright }} · {{ end }}
diff --git a/layouts/partials/home.html b/layouts/partials/home.html
index 641e555..188f26e 100644
--- a/layouts/partials/home.html
+++ b/layouts/partials/home.html
@@ -1,7 +1,7 @@
<section class="container centered">
<div class="about">
{{ if and (isset .Site.Params "avatarurl") (not (isset .Site.Params "gravatar")) }}
- {{ with .Site.Params.avatarurl }}
+ {{ with .Site.Params.avatarURL }}
<div class="avatar"><img src="{{ . | relURL }}" alt="avatar"></div>
{{ end }}
{{ end }}
diff --git a/layouts/partials/list.html b/layouts/partials/list.html
index 6c9fe20..b4877b2 100644
--- a/layouts/partials/list.html
+++ b/layouts/partials/list.html
@@ -12,7 +12,7 @@
{{ range .Paginator.Pages }}
<li>
<span class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
- <a class="title" href="{{ .Params.ExternalLink | default .RelPermalink }}">{{ .Title }}</a>
+ <a class="title" href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
</li>
{{ end }}
</ul>
diff --git a/layouts/partials/posts/commento.html b/layouts/partials/posts/commento.html
index 936f3bd..93a245e 100644
--- a/layouts/partials/posts/commento.html
+++ b/layouts/partials/posts/commento.html
@@ -1,4 +1,4 @@
-{{- if and (isset .Site.Params "commentourl") (not (eq .Site.Params.commentoUrl "" )) (eq (.Params.disable_comments | default false) false) -}}
+{{- if and (isset .Site.Params "commentourl") (not (eq .Site.Params.commentoURL "" )) (eq (.Params.disableComments | default false) false) -}}
<div id="commento"></div>
-<script src="{{ .Site.Params.commentoUrl }}/js/commento.js"></script>
+<script src="{{ .Site.Params.commentoURL }}/js/commento.js"></script>
{{- end -}}
diff --git a/layouts/partials/posts/disqus.html b/layouts/partials/posts/disqus.html
index 1991af1..b0ffb1f 100644
--- a/layouts/partials/posts/disqus.html
+++ b/layouts/partials/posts/disqus.html
@@ -1,3 +1,3 @@
-{{- if and (not (eq (.Site.DisqusShortname | default "") "")) (eq (.Params.disable_comments | default false) false) -}}
+{{- if and (not (eq (.Site.DisqusShortname | default "") "")) (eq (.Params.disableComments | default false) false) -}}
{{ template "_internal/disqus.html" . }}
{{- end -}}
diff --git a/layouts/partials/posts/series.html b/layouts/partials/posts/series.html
index 2729faf..589d600 100644
--- a/layouts/partials/posts/series.html
+++ b/layouts/partials/posts/series.html
@@ -12,7 +12,7 @@
{{ range first (add $maxItems 1) $series.Pages }}
{{ if ne .RelPermalink $currentPageUrl }}
<li>
- <a href="{{ .Params.ExternalLink | default .RelPermalink }}">{{ .Title }}</a>
+ <a href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
</li>
{{ end }}
{{ end }}
diff --git a/layouts/posts/li.html b/layouts/posts/li.html
index a9ba684..dd58396 100644
--- a/layouts/posts/li.html
+++ b/layouts/posts/li.html
@@ -1,4 +1,4 @@
<li>
<span class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
- <a class="title" href="{{ .Params.ExternalLink | default .RelPermalink }}">{{ .Title }}</a>
+ <a class="title" href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
</li>
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
index 0f38237..930f6d2 100644
--- a/layouts/posts/single.html
+++ b/layouts/posts/single.html
@@ -28,8 +28,8 @@
</header>
<div>
- {{ if .Params.featured_image }}
- <img src='{{ .Params.featured_image }}' alt="Featured image"/>
+ {{ if .Params.featuredImage }}
+ <img src='{{ .Params.featuredImage }}' alt="Featured image"/>
{{ end }}
{{ .Content }}
</div>
diff --git a/stackbit.yaml b/stackbit.yaml
index e7f16a1..65715fe 100644
--- a/stackbit.yaml
+++ b/stackbit.yaml
@@ -17,13 +17,13 @@
label: Title
required: true
- type: string
- name: baseurl
+ name: baseURL
label: Base URL
description: Hostname (and path) to the root
- type: string
- name: languagecode
+ name: languageCode
- type: string
- name: defaultcontentlanguage
+ name: defaultContentLanguage
- type: string
name: themesDir
- type: string
@@ -32,13 +32,13 @@
- type: number
name: paginate
- type: boolean
- name: canonifyurls
+ name: canonifyURLs
- type: string
- name: pygmentsstyle
+ name: pygmentsStyle
- type: boolean
- name: pygmentscodefences
+ name: pygmentsCodeFences
- type: boolean
- name: pygmentscodefencesguesssyntax
+ name: pygmentsCodeFencesGuessSyntax
- type: string
name: disqusShortname
- type: object
@@ -55,19 +55,19 @@
- type: string
name: info
- type: string
- name: avatarurl
+ name: avatarURL
- type: boolean
name: hideFooter
- type: string
- name: footercontent
+ name: footerContent
- type: string
- name: dateformat
+ name: dateFormat
- type: boolean
name: hideCredits
- type: boolean
name: hideCopyright
- type: boolean
- name: hidecolorschemetoggle
+ name: hideColorSchemeToggle
- type: number
name: since
- type: string
@@ -75,7 +75,7 @@
- type: boolean
name: rtl
- type: string
- name: colorscheme
+ name: colorScheme
- type: number
name: maxSeeAlsoItems
- type: list
@@ -215,7 +215,7 @@
items:
type: string
- type: image
- name: featured_image
+ name: featuredImage
label: Featured Image
description: Image featured in post display
snippets:
@@ -231,7 +231,7 @@
label: Language Config
fields:
- type: string
- name: languagename
+ name: languageName
- type: string
name: title
- type: object
@@ -246,7 +246,7 @@
- type: string
name: keywords
- type: string
- name: footercontent
+ name: footerContent
- type: number
name: since
- type: object
--
Gitblit v1.10.0