I’ve been trying to find info on how I can create a link to an external resource in some of my /data .yml or config.toml files. I went through the official docs - didn’t find what I want, googled the subj and found couple dozens of pages discussing that.
I went through all of them - and in the end I still don’t know how to create a link to an external resource. All those pages discuss lengthily (tl;dr) anything but creation of a link to an external resource.
I want to draw all contributors’ attention to extreme desirability of staying on the subject, being clear and concise and finishing their input with a simple working demo.
Also, if anyone knows how to create a link to an external resource - please send me a link!
Thanks a lot!
What kind of resource are you referring to? An external image?
Which pages are you refering to? Can you please post a couple of links?
Can you please give us concrete examples of what you are referring to above? Like for example, which pages in the Documentation are not meeting your expectations.
Again it is not clear at all what do you mean by creating a link to an external resource.
Also for future reference and to keep things in this Forum civil and productive please do read up on the Forum FAQ regarding proper etiquette when posting here, as well as the Requesting Help Guidelines.
It works fine from its partial, but if I copy the button code to a partial called “services” - it stops working, does not pick values!
Why?! How is it configured?
<a href="{{ .Site.Params.cta.btnURL }}" class="btn btn-main">{{ with .Site.Params.cta.btnText }} {{ . }} {{end}}</a>
^^^ Note this and this ^^^
{{ .Site.Params.cta }} corresponds to [params.cta] in your config.toml. Read more about .Site.Params here: Site variables | Hugo
What does your services partial look like?
If you are copied {{ .Site.Params.cta.btnURL }} as is, then it wouldn’t pick up the values of [params.services], but instead use [params.cta].
But I’m just guessing here. Without seeing what your actual code looks like, that is all I or anyone can do, guess. Which is why we ask that people asking for help in these forums read Requesting Help, which recommends that you share the actual code.
Without seeing the full code of your site, it’s hard to tell what’s happening. As a ‘shot in the dark’ another option could be that the problem isn’t with the code in the partial, or values in config.toml but the way you’re overriding the theme.
Have you got the Maghna-Hugo theme copied into the theme directory? Are you overriding its partials using the higher-level layouts/partials directory? Has your version of the partial got the same name, in the same sub-directory?
If you can give us a link to a repo or the actual code somehow, we can check. Going only from the snippet you pasted, the format is wrong due to the spaces before the colons.
This is my first experience with Github. I’ve just downloaded the theme and edited some files. Please advise, how I should upload my files to Github - fork, clone, submodule?
I’m not sure how to create a child theme, so the best solution for now perhaps would be to have an independent fork. So, just upload my files to Github, or create a clone / submodule with CLI - I don’t know. May be use git command to sync my local files to Github?
Downloading a theme and editing it is an ok way to do things—it’ll work. I think there’s a benefit to having a theme as a sub-module and then overriding the bits you want to change…but I reckon what you’re doing will help get things started.
For now, we’ll be able to help you if you push your code to a git repository (gitlab/github/bitbucket). Here’sa few tutorials on how to do this
Thank you guys, I am figuring out how I can do that with CLI. BTW, do you keep your business info in your local GIT, or separately? You might keep your software model in local Git and actual data files to build the website in another folder.
I used the website smaple files - copied the to Hugo and edited them along with partials. Now in my working directory I have a mix of Hugo files, theme files and sample website files. Which of those I should push into Git remote?
I think I have started wrong and now that’s why I hardly understand what to do.
What is the correct way I should have taken initially -
fork the theme into my Git remote,
download it and edit it,
upload edited files to the remote -
or what?
Copy files out of the themes exampleSite directory (like config.toml, maybe some of the example pages and posts) into the appropriate places in the site folder structure.
Run hugo server and test that something like the example site gets built.
Commit and push these changes to git (you could do this after each step if you like).
Start customising…and as things work, commit and push the changes to git.
Hello funkydan2, thank you for your assistance! Mastering this for the first time creates a huge overwhelm. This is what I could recreate:
On github or bitbucket: create a new blank git repository <siteName>
Locally: run hugo new site <siteName> to build a skeleton folder structure:
cd <workDir>
<workDir> hugo new site <siteName>
Initialize local repository:
<workDir>: git init <siteName>
<workDir>: git config user.email \<email>
\<workDir>: git config user.name <username>
cd <siteName>
<siteName>$ sudo git clone <themeUrl> to /themes/<themeName>:
Merge files from the theme’s <exampleSite> into <siteName>
Run hugo server - it works.
I’m sorry for this mess - can’t clean it.
I didn’t understand how to Install the theme as a submodule - after I installed it as clone above.