Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YouTube link rendering as normal inline code #1

Open
FilledStacks opened this issue Apr 26, 2019 · 5 comments
Open

YouTube link rendering as normal inline code #1

FilledStacks opened this issue Apr 26, 2019 · 5 comments

Comments

@FilledStacks
Copy link

I'm trying to use the format as described in the docs but my video still renders as normal markdown code.

My Markdown

`youtube:https://youtu.be/fZuLh-oc5Ao`

gridsome.config.js

// This is where project configuration and plugin options are located. 
// Learn more: https://gridsome.org/docs/config

// Changes here requires a server restart.
// To restart press CTRL + C in terminal and run `gridsome develop`

module.exports = {
  siteName: 'FilledStacks',
  siteDescription: 'Flutter and Mobile development tutorials and guides',

  plugins: [
    {
      // Create posts from markdown files
      use: '@gridsome/source-filesystem',
      options: {
        typeName: 'Post',
        path: 'content/posts/*.md',
        route: '/:slug',
        refs: {
          // Creates a GraphQL collection from 'tags' in front-matter and adds a reference.
          tags: {
            typeName: 'Tag',
            route: '/tag/:id',
            create: true
          }
        },
        remark: {
          plugins: [
            ['gridsome-plugin-remark-youtube']
          ]
        }
      }
    }
  ],

  transformers: {
    //Add markdown support to all file-system sources
    remark: {
      externalLinksTarget: '_blank',
      externalLinksRel: ['nofollow', 'noopener', 'noreferrer'],
      anchorClassName: 'icon icon-link',
      plugins: [
        '@gridsome/remark-prismjs',
      ]
    }
  },
}

It might be because of the other remark config but I have tried to put the plugin inside the transformers section and also outside the options. Neither of those two things works.

@FilledStacks
Copy link
Author

I removed the plugin and used an embed url instead. I add an embedded youtube url into my post frontmatter section and then use that to render in my post view. Couldn't get the plugin to work. Gonna leave this open because it does seem like a glaring bug.

@narration-sd
Copy link

narration-sd commented May 13, 2019

Having the same result this afternoon -- no variations appear to function...?

For the current case, better anyway to use a <video ...> tag in the markdown, with a live mp4. This works well.

A point is that you need to use this expanded form, <video ...>, rather than <video ... />, or remark will eliminate anything following in the .md file.

@FilledStacks
Copy link
Author

@narration-sd Thanks. I didn't even use the

@narration-sd
Copy link

@FilledStacks That;s kind of how I thought you'd done, and got yourself on the air. I actually think there's a lot of opportunity for plugins of this nature.

To have that, they'll need to keep up with Gridsome so they're reliable in working, and also allow the range of options we'd expect for the content -- preload, poster, etc. for video, and ease of strapping in css tags and format systems such as Flex and Grid.

One can see this coming, for what you'd really want to do with Markdown content - in Gridsome, a very nice way of extending on that, without altering Markdown itself.

@FilledStacks
Copy link
Author

@narration-sd yes. Lot's of opportunities here for plugins, it's also pretty simple to implement. I might tackle this exact plugin and make it more reliable. Or just fix and submit a pull request to fix the issue of it not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants