Skip to content

Commit

Permalink
refactor: move site-specific data to _data
Browse files Browse the repository at this point in the history
  • Loading branch information
gvwilson committed Feb 3, 2024
1 parent 6e77f24 commit 4650b01
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
9 changes: 0 additions & 9 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
title: SQL for Data Scientists in 100 Queries
url: https://gvwilson.github.io/sql-tutorial/
repository: gvwilson/sql-tutorial

author:
name: Greg Wilson
url: https://third-bit.com
email: [email protected]

markdown: kramdown
highlighter: rouge

Expand Down
8 changes: 8 additions & 0 deletions _data/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: SQL for Data Scientists in 100 Queries
url: https://gvwilson.github.io/sql-tutorial/
repo: https://github.com/gvwilson/sql-tutorial

author:
name: Greg Wilson
url: https://third-bit.com
email: [email protected]
6 changes: 3 additions & 3 deletions _includes/foot.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<footer>
<i class="fa fa-copyright"></i> <time datetime="{{ site.time | date_to_xmlschema }}">{{ site.time | date: '%Y' }}</time> {{ site.author.name }}
<i class="fa fa-copyright"></i> <time datetime="{{ site.time | date_to_xmlschema }}">{{ site.time | date: '%Y' }}</time> {{ site.data.meta.author.name }}
&middot;
<a href="mailto:{{site.author.email}}"><i class="fas fa-envelope-square" aria-hidden="true" title="author email"></i></a>
<a href="/{{site.repository}}"><i class="fab fa-github" aria-hidden="true" title="GitHub repository"></i></a>
<a href="mailto:{{site.data.meta.author.email}}"><i class="fas fa-envelope-square" aria-hidden="true" title="author email"></i></a>
<a href="{{site.repo}}"><i class="fab fa-github" aria-hidden="true" title="GitHub repository"></i></a>
<a href="{{'/license/' | relative_url}}"><i class="fab fa-creative-commons-by" aria-hidden="true" title="license"></i></a>
</footer>
2 changes: 1 addition & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
<link rel="stylesheet" href="{{ '/res/tango.css' | relative_url }}" type="text/css">
<link rel="stylesheet" href="{{ '/res/site.css' | relative_url }}" type="text/css">
<script defer src="{{ '/res/site.js' | relative_url }}"></script>
<title>{{ site.title }}{% unless page.home %} &middot; {{ page.title }}{% endunless %}</title>
<title>{{ site.data.meta.title }}{% unless page.home %} &middot; {{ page.title }}{% endunless %}</title>
2 changes: 1 addition & 1 deletion _includes/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<a class="navlink" href="{{'/' | relative_url}}">Home</a>
</div>
<div class="col-10 right">
<a href="/{{site.repository}}">repo</a>
<a href="{{site.data.meta.repo}}">repo</a>
<a class="navlink" href="{{ '/license/' | relative_url }}">license</a>
<a class="navlink" href="{{ '/conduct/' | relative_url }}">conduct</a>
<a class="navlink" href="{{ '/contributing/' | relative_url }}">contributing</a>
Expand Down
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<body>
{% include nav.html %}
<main>
<h1>{% if page.home %}{{ site.title }}{% else %}{{ page.title }}{% endif %}</h1>
<h1>{% if page.home %}{{ site.data.meta.title }}{% else %}{{ page.title }}{% endif %}</h1>
{{ content }}
</main>
{% include foot.html %}
Expand Down

0 comments on commit 4650b01

Please sign in to comment.