Skip to content

Commit

Permalink
deploy: dce0c77
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jul 12, 2024
1 parent c82029e commit 6aeef33
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions docs/data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,17 @@ <h1><a href="/">
</aside>
<main>
<h2>Data Files</h2>
<p>Cobalt supports loading <a href="http://yaml.org">yaml</a>, <a href="http://json.org">json</a>, and
<a href="https://github.com/toml-lang/toml.html">toml</a> from <a href="/docs/directory"><code>_data</code></a>
and making it available as <a href="/docs/variables"><code>site.data.&lt;DIR&gt;.&lt;FILE&gt;</code></a>.</p>
<p>Cobalt reads data from any <a href="http://yaml.org">yaml</a>, <a href="http://json.org">json</a>, and
<a href="https://github.com/toml-lang/toml.html">toml</a> files in the <a href="/docs/directory"><code>_data</code> directory</a>
and merges them into the <a href="/docs/variables"><code>site.data</code></a> variable, making
them available as <code>site.data.&lt;DIR&gt;.&lt;FILE&gt;</code>.</p>
<h3>Example</h3>
<p>In <code>_data/animals/dogs.yml</code>:</p>
<pre style="background-color:#2b303b;">
<code><span style="color:#c0c5ce;">- </span><span style="color:#bf616a;">name</span><span style="color:#c0c5ce;">: </span><span style="color:#a3be8c;">Corgi
</span><span style="color:#c0c5ce;">- </span><span style="color:#bf616a;">name</span><span style="color:#c0c5ce;">: </span><span style="color:#a3be8c;">Malamute
</span></code></pre>
<p>which can be accessed via <code>site.data.animals.dogs</code>.</p>
<p>which liquid templates can access via <code>site.data.animals.dogs</code>.</p>
<p>You can now render the list in a template:</p>
<pre style="background-color:#2b303b;">
<code><span style="color:#c0c5ce;">&lt;</span><span style="color:#bf616a;">ul</span><span style="color:#c0c5ce;">&gt;
Expand Down
2 changes: 1 addition & 1 deletion docs/directory/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h2>Directory Structure</h2>
<tr><td><code>_cobalt.yml</code></td><td>Site-wide <a href="/docs/config">configuration</a> file</td></tr>
<tr><td><code>_layouts</code></td><td><a href="/docs/layouts">Templates</a> that wrap pages. The layout is chosen in the <a href="/docs/pages">frontmatter</a></td></tr>
<tr><td><code>_includes</code></td><td>Liquid snippets of content to be shared among <a href="/docs/layouts">layouts</a> or pages.</td></tr>
<tr><td><code>_data</code></td><td>Data files that will be loaded as part of the <code>{{ site.data }}</code> variable.</td></tr>
<tr><td><code>_data</code></td><td><a href="/docs/data">Data files</a> in this directory are loaded as part of the <code>{{ site.data }}</code> <a href="/docs/variables">variable</a>.</td></tr>
<tr><td><code>_sass</code></td><td>Sass snippets that can be imported into your <code>.scss</code> files.</td></tr>
<tr><td><code>_site</code></td><td>The output directory of cobalt. Can be modified in <a href="/docs/config"><code>_cobalt.yml</code></a>.</td></tr>
<tr><td><code>_defaults</code></td><td><code>cobalt new</code> initializes files from here based on the collection name.</td></tr>
Expand Down
2 changes: 1 addition & 1 deletion docs/variables/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h3>Site Variables</h3>
<tr><td><code>site.title</code></td><td>String</td><td>The title of the entire site, see <a href="/docs/config"><code>_cobalt.yml</code></a>.</td></tr>
<tr><td><code>site.description</code></td><td>String</td><td>The description of the entire site, see <a href="/docs/config"><code>_cobalt.yml</code></a>.</td></tr>
<tr><td><code>site.base_url</code></td><td>String</td><td>The URL of your site, see <a href="/docs/config"><code>_cobalt.yml</code></a>. This is helpful for making absolute URLs, particularly when run within <a href="/docs/usage"><code>cobalt serve</code></a>.</td></tr>
<tr><td><code>site.data</code></td><td>Object</td><td>The merged result of <a href="/docs/directory"><code>_data</code></a> and <a href="/docs/config"><code>site: data</code></a>.</td></tr>
<tr><td><code>site.data</code></td><td>Object</td><td>The merged result of <a href="/docs/data">data files</a> in the <a href="/docs/directory"><code>_data</code></a> directory and <a href="/docs/config"><code>site: data</code></a> in <code>_cobalt.yml</code>.</td></tr>
<tr><td><code>site.time</code></td><td>DateTime</td><td>A <code>liquid_core::model::DateTime</code> representing the time of the website re-generation.</td></tr>
</tbody></table>
<h3>Page Variables</h3>
Expand Down

0 comments on commit 6aeef33

Please sign in to comment.