Jekyll include image files next to markdown post file - jekyll

I started working with Jekyll a couple of days to import a Hugo blog.
There is this simple thing that I can't figure out.
It's my understanding that all folders starting with _ will not be processed. It doesn't matter where the folder is it will not be processed except the _posts and _pages.
Let's assume I've got the following structure:
- _posts
- folder1
- 2017-02-05-Post1.md
- 2017-02-05-Post1.png
Then my output is:
- _site
- 2016
- 02
- 05
- Post1.html
I can't figure out how to make Jekyll do something with the image.
I've tried all of the following the _config.yaml.
include:
- .htaccess
- "_posts/**/*.gif"
- "/_posts/**/*.gif"
- "/_posts/*.png"
- "_posts/**/*.gif"
- "_posts/*.png"
- "**/*.gif"
- "**/*.png"
# - "_posts\**\*.gif"
# - "_posts\*.png"
I can't understand Jekyll.

Related

mkdocs build output includes all files when it should not

I am using material-mkdocs. It has been working great for a single site. I would now like to generate two different sites based on the same content, just selectively picking what content is in each site by customising the nav: in the mkdocs config file.
Goal:
Site1: Target Audience A (Show all pages, all nav)
Site2: Target Audience B (Only show 1 page, very simply nav)
I have this working by using:
Site1 = mkdocs build -v -d builtdocs_site1 -f /docs/mkdocs-site1.yml
Site2 = mkdocs build -v -d builtdocs_site2 -f /docs/mkdocs-site2.yml
mkdocs-site1.yml
nav:
- Home:
- Home: index.md
- More: more.md
- more2: more2.md
- lotsmore: lotsmore.md
mkdocs-site2.yml
nav:
- Home:
- Justone: index.md
This results in:
Site1: When I open /docs/builtdocs_site1/index.html I see the 4 nav options which is the expected/desired outcome.
Site2: When I open /docs/builtdocs_site2/index.html I see the 1 nav option which is the expected/desired outcome.
The Problem:
When I build these sites the output includes all files regardless of what is specified in the nav: sections of the respective yml files.
Site1:
/docs/builtdocs_site1/
- index.html
- more.html
- more2.html
- lotsmore.html
Site2:
/docs/builtdocs_site1/
- index.html
- more.html
- more2.html
- lotsmore.html
This means that site2 actually has the content from site1 and even though it cannot be easily accessed (no links), it is still accessible to anyone who can list/view the directory (which in my case is true for various reasons).
How can I configure mkdocs to only build files that are specified in the nav:?

GitHub Actions Ignore Certain Files Inside a Directory

I have a project where I use GitHub Actions. I now need to ignore certain file changes inside certain folders. Here is my project structure:
masterDir
- contentDir
- dir1
- file1.ignore.md
- file2.md
- dir2
- file3.md
- file4.ignore.md
So I would like that my GitHub actions are not triggered for any changes to any file that has ignore.md in its file name. So here is what I came up with, but that does not seem to work.
on:
push:
paths-ignore:
- 'README.md'
- 'backup/**'
- 'masterDir/contentDir/**/*.draft.md'
Any ideas on what is wrong with my wildcard match?
It was indeed quite simple to do. All I have to do is the following:
on:
push:
paths-ignore:
- 'README.md'
- 'backup/**'
- '**/*.draft.md'
As a reference, here is the documentation in detail: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#patterns-to-match-file-paths
As it can be seen from the documentation that the wildcard matches any file in any folder that contains a .draft.md match.

Jekyll - Add custom page

I want to add some custom pages under a different folder, not the _posts
I want to use _doc inside I have multiple files.
_doc
|_installation.md
|_configure.md
|_uninstall.md
I tried this. But when I hit the URL I got 404 error.
installation.md file in _doc folder
---
layout: post
date: 2020-06-06 22:00:00 +0530
title: DOC for installation
description: DOC for installation
categories:
- doc
tags:
- doc
permalink: /doc/installation
---
Rest of the content goes here
Im able to solve this.
Just add the _doc in config file.
include: ['_doc']

Build Jekyll pages recursively from directory tree

I love Markdown + MathJax for note taking, and I've found the simplest way to do this is to use a small, local Jekyll server that I can backup using Git. It's simple, clean, private, and redundant; each document is a single human-readable file before processing, meaning I hope that in 20 years the notes aren't worthless.
My only problem is that I wish I could have a directory with subdirectories of Markdown files and to have Jekyll build everything recursively. For example, imagine I had something like this:
...
- research
- foo
- derivations
- derivation1.md
- derivation2.md
...
- meetings
- 20190912_meeting1.md
- 20190912_meeting2.md
...
- bar
- derivations
- meetings
- personal
- courses
- qux
- baz
...
I would love to automatically render and a locally host a web server in which each directory is an index page, and each .md file is a document.
Is it possible to do this relatively easily in Jekyll? I've seen some stuff using nested collections, but it's pretty messy and manual.

what does marking directory as resource root do

I have the following project structure:
root
- pics
- less
- main
- components
- navbar.less
In my navbar.less I reference image from the pics folder like this:
background : url('../pics/dtv-logo.jpg') no-repeat;
The reason for specifying the path like that is that when deployed to server the project structure will be like this one:
root
- pics
- css
- index.css
So the path will correct when deployed. However, webstorm says it can't find resource, which is also correct given current folders structure. I googled and found that I can mark directory as resources. I did that but webstorm still complains. Can you explain what marking directory as resource root does and how can I solve my problem?
Example #2:
- css
- pics
- assets
- some_logo.png
Marking assets as resourceRoot and specifying URL like this '/assets/dtv-logo.jpg' still failed to resolve the path.