Comments (6)
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.
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.
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.
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.
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.
![Screenshot 1946-02-19 at 10 45 33](https://private-user-images.githubusercontent.com/167783123/329133957-d1f6fbd6-a5dd-4d3a-b405-3ef908f3df20.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0ODIzOTQsIm5iZiI6MTcyMTQ4MjA5NCwicGF0aCI6Ii8xNjc3ODMxMjMvMzI5MTMzOTU3LWQxZjZmYmQ2LWE1ZGQtNGQzYS1iNDA1LTNlZjkwOGYzZGYyMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyMFQxMzI4MTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lMGU3NzczMDM3ODE0MjBjZDE5NjZjYjI1OWM2MWQ0NDVhZDcwNmNhMzRjNWFkMTNjOWJkODViNWU3ZDZhMjc5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.kkpMITeeArNHPuZQOOvgCrCR082hr5syYtalqrjME68)
from hugo-blox-builder.
Related Issues (20)
- improve docs: show examples of using icons in code (markdown) HOT 3
- Support Devicon HOT 2
- missing reddit icon on Hugo Blox suggested code HOT 2
- Icon SVG is not loaded
- Add Strava to brands icon pack HOT 3
- Hugo v0.123.1 breaks sites HOT 3
- fix the docs: staticref shortcode missing? HOT 1
- fix docs: list_children missing? HOT 1
- highlight self name in authors list when importing from bibtex HOT 3
- All three map providers supported by Hugo are not available in China HOT 1
- Dark mode breaks highlighting lines in code blocks HOT 5
- Problem with deployment on GitHub Pages (Node.js 16) HOT 1
- filter will not work on hugo v0.123.7 HOT 1
- Add Google Scholar expected meta tags to publication pages HOT 2
- Add slider to gallery block HOT 1
- HUGO language HOT 1
- The latest version will cause an error when building when following the tutorial for configuration. HOT 1
- Build with Hugo, `publish.yaml` failing HOT 1
- `cite` short code usage in the documentation causing an error HOT 1
- People Widget HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-blox-builder.