<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mask0702</author_name>
  <author_url>https://blog.hatena.ne.jp/mask0702/</author_url>
  <blog_title>くわこのpermission denied.</blog_title>
  <blog_url>https://mask.hatenadiary.com/</blog_url>
  <categories>
    <anon>twig</anon>
  </categories>
  <description>twigでランダムに配列や数値を出す方法を調べたのでシェア今回の僕の場合、 &lt;img href=&quot;/img/img_01.jpg&quot;&gt; 上みたいなときに、ランダムでimg_02.jpgやimg_03.jpgを出すように言われました。この場合、 &lt;img href=&quot;/img/img_0{{random(2) + 1}}.jpg&quot;&gt; でうまくいきます。random(n) は0 ~ n-1までの数値を出すので、今回のように1 ~ nを出したい場合は +1する必要があります。 ちなみに他の使い方もできて、ドキュメントには配列からランダムに選ぶ方法なども載ってます。参考URL random - Docu…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmask.hatenadiary.com%2Fentry%2F2015%2F06%2F16%2F140750&quot; title=&quot;twigでランダムに配列や数値を選ぶ - くわこのpermission denied.&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>http://cdn-ak.f.st-hatena.com/images/fotolife/m/mask0702/20150605/20150605194023.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2015-06-16 14:07:50</published>
  <title>twigでランダムに配列や数値を選ぶ</title>
  <type>rich</type>
  <url>https://mask.hatenadiary.com/entry/2015/06/16/140750</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
