Git Product home page Git Product logo

Comments (6)

gcushen avatar gcushen commented on August 15, 2024

Hi

The image path uses the standard web URL protocol. You can either specify it as an absolute path from the root of the domain or as a relative path from the URL of the current page.

According to the Markdown and screenshot you provided, it appears to be looking for the image at http://localhost:1313/post/example-post/img/portrait.jpg whereas the actual location of the image in your setup is probably at http://localhost:1313/img/portrait.jpg

So to correctly locate the image, you could either start the URL with a slash like /img/portrait.jpg which will cause it to concatenate itself with the root domain of your baseURL defined in config.toml - which in development mode, simply concatenates it with localhost:1313.

Or you could specify the URL as a relative path from your current page URL to your img folder like ../../img/portrait.jpg.

Hope that helps!

from hugo-blox-builder.

gcushen avatar gcushen commented on August 15, 2024

You might also find the latest documentation about writing content (http://gcushen.github.io/hugo-academic-demo/post/writing-markdown-latex/ ) useful, although it doesn't currently elaborate on the URL format for images.

from hugo-blox-builder.

kirbyj avatar kirbyj commented on August 15, 2024

Looks like the docs have been updated since I last cloned the repo, thanks for the tip.

On 2 Jun 2016, at 11:25, gcushen [email protected] wrote:

You might also find the latest documentation about writing content (http://gcushen.github.io/hugo-academic-demo/post/writing-markdown-latex/ http://gcushen.github.io/hugo-academic-demo/post/writing-markdown-latex/ ) useful, although it doesn't currently elaborate on the URL format for images.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #14 (comment), or mute the thread https://github.com/notifications/unsubscribe/AHdog6Q82P0gE1ICtddVx9VdvmsraFrDks5qHq-HgaJpZM4IsX4C.

from hugo-blox-builder.

kirbyj avatar kirbyj commented on August 15, 2024

So to correctly locate the image, you could either start the URL with a slash like /img/portrait.jpg which will cause it to concatenate itself with the root domain of your baseURL defined in config.toml - which in development mode, simply concatenates it with localhost:1313.
Or you could specify the URL as a relative path from your current page URL to your img folder like ../../img/portrait.jpg.

fwiw (b) works but (a) does not. images located in static/img, so e.g. http://localhost:1313/sitename/img/img.png

this is presumably due to the fact that the server is being started as http://localhost:1313/sitename/ rather than http://localhost:1313/ for reasons that are not always clear to me.

from hugo-blox-builder.

gcushen avatar gcushen commented on August 15, 2024

The Academic theme does not parse the images or their URLs, it's all done by Hugo. Generally, URLs should have the previously described behaviour (e.g. http://stackoverflow.com/questions/10659459/starting-with-a-forward-slash-in-html-for-href ), but in your case, it appears Hugo may be altering the behaviour slightly. You might be interested in searching the Hugo forums - there are some related discussions there, for example: https://discuss.gohugo.io/t/image-path/1721

I might try to clarify this more in the Academic documentation sometime.

from hugo-blox-builder.

pradnyasorbet avatar pradnyasorbet commented on August 15, 2024
Screenshot 1946-02-19 at 10 45 33 my image is not been working within the website .I tried many commands but its not working

from hugo-blox-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.