English 中文(简体)
• 如何将录像带入高射标记博客[封闭]
原标题:how to include video in jekyll markdown blog [closed]

This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.

Closed 5 months ago.

我刚刚开始使用高射线进行博客。 我写上我的职称。 我现在想把YouTube录像带入我的岗位。 我如何能够这样做?

我真的不喜欢用幻灯片突出地显示,气壳不成事实。 我是否可以把这改用其他风格? 如果是的话,你能否给我看一看某些冰帽/pl子?

最佳回答

你们应当能够把“超文本”直接插入你的标记。 在录像中,有一个“Share”纽芬兰语,对此进行了点击,然后是“Embed”纽芬兰语,这应该给你看上去的东西:

<iframe width="420" height="315" src="http://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allowfullscreen></iframe>

Just copy and paste that into your post, the Markdown preprocessor won t touch it.


对于Pygments,在上,有一整块CSS风格表格,可对其进行试验。 (请注意,您须将<代码>.codehilite改为

问题回答

I did similar thing but in my case, simple copy and paste doesn t work. The error message is below:

REXML不能将XML/超文本混为一谈:

To avoid this error, I deleted allowfullscreen from copied source as below:

<iframe width="480" height="360" src="http://www.youtube.com/embed/WO82PoAczTc" frameborder="0"> </iframe>

在封闭式<代码></iframe>之前添加一个白色空间非常重要。

然后,我成功地将录像带入我的现场。

在我的案件上,由议会解决:

http://www.ohchr.org。

$( .x-frame.video ).each(function() {
  $(this).after("<iframe class="video" src="" + ($(this).attr( data-video )) + "" frameborder="0"></iframe>");
});

<>Usage>

<div class="x-frame video" data-video="http://player.vimeo.com/video/52302939"> </div>

请注意,在<条码>和>、div>之间需要白色空间;

言行的恶性特征之一是,你可以仅仅在内容(新行)上接过YouP URL,而言语则将这一内容变成了一种嵌入式的法典。

The following Code does the same for Jekyll. 只是把这一守则放在你的脚步中(或使用一个焦车包括),而所有与JUST有关的段落都自动转化为Vanilla JS的响应性贵管。

<style>
.videoWrapper {position: relative; padding-bottom: 56.333%; height: 0;}
.videoWrapper iframe {position: absolute; top: 0; left: 0; width: 100%; height: 100%;}    
</style>

<script>
function getId(url) {
    var regExp = /^.*(youtu.be/|v/|u/w/|embed/|watch?v=|&v=)([^#&?]*).*/;
    var match = url.match(regExp);
    if (match && match[2].length == 11) {
        return match[2];
    } else {
        return  error ;
    }
}
function yt_url2embed() {
    var p = document.getElementsByTagName( p );
    for(var i = 0; i < p.length; i++) {
        var pattern = /^((http|https|ftp)://)/;
        if(pattern.test(p[i].innerHTML)) {
            var myId = getId(p[i].innerHTML);
            p[i].innerHTML =  <div class="videoWrapper"><iframe width="720" height="420" src="https://www.youtube.com/embed/  + myId +  ?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe></div> ;
        }
    }
}
yt_url2embed();
</script>

虽然仅仅在你的标记上添加“超文本”是很好(也许更好)和有效的解决办法,但这一解决办法可能更加方便用户。

(Source )





相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签