diary-website

Website for diary
git clone https://git.in0rdr.ch/diary-website.git
Log | Files | Refs | README | LICENSE

commit 0cc9ae4bc671ad8b85fa707ec30539d9c39aaebf
parent b4bbe256a0b6273a6ed61c00c91f0b047594a029
Author: Andreas Gruhler <agruhl@gmx.ch>
Date:   Mon, 26 Jul 2021 00:29:41 +0200

use relative_url

Diffstat:
M_config.yml | 2+-
M_includes/comments.html | 2+-
M_includes/head.html | 16++++++++--------
M_includes/nav.html | 4++--
M_includes/post-share.html | 4++--
Mfeed.xml | 6+++---
6 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/_config.yml b/_config.yml @@ -4,7 +4,7 @@ title_right : "" # default: "" description : "Text-based journaling program" keywords : "diary, journal, text, ncurses" url : https://diary.in0rdr.ch # site url -baseurl : "https://diary.in0rdr.ch" # apply repo name like "/myproject" if used under gh-pages branch, else (under master branch) just leave empty/blank +baseurl : "" # apply repo name like "/myproject" if used under gh-pages branch, else (under master branch) just leave empty/blank cover : "" # image uri like logo/cover image for site seo google_analytics : UA-XXXXX-XX diff --git a/_includes/comments.html b/_includes/comments.html @@ -9,7 +9,7 @@ var disqus_shortname = '{{ site.disqus_shortname }}'; var disqus_identifier = '{{ page.id }}'; var disqus_title = "{{ page.title }}"; - var disqus_url = '{{ page.url | prepend: site.baseurl | prepend: site.url }}'; + var disqus_url = '{{ page.url | relative_url }}'; /*var disqus_developer = 1;*/ (function() { diff --git a/_includes/head.html b/_includes/head.html @@ -47,9 +47,9 @@ {% assign page_image = '' %} {% capture page_image %} {% if page.cover %} - {{ page.cover | prepend: site.baseurl | prepend: site.url }} + {{ page.cover | relative_url }} {% else %} - {{ site.cover | prepend: site.baseurl | prepend: site.url }} + {{ site.cover | relative_url }} {% endif %} {% endcapture %} {% capture page_image %}{{ page_image | strip | rstrip | lstrip | escape | strip_newlines }}{% endcapture %} @@ -64,7 +64,7 @@ {% else%} <meta property="og:type" content="website"> {% endif %} - <meta property="og:url" content="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}"> + <meta property="og:url" content="{{ page.url | replace:'index.html','' | relative_url }}"> <meta property="og:title" content="{{ page_title }}"> <meta property="og:image" content="{{ page_image }}"> <meta property="og:description" content="{{ page_description }}"> @@ -84,16 +84,16 @@ <meta itemprop="image" content="{{ page_image }}"> <!-- Canonical link tag --> - <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}"> - <link rel="alternate" type="application/rss+xml" title="{{ site.title_left }}{{ site.title_right }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}"> + <link rel="canonical" href="{{ page.url | replace:'index.html','' | relative_url }}"> + <link rel="alternate" type="application/rss+xml" title="{{ site.title_left }}{{ site.title_right }}" href="{{ "/feed.xml" | relative_url }}"> <!-- rel prev and next --> {% if paginator.previous_page %} - <link rel="prev" href="{{ paginator.previous_page_path | prepend: site.baseurl | prepend: site.url }}"> + <link rel="prev" href="{{ paginator.previous_page_path | relative_url }}"> {% endif %} {% if paginator.next_page %} - <link rel="next" href="{{ paginator.next_page_path | prepend: site.baseurl | prepend: site.url }}"> + <link rel="next" href="{{ paginator.next_page_path | relative_url }}"> {% endif %} - <link rel="stylesheet" href="{{ "/assets/css/main.css" | prepend: site.baseurl | prepend: site.url }}"> + <link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}"> </head> diff --git a/_includes/nav.html b/_includes/nav.html @@ -1,9 +1,9 @@ <nav class="nav"> <div class="container"> - <h1 class="logo"><a href="{{ '/' | prepend: site.baseurl | prepend: site.url }}">{{ site.title_left }}<span>{{ site.title_right }}</span></a></h1> + <h1 class="logo"><a href="{{ '/' | relative_url }}">{{ site.title_left }}<span>{{ site.title_right }}</span></a></h1> <ul class="navbar"> - <li><a href="{{ '/man' | prepend: site.baseurl | prepend: site.url }}">Manpage</a></li> + <li><a href="{{ '/man' | relative_url }}">Manpage</a></li> <li><a href="https://software.opensuse.org/download.html?project=home%3Ain0rdr&package=diary">{% octicon package %}</a></li> <li><a href="https://github.com/in0rdr/diary">{% octicon mark-github %}</a></li> </ul> diff --git a/_includes/post-share.html b/_includes/post-share.html @@ -1,8 +1,8 @@ {% if site.postshare_enabled %} <aside class="share"> - <p>If you liked this article and think others should read it, please share it on <a href="http://twitter.com/share?text={{page.title}}&amp;url={{ page.url | prepend: site.baseurl | prepend: site.url }}&amp;via={{ site.twitter_username }}" - onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;">Twitter</a> or <a href="https://www.facebook.com/sharer/sharer.php?u={{ page.url | prepend: site.baseurl | prepend: site.url }}" onclick="window.open(this.href, 'facebook-share', 'width=550,height=235');return false;">Facebook</a>.</p> + <p>If you liked this article and think others should read it, please share it on <a href="http://twitter.com/share?text={{page.title}}&amp;url={{ page.url | relative_url }}&amp;via={{ site.twitter_username }}" + onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;">Twitter</a> or <a href="https://www.facebook.com/sharer/sharer.php?u={{ page.url | relative_url }}" onclick="window.open(this.href, 'facebook-share', 'width=550,height=235');return false;">Facebook</a>.</p> </aside> {% endif %} \ No newline at end of file diff --git a/feed.xml b/feed.xml @@ -7,7 +7,7 @@ layout: null <title>{{ site.title | xml_escape }}</title> <description>{{ site.description | xml_escape }}</description> <link>{{ site.url }}{{ site.baseurl }}/</link> - <atom:link href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" rel="self" type="application/rss+xml"/> + <atom:link href="{{ "/feed.xml" | relative_url }}" rel="self" type="application/rss+xml"/> <pubDate>{{ site.time | date_to_rfc822 }}</pubDate> <lastBuildDate>{{ site.time | date_to_rfc822 }}</lastBuildDate> <generator>Jekyll v{{ jekyll.version }}</generator> @@ -16,8 +16,8 @@ layout: null <title>{{ post.title | xml_escape }}</title> <description>{{ post.content | xml_escape }}</description> <pubDate>{{ post.date | date_to_rfc822 }}</pubDate> - <link>{{ post.url | prepend: site.baseurl | prepend: site.url }}</link> - <guid isPermaLink="true">{{ post.url | prepend: site.baseurl | prepend: site.url }}</guid> + <link>{{ post.url | relative_url }}</link> + <guid isPermaLink="true">{{ post.url | relative_url }}</guid> {% for tag in post.tags %} <category>{{ tag | xml_escape }}</category> {% endfor %}