Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/curttimson/hugo-theme-dopetrope.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCurtis Timson <curt@live.co.uk>2018-02-24 13:00:15 +0300
committerCurtis Timson <curt@live.co.uk>2018-02-24 13:00:15 +0300
commite49918d911771db616f49952959d105e232f75b8 (patch)
tree3bda4185980578abd681462061a7694ca27d931e
parente09028a905aceacb7d855b7d6d8e39f1f574a884 (diff)
:sparkles: Move address to data from config
-rw-r--r--exampleSite/config-prod.toml5
-rw-r--r--exampleSite/config.toml5
-rw-r--r--exampleSite/data/footer/contactinfo.yaml6
-rw-r--r--layouts/partials/footer/contact.html22
-rw-r--r--layouts/partials/footer/index.html19
5 files changed, 29 insertions, 28 deletions
diff --git a/exampleSite/config-prod.toml b/exampleSite/config-prod.toml
index 5b4c8b9..2eb29b0 100644
--- a/exampleSite/config-prod.toml
+++ b/exampleSite/config-prod.toml
@@ -18,11 +18,6 @@ theme = "../.."
postsperpage = "6"
foldername = "blog"
-[params.address]
- line1 = "Untitled Incorporated"
- line2 = "1234 Somewhere Road Suite"
- line3 = "Nashville, TN 00000-0000"
-
[params.contact]
email = "someone@untitled.tld"
phone = "(800) 000-0000"
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 9368bec..de311e5 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -18,11 +18,6 @@ theme = "../.."
postsperpage = "6"
foldername = "blog"
-[params.address]
- line1 = "Untitled Incorporated"
- line2 = "1234 Somewhere Road Suite"
- line3 = "Nashville, TN 00000-0000"
-
[params.contact]
email = "someone@untitled.tld"
phone = "(800) 000-0000"
diff --git a/exampleSite/data/footer/contactinfo.yaml b/exampleSite/data/footer/contactinfo.yaml
new file mode 100644
index 0000000..4d3d11b
--- /dev/null
+++ b/exampleSite/data/footer/contactinfo.yaml
@@ -0,0 +1,6 @@
+addresslines:
+- line: 'Untitled Incorporated'
+
+- line: '1234 Somewhere Road Suite'
+
+- line: 'Nashville, TN 00000-0000'
diff --git a/layouts/partials/footer/contact.html b/layouts/partials/footer/contact.html
new file mode 100644
index 0000000..5ff160b
--- /dev/null
+++ b/layouts/partials/footer/contact.html
@@ -0,0 +1,22 @@
+<ul class="contact">
+ {{ if .Site.Data.footer.contactinfo.addresslines }}
+ <li>
+ <h3>Address</h3>
+ <p>
+
+ {{ range $i, $e := .Site.Data.footer.contactinfo.addresslines }}
+ {{ if $i }} <br/> {{ end }} {{ .line }}
+ {{ end }}
+
+ </p>
+ </li>
+ {{ end }}
+ <li>
+ <h3>Mail</h3>
+ <p><a href="mailto:{{ .Site.Params.Contact.email }}">{{ .Site.Params.Contact.email }}</a></p>
+ </li>
+ <li>
+ <h3>Phone</h3>
+ <p>{{ .Site.Params.Contact.phone }}</p>
+ </li>
+</ul> \ No newline at end of file
diff --git a/layouts/partials/footer/index.html b/layouts/partials/footer/index.html
index 39404f9..806ad28 100644
--- a/layouts/partials/footer/index.html
+++ b/layouts/partials/footer/index.html
@@ -51,24 +51,7 @@
<h2>{{ (index .Site.Data.footer.content.sections 4).title }}</h2>
</header>
{{ partial "footer/social.html" . }}
- <ul class="contact">
- <li>
- <h3>Address</h3>
- <p>
- {{ .Site.Params.Address.line1 }}<br />
- {{ .Site.Params.Address.line2 }}<br />
- {{ .Site.Params.Address.line3 }}
- </p>
- </li>
- <li>
- <h3>Mail</h3>
- <p><a href="mailto:{{ .Site.Params.Contact.email }}">{{ .Site.Params.Contact.email }}</a></p>
- </li>
- <li>
- <h3>Phone</h3>
- <p>{{ .Site.Params.Contact.phone }}</p>
- </li>
- </ul>
+ {{ partial "footer/contact.html" . }}
</section>
</div>
</div>