hugo-profile icon indicating copy to clipboard operation
hugo-profile copied to clipboard

Does not run locally out of box

Open Samurai336 opened this issue 1 year ago • 2 comments

Describe the bug If you try to run this hugo theme out of the box with the sample config you get a twitter API error

'''ERROR 2023/12/03 11:20:55 Failed to get JSON resource "https://api.twitter.com/1/statuses/oembed.json?id=GoHugoIO&dnt=false": Failed to retrieve remote file: Bad Request'''

To Reproduce Steps to reproduce the behavior:

  1. hugo new site exampleSite
  2. cd exampleSite/themes
  3. git clone https://github.com/gurusabarish/hugo-profile.git
  4. cd ..
  5. cp -r themes/hugo-profile/exampleSite/* ./
  6. hugo server -D

After step six server fails to run with the JSON request error.

Expected behavior Local hugo instance runs with sample site

Desktop (please complete the following information):

  • OS: Linux Mint 20.3

Samurai336 avatar Dec 03 '23 16:12 Samurai336

Hey @Samurai336 , This issue might be connected to the now closed issue #141 . The twitter_cards align with the error you were seeing. You should try now with the updates 👍

jochavez avatar Dec 24 '23 20:12 jochavez

In case the error really was the following (added some new lines):

Error: error building site: render: failed to render pages: render of "page" failed: "/Users/HOMEFOLDER/website/themes/hugo-profile/layouts/_default/baseof.html:5:6": 
execute of template failed: 
template: _default/gallery.html:5:6: executing "_default/gallery.html" at <partial "head.html" .>: error calling partial: 
execute of template failed: template: _internal/opengraph.html:6:15: executing "_internal/opengraph.html" at 
<partial "_funcs/get-page-images" .>: error calling partial: execute of template failed: template: 
partials/_funcs/get-page-images.html:24:18: executing "partials/_funcs/get-page-images.html" at 
<urls.Parse>: error calling Parse: error in Parse: unable to cast map[string]interface {}
{"src":"https://iso.500px.com/wp-content/uploads/2016/03/stock-photo-142984111-1500x1000.jpg"} of type map[string]interface {} to string

The solution for me was in the linked PR's commit #141.

Changing my own gallery.md with images-key to galleryImages solved the issue.

devTechi avatar Feb 27 '24 09:02 devTechi