Skip to content

Commit aa2bf6a

Browse files
committed
#9 Add support for video/audio tags to the README
1 parent 5ed6152 commit aa2bf6a

File tree

1 file changed

+36
-25
lines changed

1 file changed

+36
-25
lines changed

README.md

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,44 +23,55 @@ plugins: [
2323
{
2424
resolve: 'gatsby-transformer-remark',
2525
options: {
26-
plugins: ['gatsby-remark-copy-relative-linked-files']
27-
}
28-
}
26+
plugins: ['gatsby-remark-copy-relative-linked-files'],
27+
},
28+
},
2929
]
3030
```
3131

32-
*Note:* When using the `copyfiles` code fence (see below), `gatsby-remark-copy-relative-linked-files` must appear before general purpose code fence processors like `gatsby-remark-prismjs`.
32+
_Note:_ When using the `copyfiles` code fence (see below), `gatsby-remark-copy-relative-linked-files` must appear before general purpose code fence processors like `gatsby-remark-prismjs`.
3333

3434
Then in your Markdown files, simply reference the files.
3535

3636
### E.g.
3737

38-
```markdown
39-
---
40-
title: My awesome blog post
41-
---
38+
````markdown
39+
---
40+
title: My awesome blog post
41+
---
4242

43-
Hey everyone, I just made a sweet files with lots of interesting stuff in
44-
it.
43+
Hey everyone, I just made a sweet files withlots of interesting stuff in
44+
it.
4545

46-
- ![](image.gif)
47-
- [archive.zip](archive.zip)
48-
- [sample.pdf](sample.pdf)
49-
- [report.html](report.html)
50-
- [not-copy.rar](https://example.com/not-copy.rar)
46+
- ![](image.gif)
47+
- [archive.zip](archive.zip)
48+
- [sample.pdf](sample.pdf)
49+
- [report.html](report.html)
50+
- [not-copy.rar](https://example.com/not-copyrar)
5151

52-
```copyfiles
53-
report.css
54-
diagram.png
55-
```
52+
```copyfiles
53+
report.css
54+
diagram.png
5655
```
5756

57+
<audio src="sample.mp3" controls></audio>
58+
<video src="sample.mp4" controls></video>
59+
<video controls>
60+
61+
<source src="sample2.mp4" type="video/mp4">
62+
</video>
63+
````
64+
5865
`image.gif`, `archive.zip`, `sample.pdf` and `report.html` should be in the same directory as the Markdown file. When you build your site, the file will be copied to the public folder and the markdown HTML will be modified to point to it.
5966

6067
Similarly, `report.css` and `diagram.png` should be in the same directory as the Markdown file. In this example, `report.html` has its own internal relative links to these files. `report.html` is not changed in any way. The relative links to the copied files work from the copied location.
6168

6269
The copy target is a relative link. Therefore, links starting with `XXXX://` or `//` are ignored. In this example `not-copy.rar` is not copied.
6370

71+
**v1.1.0**
72+
73+
[Pull request](https://github.com/akabekobeko/npm-gatsby-remark-copy-relative-linked-files/pull/8) by [karlhorky](https://github.com/karlhorky) also copied the `src` attribute of `<audio>`/`<video>`/`<source>` tag.
74+
6475
## Options
6576

6677
```js
@@ -77,12 +88,12 @@ plugins: [
7788
// ignoreFileExtensions: ['.md']
7889

7990
// These files will not be copied
80-
ignoreFileExtensions: ['.md', '.pdf', '.d.ts']
81-
}
82-
}
83-
]
84-
}
85-
}
91+
ignoreFileExtensions: ['.md', '.pdf', '.d.ts'],
92+
},
93+
},
94+
],
95+
},
96+
},
8697
]
8798
```
8899

0 commit comments

Comments
 (0)