Comments (5)
sorry for necrobumping, but I've read the linked articles and I still do not understand how can I add images to posts (I'm receiving exactly the same error as the OP). what I've tried so far:
- editing
images
array inside _index.md - adding
resources
section inside _index.md, like so:
resources:
- src: 'images/my-image.png'
- trying to place the image in the same directory as the .md file, without
images
subdirectory
basically my directory structure is exactly the same as cloning doks repository and I simply cannot build the page when I'm trying to place the image.
the change that I did is:
--- a/content/docs/prologue/introduction.md
+++ b/content/docs/prologue/introduction.md
@@ -5,7 +5,7 @@ lead: "Doks is a Hugo theme helping you build modern documentation websites that
date: 2020-10-06T08:48:57+00:00
lastmod: 2020-10-06T08:48:57+00:00
draft: false
-images: []
+images: ["unnamed.png"]
+resources:
+ - "unnamed.png"
menu:
docs:
parent: "prologue"
@@ -19,6 +19,8 @@ There are two main ways to get started with Doks:
### Tutorial
+{{< img-simple src="unnamed.png" >}}
(the image is placed inside content/docs/prologue
directory.
would it be possible for you to provide a quick tutorial on adding images? I can see that this works in the minecraft demo page, though I can't even see where the images are referenced - they simply seem to be referenced trough img
tag.
from doks.
wow! it works like a charm. Thank you so much!
from doks.
Hey @alexvpickering, you need to use Page Bundles for the image shortcodes to work β see also Images.
You found a bug though π I will update the hyas info
command β it should be npm run check
.
from doks.
Hey @alexvpickering, you need to use Page Bundles for the image shortcodes to work β see also Images.
You found a bug though π I will update the
hyas info
command β it should benpm run check
.
Ahhh okay great thank you! I had originally followed the Page Bundles link but it was too verbose for my state of mind so I assumed it was just a βgo ahead and put images with you pagesβ. Iβll read the docs this time π
from doks.
Hello @toudi, the image shortcodes work for images that are page resources. Meaning, place your images in a page folder, like so:
..
βββ prologue/
β βββ _index.md
β βββ commands.md
β βββ introduction/
β β βββ index.md
β β βββ unnamed.png
β βββ quick-start.md
..
That's it.
from doks.
Related Issues (20)
- issue with npm run build HOT 12
- Versions list HOT 4
- Error with the updating from old version to the last version HOT 5
- No Guides and Reference dropdown if language is != defaultContentLanguage
- The styling of the <code></code> don't appear after building the site HOT 2
- New install of Doks via `npm create` doesn't work HOT 2
- Order of module mounts for assets is wrong HOT 7
- Mermaid / Kate import error HOT 2
- libsass.html postCSS build not complete result main.css
- Figcaption css missing in Doks template HOT 2
- Rendering broken on dark-theme cards HOT 1
- Adding `fade` to the `safelist` section should fix the `toTopButton` issue
- Images get cropped when generated from /assets/images to /resources/_gen/images HOT 4
- Mermaid Rendering Issue with GitHub Pages HOT 2
- SEO title not working when updating to doks-core 1.3.0 HOT 2
- Blog Reactions HOT 1
- Is there currently support for multiple content docs? HOT 3
- Hugo Installer causing error HOT 2
- Images in assets folder are not present in public or resources after build HOT 1
- Flexsearch result are not ordered by relevance. HOT 1
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 doks.