Jekyll Pagination Path for img assets - pagination

I followed this tutorial for adding pagination to my blog site. For the most part it worked except all the thumbnail/preview images for the blog posts are no longer found because the path is now http://myblog.com/page2/ or page 3, etc. and my assets path in the front matter is:
---
layout: post
title: "My first blog post"
image: assets/img/post_image.png
so i keep receiving:
ERROR `/page2/assets/img/post_image.png' not found.
How can i resolve this? Only the images on the first page of the site are found properly because there's no new path.

Just needed to make the image path a relative path like
/assets/img/post_image.png and it was fixed.

Related

Nuxtjs including images from assets using the content module

I am trying to use the nuxt.js Nuxt.js content module. Is there a way to display images we refer to in our blogpost.md file? I know that we can put images in the front matter, but I want the create of the articles to put images inside their created .md file. Lets say we have a file:
-- start of .md file --
# some text
some description
![Image of test](../../assets/images/test.jpg)
![Image of Yaktocat](https://octodex.github.com/images/yaktocat.png)# some text
some description
-- end of .md file --
I end up seeing the image that is linked using https. But the other image is not displayed?? When checking the page I see an <img> tag is created, but no image to be seen...
When I check the structure using any other markdown editor, I see the image.
Including links to images does display images. But I need to include locally stored images.
any help greatly appreciated
Partially solving the issue, some images can be added using metadata (like cover images), those cannot be added within the content itself, just above or bellow actual content.
---
title: Sample
image: test.jpg
---
Here the markdown (without images)
In the view you can render that image after or before the content using something like:
<img :src="require(`~/assets/images/${ page.image }`)">
<nuxt-content :document="page"/>

How to display all images from a blog article

I am trying to display all the images from a blog article in the blog listing page.
Currently it only displays the image marked as preview in the shopware backend > blog article configuration > Image configuration. But I also need to display the others if you select more than one.
I have been trying to modify the box.tpl file from the blog folder, the detail.tpl, and even the Blog.php file under Shopware > Controllers > Frontend but didn't have luck.
In the Blog.php file under the index method I saw this piece of code but not sure if this one does the trick
//adding thumbnails to the blog article
if (empty($blogArticle['media'][0]['mediaId'])) {
continue;
}
$mediaId = $blogArticle['media'][0]['mediaId'];
if (!isset($medias[$mediaId])) {
continue;
}
I am not a shopware expert so any tip would be appreciated.
Thanks.
You would need to write your own plugin and override the index method of the Blog Controller.
You can take a look at the Blog Controller's detailAction how to get all media images.
In your above example you're just getting the first image with [0], but you would need to loop trough all images like in the detailAction.
You may also have a look at the Shopware developer video trainings on Udemy and the Shopware developer documentation.

What's the equivalent of `imagesdir` for other asset files in Asciidoctor.js?

I have a blog post written as an .adoc with my :imagesdir: set to blank (because the Hexo blogging system sets the post's relative url to the asset subfolder).
All my images load correctly, that's great. E.g.
image::patcher.png[]
But when I try to link to another file in my post's folder like
link:++animation.blend++[Blender project file]
the link is provided from the root of my site (incorrect).
How do I specify the root post folder for asset files, like I do the imagesdir folder for images please?
I asked on the github page too: https://github.com/hcoona/hexo-renderer-asciidoc/issues/9
For the moment, raw HTML is a workaround:
++++
<a href='animation.blend'>Blender project file</a>
++++

Link href in a pug template

I am using pug as the view engine of a nodejs application. I have a layout that every other current view extends, that contains a navbar with links to common urls across the app.
For example, a link to the signin url would look like :
a(href='/auth/signin')`
This works fine from the root url ('/'), correctly leads to '/auth/signin'.
Within the '/auth' module which contains the routes for '/auth/signin', '/auth/signup' and '/auth/signout', the behavior is different. Instead, the route is concatenated with the current module's name. So for example, within the '/auth/signin' route, the link is actually a link to '/auth/auth/signin'. Clicking on it naturally leads to a 404, but on that page the link to signin is a link to '/auth/auth/auth/signin'.
And so on and so forth.
I don't fully understand what is going on here and how to prevent it. Is there away to link to my routes in absolute terms in pug without straight up typing the full url (which is unpractical for a variety of reasons), the same way you'd use a route helper in Ruby on Rails ?
Solution from the comments:
If you start your href's with a slash then these are interpreted as absolute url's. Then it does not matter in which folder your pug file is located. Please check that your href's start with / always.

Kentico 9 blog main page, archive page, and tag page

I'm new to Kentico, and have spent hours trying to make the blog work but haven't had any luck. Hope someone could help. I created a new blog by [a] using Pages > New Page > Blog; [b] then applying the Blog page template to it; [c] after that I created 2 sample blog posts. The only thing that works is the individual blog post. Other things don't work:
1- the blog main page --> empty
2- the blog archive page (for July) --> empty
3- tag link --> error message "Page /Blogs/My-blog-1.aspx was not found." Although I know I can change the tag link url, not sure what should be in there.
4 - making "Blog" appears on my nav (that I used CSS List menu web part). For this one, as a workaround, I was thinking about adding a blank "Blog" page and had it redirected to the blog url.
I've read the documentation related to Blog, but couldn't make it to work. Thanks for help!
Some of the out of the box templates are setup in such a way to only work on some of the example site templates which is why you're getting these results.
In the rptAllPosts repeater, set the Path property to ./%, ensure the Page types property is set to cms.blogpost, make sure you have a value in the Transformation property as well.
Should be resolved when you finish #1
You will have to modify the Selected Transformation. If you're using the default transformation, about line 9, way at the end you will need to modify the last parameter from ~/Blogs/my-blog-1.aspx to ~/Blog. This should fix the blog tag link.
Your work-around is very common and I'd stick with it for now.

Resources