champorado
  • 2022-11-18 19:34:31 +0800 +0800
    champorado

    champorado

    2022.11.18

    Youtube/Invidious embed

    Added in the same way as video embed

    <style>
      .videoWrapper {
        position: relative;
        padding-bottom: 56.25%; /* 16:9 */
        height: 0;
      }
      .videoWrapper iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
      }
    </style>
    
    
    <div style="padding-top: 1em;">
      <div class="videoWrapper">
          <iframe width="100%" src="https://youtube.076.ne.jp/embed/{{.Get 0}}"></iframe>
      </div>
    
      <div style="padding-top: 0.5em;">
        <small>
          <a href="https://www.youtube.com/watch?v={{.Get 0}}">youtube</a>
          &nbsp; · &nbsp; <a href="">invidious</a>
        </small>
      </div>
    </div>
    

    Replace [INSERT INVIDIOUS INSTANCE] with any site from the instance list

    This was copied from CSS-Tricks


    Useable by writing {{\<invidious "VIDEO ID">}} in the post without the backslash

    Video ID is what follows watch?v= in a youtube URL.

    Example:

    https://www.youtube.com/watch?v=WrFJdfYTH9w
    

    The ID is WrFJdfYTH9w

    Writing {{\<invidious "WrFJdfYTH9w">}} without the backslash results in the following:

    youtube   ·   invidious
    2022-11-18 19:34:31 +0800 +0800 2022.11.18