Jekyll Github actions

Hi Team I have list of markdown files for documentation purpose. I’m planning to build github pages website with Jekyll and github actions for deployment. I have created base template for the project and I am able to build and deploy basic website but I’m facing 3 issues.

  1. Relative path links not working
  2. I want to make home.md as my main markdown file how can I do that
    3.Do I need the front matter lines (—) I have hundreds of files so I can’t add — lines to all files
    My github repository is: GitHub - vanamsandeep/testrepo

_config.yml file:
title: “Jekyll Actions Demo”

source: [‘docs’]
include: [‘docs’]
#theme: minima
plugins:

  • jekyll-timeago
  • jekyll-relative-links

GitHub action yaml file:
name: Build and deploy Jekyll site to GitHub Pages

on:
push:
branches:
- main

jobs:
github-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles(’**/Gemfile’) }}
restore-keys: |
${{ runner.os }}-gems-
- uses: helaili/jekyll-action@2.3.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
jekyll_src: ‘docs’


Index.md file


I can’t add 3 dashes(- - -) to all the .md files how can I tell github actions to compile all my md files to html without adding front matter lines.

Jekyll is designed to generate files meant to be served via a webserver. So all local links need to be relative to the root of your webserver.
For use inside Markdown files, use {% link path/to/file %}. For use in layouts and includes, use relative_url Liquid filter in conjunction with the document’s URL:
{{ page.url | relative_url }}.

Remove any ./index.md or ./index.html and set permalink: "/" in ./home.md.

Out of the box, Jekyll requires front matter.
But you may use the plugin jekyll-optional-front-matter to override the requirement.

Thank you @ashmaroli . It worked…

@ashmaroli, When I’m working with github actions and I need to raise the PR every time and push the changes to master to view the changes. Is there any plugin/way to run the github actions-locally. Because when I run locally with bundle exec jekyll serve it won’t work as github actions. Can you please help me with how to run it locally the above project.

That’s how GitHub Pages and GitHub Actions work.
I don’t know if GitHub Actions can be run locally.
However, running bundle exec jekyll serve --source docs should work equivalent to the remote build.