chandra
November 16, 2017, 11:39am
1
I am thinking of a two-line copyright for my site.
According to the toml
documentation I could for instance write in config.toml
the following:
copyright = "My name\nLinks to Hugo and Theme"
but it does not seem to work.
Is this because of CSS styling or have I understood the toml
docs incorrectly?
Thanks.
Don’t you need a leading "
on the value?
chandra
November 16, 2017, 12:38pm
3
Mea Culpa: I have edited it above but I tried it with matched "s and could not get it to work.
bep
November 16, 2017, 12:42pm
4
Try
str1 = """
Roses are red
Violets are blue"""
1 Like
You are referring toml documentation, but the syntax is yaml’s.
YAML (colons):
foo: "bar"
TOML (equals):
foo = "bar"
chandra
November 16, 2017, 1:01pm
6
Another error of mine: I have corrected it in the question. I meant toml
. Thanks.
Now you either show your site source that shows this problem, or try what @bep suggested
chandra
November 16, 2017, 1:08pm
9
I have cut and pasted your text into the copyright string and got the attached rendering.
The results perplex me.
Could it be styling done afterwards to enforce a single line copyright?
chandra
November 16, 2017, 1:11pm
10
I am new to this and my site is not online. It is local, and I am trying to customize the hugo-icarus-theme
a little to suit my needs.
In any case, the results have been posted.
Even if your site is not online, you can share the site source online (assuming you can legally do that) on places like Gitlab and GitHub.
Assuming that that copyright param expects a Markdown value, you would need to use a blank line to force a new paragraph in HTML.
chandra
November 16, 2017, 2:06pm
12
There is no site code from me.
I am simply changing values in the config.toml
file for the Icarus theme in Hugo.
This file is part of the hugo-icarus-theme
and I am changing the value for the copyright
key in config.toml
so:
copyright = "My name\nLinks to Hugo and Theme"
Note that the exampleSite
of the Icarus theme is a fully working site and is very convenient for making small configuration changes and seeing their effect almost at once.
So far, I have not been able to get the copyright to display on two lines. I am unsure why. Hence my question.
If you are able to help, I shall endeavour to provide any further details you ask for.
Thanks.
Did you try:
you would need to use a blank line to force a new paragraph in HTML.
I.e:
copyright = """Line 1
Line 2"""
Blank line above Line 2 matters.
chandra
November 16, 2017, 2:29pm
14
kaushalmodi:
Did you try:
you would need to use a blank line to force a new paragraph in HTML.
I.e:
copyright = “”"Line 1
Line 2"“”
Blank line above Line 2 matters.
Yes. Your comment that a blank line was necessary was most helpful.
But it gives three lines instead of two.
copyright = """My name
Links to Hugo and Theme"""
gives
So, I am able to get either a one-line or a three-line output for the copyright notice but not the two lines I am seeking.
I shall try some more.
Thank you.
Hmm, I’m still on phone, not at a computer… so all guess work… try:
copyright = "Line1<br />Line2"
1 Like
chandra
November 16, 2017, 4:27pm
16
That worked!
Thank you @kaushalmodi .
The text
copyright = "My name<br />Links to Hugo and Theme"
gave me
This is exactly what I was aiming for.
I have also taken a look at this thread.
and taken a look at the Icarus file:
layouts/partials/footer.html
It has these lines:
<footer id="footer">
<div class="outer">
<div id="footer-info" class="inner">
© {{ now.Format "2006"}}
{{ with .Site.Params.copyright }}{{ . | markdownify}}{{ end }}
</div>
</div>
</footer>
where I suspect that markdownify
might be the cause of the different interpretations given to \n
in the experiments above.
Thanks for helping me learn and also for suggesting the solution.