Skip to content

Images don't get published with the Action #8

@balint-bg

Description

@balint-bg

Hello,
I really like the idea of automatically converting my markdown to html and publishing them to GH pages via this action. Unfortunately I couldn't get images working.
I had a really basic setup, one of my markdown slides had images in it, using the normal syntax of:

Some text: ![](image_file_name.png)
Some other text: ![](some_other_image_file.png)

I've tried a number of iterations:

  • like above, having the image files in the same directory as the markdown file itself
  • putting the images in a <path_to_markdown_file>/docs/assets/images directory and using docs/assets/images/image_file_name.png inside the parens in my slides
  • putting the images in a <repo_root>/docs/assets/images directory
  • putting the images in a <repo_root>/img directory
    (the latter two make sense for not working I guess as my --input_dir doesn't contain the repo's root, see below)

None of which worked 😞

If i don't use this action, but commit my markdown slides to the gh-pages branch directly, the images do show up. But if I use the action, commit to devel and have the Action convert and publish then the images become broken links, with a 404 error.

I'm using the master version of your plugin. Here's my action config file:

# This is a basic workflow to help you get started with Actions

name: Publish Pages

# Controls when the action will run.
# Triggers the workflow on push events for the devel branch
on:
  workflow_dispatch:
  push:
    branches:
      - devel

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # TODO(balint) move to self hosted runners once the repo is allowed to use them
    # runs-on: [self-hosted]
    runs-on: ubuntu-latest
    - uses: actions/checkout@v2
    - name: Build & Deploy to GitHub Pages
      env:
        MARP_ARGS: "--input-dir markdown_slides/ --output docs/"
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        GITHUB_REPOSITORY: ${{ github.repository }}
        PUBLISH_TO_BRANCH: gh-pages

        # You'll want to set this to your domain
        BASE_URL: <my base URL is here>

      # consider using a tagged release here
      # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsuses
      uses: ralexander-phi/marp-action@master

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions