1
0
mirror of https://github.com/chylex/Blog.git synced 2025-07-31 01:59:05 +02:00

Relativize URLs and tweak HTML

This commit is contained in:
chylex 2022-04-28 19:37:59 +02:00
parent e1113eeaf6
commit e5da6eb49f
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
3 changed files with 13 additions and 11 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/.idea/

View File

@ -1,18 +1,19 @@
{% assign timestamp = site.time | date: "%s" %}
<!DOCTYPE html>
<html lang="{{ site.lang | default: "en-US" }}">
<html lang="{{ site.lang | default: "en" }}">
<head>
<meta charset="UTF-8">
{% seo %}
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#348fba">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: timestamp | relative_url }}">
</head>
<body>
<header class="page-header" role="banner">
<h1 class="project-name">
{% if page.titleimg %}
<a href="https://chylex.com/" class="project-name-image"><img src="{{ page.titleimg }}" alt=""></a>
<a href="https://chylex.com/" class="project-name-image"><img src="{{ page.titleimg | relative_url }}" alt=""></a>
{% endif %}
<span class="project-name-text">{{ page.title | default: site.title }}</span>
</h1>
@ -26,21 +27,21 @@
<main id="content" class="main-content" role="main">
{% if page.breadcrumbs %}
<nav class="page-breadcrumbs">
<a href="{{site.url}}">Home</a>
<a href="{{ site.url }}{{ site.baseurl }}">Home</a>
{% for crumb in page.breadcrumbs %}
<span> &nbsp;&raquo;&nbsp; </span>
{% if crumb.type == 'self' %}
{% assign url = page.permalink %}
{% assign url = page.permalink | relative_url %}
{% assign title = page.title %}
{% elsif crumb.revlatest %}
{% assign url = site.url | append: crumb.revlatest %}
{% assign url = site.url | append: site.baseurl | append: crumb.revlatest %}
{% assign title = page.title %}
{% elsif crumb.revcurrent %}
{% assign url = page.permalink %}
{% assign url = page.permalink | relative_url %}
{% assign title = 'revision ' | append: crumb.revcurrent %}
{% elsif crumb.revcustom %}
{% assign url = page.permalink %}
{% assign url = page.permalink | relative_url %}
{% assign title = crumb.revcustom %}
{% endif %}

View File

@ -5,7 +5,7 @@ titleimg: /assets/img/avatar.png
{% for post in paginator.posts %}
<article>
<div class="blog-entry-header">
<h1><a href="{{ post.url }}">{{ post.title }}</a></h1>
<h1><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h1>
<p class="date">{{ post.date | date: '%b %Y' }}</p>
</div>
<div class="blog-entry-content">{{ post.excerpt }}</div>
@ -16,14 +16,14 @@ titleimg: /assets/img/avatar.png
<nav class="pagination">
<div>
{% if paginator.previous_page_path %}
<a href="{{ paginator.previous_page_path }}">&lsaquo; previous page</a>
<a href="{{ paginator.previous_page_path | relative_url }}">&lsaquo; previous page</a>
{% else %}
<span class="inactive-link">&lsaquo; previous page</span>
{% endif %}
</div>
<div>
{% if paginator.next_page_path %}
<a href="{{ paginator.next_page_path }}">next page &rsaquo;</a>
<a href="{{ paginator.next_page_path | relative_url }}">next page &rsaquo;</a>
{% else %}
<span class="inactive-link">next page &rsaquo;</span>
{% endif %}