---
layout: default
---
{%- assign pg = page.url | split: "." -%}
{%- assign id = pg.first | split: "/"  | last  | minus: 1 -%}
{%- assign tip = site.data.tips[id] -%}
{%- assign prevId = tip.id | minus: 1 -%}
{%- assign nextId = tip.id | plus: 1 -%}
<nav id="main-btns">
    <ul class="nav-list">
        <li class="nav-1">
            <button type="button" class="nav-btn"><a href="../index" class="button">Back to list of tips</a></button>
        </li>
        <li class="nav-2">
            <button type="button" class="nav-btn"><a href="https://delphidabbler.com">DelphiDabbler.com</a></button>
        </li>
    </ul>
</nav>

<script async src="https://cse.google.com/cse.js?cx=9b61e9db5f8c5a818"></script>
<div class="gcse-search"></div>

<div id="wrapper">

<nav class="nav-btns nav-btns-top">
    <ul class="nav-list">
        <li class="nav-1">
            {%- if prevId >= 1 -%}
            <button type="button" class="nav-btn"><a href="./{{ prevId }}" class="button">Previous Tip</a></button>
            {%- else -%}
            <button type="button" class="nav-btn xdisabled" disabled>Previous Tip</button>
            {%- endif %}
        </li>
        <li class="nav-2">
            {%- if nextId <= site.data.tips.size -%}
            <button type="button" class="nav-btn"><a href="./{{ nextId }}">Next Tip</a></button>
            {%- else -%}
            <button type="button" class="nav-btn xdisabled" disabled>Next Tip</button>
            {%- endif %}
        </li>
    </ul>
</nav>

<h1>
    {{ tip.title | escape }} <span class="badge badge-dark"><small>#{{ tip.id | escape }}</small></span>
</h1>

<!-- BEGIN CONTENT -->
{{ content }}
<!--END CONTENT -->

<nav class="nav-btns nav-btns-bottom">
    <ul class="nav-list">
        <li class="nav-1">
            {%- if prevId >= 1 -%}
            <button type="button" class="nav-btn"><a href="./{{ prevId }}" class="button">Previous Tip</a></button>
            {%- else -%}
            <button type="button" class="nav-btn xdisabled" disabled>Previous Tip</button>
            {%- endif %}
        </li>
        <li class="nav-2">
            {%- if nextId <= site.data.tips.size -%}
            <button type="button" class="nav-btn"><a href="./{{ nextId }}">Next Tip</a></button>
            {%- else -%}
            <button type="button" class="nav-btn xdisabled" disabled>Next Tip</button>
            {%- endif %}
        </li>
    </ul>
</nav>

<table class="infotable">
    {% if tip.resource != "" -%}
    <tr>
        <th scope="row">Original resource:</th>
        {%- if tip.resource_website != "" %}
        <td><a href="{{tip.resource_website}}" target="_blank">{{ tip.resource | escape }}</a></td>
        {%- else %}
        <td>{{ tip.resource | escape }}</td>
        {%- endif %}
    </tr>
    {% endif -%}
    <tr>
        <th scope="row">Author:</th>
        {% if tip.author != "" -%}
        {%- if tip.author_website != "" -%}
        <td><a href="{{tip.author_website}}" target="_blank">{{ tip.author | escape }}</a></td>
        {%- else -%}
        <td>{{ tip.author | escape }}</td>
        {%- endif -%}
        {%- else -%}
        <td>Unknown</td>
        {%- endif %}
    </tr>
    {% if tip.contributor != "" -%}
    <tr>
        <th scope="row">Contributor:</th>
        {%- if tip.contributor_website != "" %}
        <td><a href="{{tip.contributor_website}}" target="_blank">{{ tip.contributor | escape }}</a></td>
        {%- else %}
        <td>{{ tip.contributor | escape }}</td>
        {%- endif %}
    </tr>
    {% endif -%}
    <tr>
        <th scope="row">Added:</th>
        <td>{{ tip.added | date: "%Y/%m/%d"  | escape }}</td>
    </tr>
    <tr>
        <th scope="row">Last updated:</th>
        <td>{{ tip.updated | date: "%Y/%m/%d"  | escape }}</td>
    </tr>
</table>

</div> <!-- /#wrapper -->
