<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">

<title>class Jekyll::Drops::SiteDrop - RDoc Documentation</title>

<script type="text/javascript">
  var rdoc_rel_prefix = "../../";
  var index_rel_prefix = "../../";
</script>

<script src="../../js/navigation.js" defer></script>
<script src="../../js/search.js" defer></script>
<script src="../../js/search_index.js" defer></script>
<script src="../../js/searcher.js" defer></script>
<script src="../../js/darkfish.js" defer></script>

<link href="../../css/fonts.css" rel="stylesheet">
<link href="../../css/rdoc.css" rel="stylesheet">


<body id="top" role="document" class="class">
<nav role="navigation">
  <div id="project-navigation">
    <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2>
    <a href="../../index.html" rel="home">Home</a>
  </h2>

  <div id="table-of-contents-navigation">
    <a href="../../table_of_contents.html#pages">Pages</a>
    <a href="../../table_of_contents.html#classes">Classes</a>
    <a href="../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

    <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

  </div>

  

  <div id="class-metadata">
    
    
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="Drop.html">Jekyll::Drops::Drop</a>
</div>

    
    
<div id="extends-section" class="nav-section">
  <h3>Extended With Modules</h3>

  <ul class="link-list">
    <li><span class="extend">Forwardable</span>
  </ul>
</div>

    
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li class="calls-super" ><a href="#method-i-5B-5D">#[]</a>
    <li ><a href="#method-i-collections">#collections</a>
    <li ><a href="#method-i-config">#config</a>
    <li ><a href="#method-i-documents">#documents</a>
    <li ><a href="#method-i-html_pages">#html_pages</a>
    <li class="calls-super" ><a href="#method-i-key-3F">#key?</a>
    <li ><a href="#method-i-posts">#posts</a>
    <li ><a href="#method-i-related_posts">#related_posts</a>
  </ul>
</div>

  </div>
</nav>

<main role="main" aria-labelledby="class-Jekyll::Drops::SiteDrop">
  <h1 id="class-Jekyll::Drops::SiteDrop" class="class">
    class Jekyll::Drops::SiteDrop
  </h1>

  <section class="description">
    
  </section>

  <section id="5Buntitled-5D" class="documentation-section">



    <section class="attribute-method-details" class="method-section">
      <header>
        <h3>Attributes</h3>
      </header>

      <div id="attribute-i-current_document" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">current_document</span><span
            class="attribute-access-type">[W]</span>
        </div>

        <div class="method-description">
        
        </div>
      </div>
    </section>


     <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
       <header>
         <h3>Public Instance Methods</h3>
       </header>

      <div id="method-i-5B-5D" class="method-detail ">
        <div class="method-heading">
          <span class="method-name">[]</span><span
            class="method-args">(key)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>

        <div class="method-description">
          
            <div class="method-calls-super">
              Calls superclass method
              <a href="Drop.html#method-i-5B-5D"><code>Jekyll::Drops::Drop#[]</code></a>
            </div>

          <div class="method-source-code" id="5B-5D-source">
            <pre><span class="ruby-comment"># File jekyll/drops/site_drop.rb, line 15</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">[]</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">!=</span> <span class="ruby-string">&quot;posts&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@obj</span>.<span class="ruby-identifier">collections</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">key</span>)
    <span class="ruby-ivar">@obj</span>.<span class="ruby-identifier">collections</span>[<span class="ruby-identifier">key</span>].<span class="ruby-identifier">docs</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">super</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div>
        </div>


      </div>

      <div id="method-i-collections" class="method-detail ">
        <div class="method-heading">
          <span class="method-name">collections</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>

        <div class="method-description">
          

          <div class="method-source-code" id="collections-source">
            <pre><span class="ruby-comment"># File jekyll/drops/site_drop.rb, line 37</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">collections</span>
  <span class="ruby-ivar">@site_collections</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@obj</span>.<span class="ruby-identifier">collections</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">sort_by</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:label</span>).<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:to_liquid</span>)
<span class="ruby-keyword">end</span></pre>
          </div>
        </div>


      </div>

      <div id="method-i-config" class="method-detail ">
        <div class="method-heading">
          <span class="method-name">config</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>

        <div class="method-description">
          <p>return nil for `{{ site.config }}` even if –config was passed via CLI</p>

          <div class="method-source-code" id="config-source">
            <pre><span class="ruby-comment"># File jekyll/drops/site_drop.rb, line 63</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">config</span>; <span class="ruby-keyword">end</span></pre>
          </div>
        </div>


      </div>

      <div id="method-i-documents" class="method-detail ">
        <div class="method-heading">
          <span class="method-name">documents</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>

        <div class="method-description">
          <p>`Site#documents` cannot be memoized so that `Site#docs_to_write` can access the latest state of the attribute.</p>

<p>Since this method will be called after `Site#pre_render` hook, the `Site#documents` array shouldn&#39;t thereafter change and can therefore be safely memoized to prevent additional computation of `Site#documents`.</p>

          <div class="method-source-code" id="documents-source">
            <pre><span class="ruby-comment"># File jekyll/drops/site_drop.rb, line 47</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">documents</span>
  <span class="ruby-ivar">@documents</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@obj</span>.<span class="ruby-identifier">documents</span>
<span class="ruby-keyword">end</span></pre>
          </div>
        </div>


      </div>

      <div id="method-i-html_pages" class="method-detail ">
        <div class="method-heading">
          <span class="method-name">html_pages</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>

        <div class="method-description">
          

          <div class="method-source-code" id="html_pages-source">
            <pre><span class="ruby-comment"># File jekyll/drops/site_drop.rb, line 31</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">html_pages</span>
  <span class="ruby-ivar">@site_html_pages</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@obj</span>.<span class="ruby-identifier">pages</span>.<span class="ruby-identifier">select</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">page</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">page</span>.<span class="ruby-identifier">html?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">page</span>.<span class="ruby-identifier">url</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-string">&quot;/&quot;</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div>
        </div>


      </div>

      <div id="method-i-key-3F" class="method-detail ">
        <div class="method-heading">
          <span class="method-name">key?</span><span
            class="method-args">(key)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>

        <div class="method-description">
          
            <div class="method-calls-super">
              Calls superclass method
              <a href="Drop.html#method-i-key-3F"><code>Jekyll::Drops::Drop#key?</code></a>
            </div>

          <div class="method-source-code" id="key-3F-source">
            <pre><span class="ruby-comment"># File jekyll/drops/site_drop.rb, line 23</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">key?</span>(<span class="ruby-identifier">key</span>)
  (<span class="ruby-identifier">key</span> <span class="ruby-operator">!=</span> <span class="ruby-string">&quot;posts&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@obj</span>.<span class="ruby-identifier">collections</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">key</span>)) <span class="ruby-operator">||</span> <span class="ruby-keyword">super</span>
<span class="ruby-keyword">end</span></pre>
          </div>
        </div>


      </div>

      <div id="method-i-posts" class="method-detail ">
        <div class="method-heading">
          <span class="method-name">posts</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>

        <div class="method-description">
          

          <div class="method-source-code" id="posts-source">
            <pre><span class="ruby-comment"># File jekyll/drops/site_drop.rb, line 27</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">posts</span>
  <span class="ruby-ivar">@site_posts</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@obj</span>.<span class="ruby-identifier">posts</span>.<span class="ruby-identifier">docs</span>.<span class="ruby-identifier">sort</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">b</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">a</span> }
<span class="ruby-keyword">end</span></pre>
          </div>
        </div>


      </div>

      <div id="method-i-related_posts" class="method-detail ">
        <div class="method-heading">
          <span class="method-name">related_posts</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>

        <div class="method-description">
          <p>`{{ site.related_posts }}` is how posts can get posts related to them, either through LSI if it&#39;s enabled, or through the most recent posts. We should remove this in 4.0 and switch to `{{ post.related_posts }}`.</p>

          <div class="method-source-code" id="related_posts-source">
            <pre><span class="ruby-comment"># File jekyll/drops/site_drop.rb, line 55</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">related_posts</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@current_document</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Jekyll</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span>)

  <span class="ruby-ivar">@current_document</span>.<span class="ruby-identifier">related_posts</span>
<span class="ruby-keyword">end</span></pre>
          </div>
        </div>


      </div>

    </section>

  </section>
</main>


<footer id="validator-badges" role="contentinfo">
  <p><a href="https://validator.w3.org/check/referer">Validate</a>
  <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.1.
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>


{'avg_line_length': 42.808510638297875, 'max_line_length': 524, 'alphanum_fraction': 0.6304316955410395, 'licenses': ['MIT'], 'repository_name': 'victorbnl/jekyll-doc', 'path': 'Jekyll/Drops/SiteDrop.html', 'size': 14086, 'lang': 'HTML'}