No images or video (as in demo site) - except avatar image and rollover image #349
Replies: 8 comments 3 replies
-
@darrenaddy, Is it possible to publish your test website as a repository in your GitHub account? Then it will be easier for me to debug it in my local dev. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the prompt reply. I'm new to GitHub, but believe I've figured out how to publish my hugo-site/public contents to Github Pages. You may see the blog at: https://darrenaddy.github.io/darrenaddy/ I believe I RESOLVED the ORIGINALLY reported problems by reading the documentation on the theme page. I had neglected to delete the archetypes/default.md and I had shortened the theme name to hugo-bilberry. Once I corrected those things, republished and recommitted/pushed - things look as they should on the original theme pages (I believe). One remaining issue (probably something that I am doing wrong?) I thought that I did my video post exactly the same way that the sample was done, but on mine the video space is a square and there is a bunch of extra space under the video. Also, I added an avatar image for the header & it is in the correct folder https://darren addy.github.io/darrenaddy/img/darrenaddy.png but it does not seem to load. |
Beta Was this translation helpful? Give feedback.
-
I'm converting this issue into a discussion. |
Beta Was this translation helpful? Give feedback.
-
It occurs to me that, rather than requiring the end user to delete the default.md from HugoProject/archetypes (which is sort of non-standard behavior, when copying over the contents of the ExampleSite to HugoProject root) perhaps it would be better to have an "archetypes" folder in the Bilberry ExampleSite that contains YOUR default.md archetype? Getting back to looking at the code differences between my video post and the one that comes in the ExampleSite to see if I can figure out what i'm doing wrong. I also plan to make a post of all of the other types to see see if I have the correct understanding of making those posts. Reading the docs, it seems like there are at least two ways to do a lot of things ( Internal Hugo YouTube shortcode vs YouTube in the front matter for instance). So perhaps I should also try both methods to see if one works better than the other (though I'm sure they SHOULD be equivalent). |
Beta Was this translation helpful? Give feedback.
-
So my "avatar not loading from local /img/filename.png" issue was solved by using a Gravatar URL instead. Still not sure why a local image did not work there, however - as it WAS in the build and I COULD call it directly in the published site from it's /img location in the browser. |
Beta Was this translation helpful? Give feedback.
-
Any idea why this would be showing up in my video post (html source)? Anyone have any idea why that was inserted? It is NOT a local video and the video tag is almost universally supported (according to caniuse.com). Same result running diffnow in Opera and Chrome. Same extra space (looks like another player interface) below the video in my post. Thanks for any thoughts you may have. |
Beta Was this translation helpful? Give feedback.
-
OK. So I tracked down the inserted code to the end of the partial video-embed.html
|
Beta Was this translation helpful? Give feedback.
-
OK. I get it. Comparing the front matter of the two video posts makes it obvious to this Hugo newbie. If you are embedding a YouTube video then you DELETE the other (unneeded) video types' front matter. Going to try that and recommit/push now. How long does it typically take for GitHub's cache to clear? After I push a new commit, doing a Force Reload of the page in the browser doesn't work for SOME amount of time. EDIT: That did fix the problem of the extra "your browser does not support video tag" code. Still not sure why it answered "true" to that .mp4 {{ if }} statement (in the partial/embed-video.html), however. |
Beta Was this translation helpful? Give feedback.
-
Firstly, thank you for this wonderful theme. I love all of the example content that comes with it. I'm relatively new to Hugo (couple of months) and have experimented with a number of different themes to see how different people do things. THIS is the one I plan to deploy as my actual blog.
EDIT: MOST OF MY ISSUES BELOW WERE DUE TO NOT READING THE INSTRUCTIONS. I did not first delete the default archetype and shortened the name of the theme folder (which is says breaks things). However, a weirdness or two still remain that I need to resolve posts below this one.
I realize that you JUST updated to v3.0.0 so perhaps this is a bug in the new version?
Now to the issue:
I downloaded the CODE from GitHub, unzipped it, and put it in the themes folder of my local machine.
Copied everything in the exampleSite folder to the project site root folder (overwriting everything).
Then I made a few edits to the config.toml in the site root folder and started the server with
hugo server -D --verbose
The site is being served, as expected, on the localhost port. But my home page (source) does not have <img src HTML tags, so no images are showing. Similarly, the images or video are not showing on the single post pages.
TL;DR: I think the .Type is not getting passed to the partials/article-wrapper.html and when I look in the front matter, it appears that the line that should have "type:" is missing.
For example the front matter on the "My Trip To Scotland" index.md looks like this:
`---
title: "My Trip to Scotland"
date: 2021-11-01T18:01:26+01:00
categories: ['Travelling', 'Holidays']
tags: ['Scotland', 'Glennfinnan Viaduct', 'Eilean Donan Castle']
author: "Lednerb"
---`
Your demo site source code (viewed from the browser) for the Trip to Scotland post, for example, looks like this:
`
`
Similarly, on the video post, your demo site code looks like this:
`
Whereas mine looks like this:
`
Similarly, my music post is blank. Where yours begins with:
<article class="audio">
Mine begins with
<article class="default article">
In fact, all of my articles begin with class="default article" where yours are class=video or class=music or class=audio (for example).
Again, where your DuckDuckGo post is a class="link"
mine is a class="default article"
and
where your Snowden post is class="quote"
mine is again class="default article".
I'm going to try putting a type in the front matter to see if I'm right about the class part. But I'm not sure where you call the missing images or video from. Is that in the front matter of each post also?
Thanks for your help on this!
Beta Was this translation helpful? Give feedback.
All reactions