hugo-theme-bootstrap | A fast, responsive, multipurpose and feature-rich Hugo theme | Theme library
kandi X-RAY | hugo-theme-bootstrap Summary
kandi X-RAY | hugo-theme-bootstrap Summary
A fast, responsive and feature-rich Hugo theme for personal blog and documentations.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of hugo-theme-bootstrap
hugo-theme-bootstrap Key Features
hugo-theme-bootstrap Examples and Code Snippets
Community Discussions
Trending Discussions on hugo-theme-bootstrap
QUESTION
I'm using Hugo for the first time and I'm having troubles with translations.
More specifically, I'm using the hugo-theme-bootstrap theme. In config\_default
, I have a file named author.toml
that contains information like the author's name, bio, city, etc. It looks like this:
ANSWER
Answered 2021-Aug-10 at 02:16(TLDR - The site author set-up the author data as 1 config file - i.e. Theme is built for 1 author for the entire site).
Hello Pascal, so, really appreciated you took the time to answer me. To clarify:
This isn't a "hugo" thing, but the way this chap built this theme.
You are going to have to modify his theme (or reach out to him). The specific file in question, as you point out, I believe is profile.html in sidebar:
{{- if .Site.Author -}}
{{- $layout := default "" .Site.Author.params.layout -}}
{{- if eq $layout "compact" -}}
{{- partial "sidebar/profile/compact" . -}}
{{- else -}}
{{- partial "sidebar/profile/default" . -}}
{{- end -}}
{{- end -}}
If you follow the various partials this calls, i.e. down the rabbit whole you will find an example (this is one of many), like you describe and quote in your question, it has the specific comment {{ - with .Site.Author - }} meaning, it's looking for exactly 1 file, with a specific name.
[https://gohugo.io/content-management/multilingual/][1]
covers how to set-up a hugo multilingual - and there is SUPPOSED to be 1 Config file per site (which has it's own meaning in Hugo - see above page)
Point being, this is a theme issue, and I would suggest asking the theme creator to adapt edit.
My suggestion would be if the theme creator isn't helpful - would be to remove the dependency for the TOML file, and simply reference a headless bundle which has the author data, and as the theme has i18n, integrate the two (see above link) so that their is a headless bundle per language.
QUESTION
It seems I cannot invoke .Resources.GetMatch
with a template variable of type string, though I can invoke it with a string literal. I know I can invoke it with .
in a with
block, but would like to know why this code doesn't work.
Main template invokes partial with a second argument stuffed into .Scratch
:
ANSWER
Answered 2020-Nov-25 at 06:15I rewrote my problematic code and came up with a workable solution, but I never did discover exactly where I was going wrong above (it remains reproducible for anyone who would like to point out exactly where I did go wrong).
To close this thread with something like an acceptable answer, here's what I did.
Maybe it will help some future wanderer...
Basically,
- stuff all the arguments into a
dict
where the partial is invoked. - at the top of the partial, save value of
.
(e.g in a nicely-named local$args
or$argv
) - wherever you need a particular argument value, it's readily available in
$args.xyzzy
I don't know why this simple and effective pattern eluded me yesterday, I see lots of similar suggestions around the web today...
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install hugo-theme-bootstrap
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page