Skip to content

Commit

Permalink
#189 Remove 'theme_settings' for direct access via site
Browse files Browse the repository at this point in the history
  • Loading branch information
sylhare committed Sep 21, 2019
1 parent 4a814e2 commit 9684605
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 47 deletions.
49 changes: 24 additions & 25 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,30 @@ title: Type on Strap # site's title
description: "A website with blog posts and pages" # used by search engines

# THEME-SPECIFIC CONFIGURATION
theme_settings:
# Meta
avatar: assets/img/triangle.png
color_image: /assets/img/lineart.png # A bit transparent for color posts.
favicon: assets/favicon.ico

# Header and footer text
header_text: # Change Blog header text
header_feature_image: assets/img/pexels/triangular.jpeg
footer_text: >
Powered by <a href="https://jekyllrb.com/">Jekyll</a> with <a href="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/sylhare/Type-on-Strap">Type on Strap</a>
# Blog
excerpt: true # Or "truncate" (first 250 characters), "false" to disable
post_navigation: true

# Features
footer_icons: # In _data/social.yml
share_buttons: # In _data/social.yml
authors: # In _data/authors.yml
language: # In _data/language.yml
google_analytics: # Tracking ID, e.g. "UA-000000-01"
disqus_shortname: # Your discus shortname for comments
katex: true # Enable if using math markup
layout_variables: # Open the "_sass > base" folder, and open "_variables.scss"
# Images
avatar: assets/img/triangle.png # Empty for no avatar in navbar
color_image: /assets/img/lineart.png # A bit transparent for color posts.
favicon: assets/favicon.ico # Icon displayed in the tab

# Header and footer text
header_text: # Change Blog header text
header_feature_image: assets/img/pexels/triangular.jpeg
footer_text: >
Powered by <a href="https://jekyllrb.com/">Jekyll</a> with <a href="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/sylhare/Type-on-Strap">Type on Strap</a>
# Blog
excerpt: true # Or "truncate" (first 250 characters), "false" to disable
post_navigation: true

# Features
footer_icons: # In _data/social.yml
share_buttons: # In _data/social.yml
authors: # In _data/authors.yml
language: # In _data/language.yml
google_analytics: # Tracking ID, e.g. "UA-000000-01"
disqus_shortname: # Your discus shortname for comments
katex: true # Enable if using math markup
layout_variables: # Open the "_sass > base" folder, and open "_variables.scss"

# PAGINATION
paginate: 5
Expand Down
4 changes: 2 additions & 2 deletions _includes/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ <h1>
</h1>
{% include post_info.html author=post.author date=post.date %}
</header>
{% if site.theme_settings.excerpt %}
{% if site.excerpt %}
<div class="excerpt">
{% if site.theme_settings.excerpt == "truncate" %}
{% if site.excerpt == "truncate" %}
{{ post.content | strip_html | truncate: '250' | escape }}
{% else %}
{{ post.excerpt | strip_html | escape }}
Expand Down
2 changes: 1 addition & 1 deletion _includes/disqus.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = '{{ site.theme_settings.disqus_shortname }}';
var disqus_shortname = '{{ site.disqus_shortname }}';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
Expand Down
2 changes: 1 addition & 1 deletion _includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<footer class="site-footer">
<p class="text">
{{ site.theme_settings.footer_text | default: "Powered by <a href='https://jekyllrb.com/'>Jekyll</a> with <a href='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/sylhare/Type-on-Strap'>Type on Strap</a>" }}</p>
{{ site.footer_text | default: "Powered by <a href='https://jekyllrb.com/'>Jekyll</a> with <a href='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/sylhare/Type-on-Strap'>Type on Strap</a>" }}</p>
<div class="footer-icons">
<ul>
<!-- Social icons from Font Awesome, if enabled -->
Expand Down
14 changes: 7 additions & 7 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">

<!--Favicon-->
<link rel="shortcut icon" href="{{ site.theme_settings.favicon | relative_url }}" type="image/x-icon">
<link rel="shortcut icon" href="{{ site.favicon | relative_url }}" type="image/x-icon">

<!-- Canonical -->
<link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}">
Expand All @@ -31,26 +31,26 @@

<!-- KaTeX 0.8.3 -->
<!-- if you have any issue check https://github.com/KaTeX/KaTeX -->
{% if site.theme_settings.katex %}
{% if site.katex %}
<script src="{{ '/assets/js/vendor/katex.min.js' | relative_url }}"></script>
{% endif %}

<!-- Google Analytics -->
{% if site.theme_settings.google_analytics %}
{% if site.google_analytics %}
<!-- Global site tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.theme_settings.google_analytics }}"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.theme_settings.google_analytics }}');
gtag('config', '{{ site.google_analytics }}');
</script>

<!-- Page analysis (analytics.js) -->
<script async src='https://www.google-analytics.com/analytics.js'></script>
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', '{{ site.theme_settings.google_analytics }}', 'auto');
ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');
</script>
{% endif %} <!-- End Google Analytics -->
Expand All @@ -60,6 +60,6 @@
<!-- Manual seo tags -->
<!--
<title>{% if page.title %}{{ page.title }} |{% endif %} {{ site.title }}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.theme_settings.description }}{% endif %}">
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
-->
</head>
4 changes: 2 additions & 2 deletions _includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<!-- Logo and title -->
<div class="branding">
{% if site.theme_settings.avatar %}
{% if site.avatar %}
<a href="{{ '/' | relative_url }}">
<img alt="logo img" class="avatar" src="{{ site.theme_settings.avatar | relative_url }}" />
<img alt="logo img" class="avatar" src="{{ site.avatar | relative_url }}" />
</a>
{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion _includes/share_thumbnail.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
<meta property="og:type" content="article" />
<meta property="og:title" content="{{ page.title | strip_html | truncate: '250' | escape }}" />
<meta property="og:description" content="{{ page.excerpt | strip_html | truncate: '250' | escape }}" />
<meta property="og:image" content="{{ page.feature-img | default: site.theme_settings.header_feature_image }}" />
<meta property="og:image" content="{{ page.feature-img | default: site.header_feature_image }}" />
6 changes: 3 additions & 3 deletions _layouts/custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ <h1 id="{{ page.title | cgi_escape }}" class="title">{{ page.title }}</h1>
</article>

<!-- Disqus -->
{% if site.theme_settings.disqus_shortname %}
{% if site.disqus_shortname %}
<div class="comments">
{% include disqus.html %}
</div>
{% endif %}

<!-- Post navigation -->
{% if site.theme_settings.post_navigation %}
{% if site.post_navigation %}
{% include post_nav.html %}
{% endif %}
{% endif %}
4 changes: 2 additions & 2 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<div class="home">

<div id="main" class="call-out"
style="background-image: url('{{ site.theme_settings.header_feature_image | relative_url }}')">
<h1> {{ site.theme_settings.header_text | default: "Change <code>header_text</code> in <code>_config.yml</code>"}} </h1>
style="background-image: url('{{ site.header_feature_image | relative_url }}')">
<h1> {{ site.header_text | default: "Change <code>header_text</code> in <code>_config.yml</code>"}} </h1>
</div>

{% include blog.html %}
Expand Down
6 changes: 3 additions & 3 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ <h1 id="{{ page.title | cgi_escape }}" class="title">{{ page.title }}</h1>
</article>

<!-- Disqus -->
{% if site.theme_settings.disqus_shortname %}
{% if site.disqus_shortname %}
<div class="comments">
{% include disqus.html %}
</div>
{% endif %}

<!-- Post navigation -->
{% if site.theme_settings.post_navigation %}
{% if site.post_navigation %}
{% include post_nav.html %}
{% endif %}

Expand All @@ -54,6 +54,6 @@ <h1 id="{{ page.title | cgi_escape }}" class="title">{{ page.title }}</h1>
header#main {
background-repeat:no-repeat;
{% if page.feature-img %} background-image: url('{{ page.feature-img | relative_url }}');
{% elsif page.color %}background-image: url('{{ site.theme_settings.color_image | relative_url }}'); {% endif %}
{% elsif page.color %}background-image: url('{{ site.color_image | relative_url }}'); {% endif %}
}
</style>

0 comments on commit 9684605

Please sign in to comment.