Skip to content

Commit

Permalink
seo and build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bamr87 committed May 15, 2024
1 parent 18f06f1 commit fca390a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 56 deletions.
24 changes: 14 additions & 10 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,22 @@ subtitle_url : "localhost"
subtitle_icon : "code"
title_separator : "|" # Appears in the web browser tab name
domain : &domain "it-journey.dev"
baseurl : "" # the subpath of your site, e.g. /blog - Use this if you want this whole repo to be a domain branch
url : &url ['https://', *domain] # the base hostname & protocol for your site, e.g. http://example.com
public_folder : &public "/assets/"
baseurl : null # the subpath of your site, e.g. /blog - Use this if you want this whole repo to be a domain branch
url : 'https://it-journey.dev' # the base hostname & protocol for your site, e.g. http://example.com
public_folder : "/assets"
port : 4002 # Jekyll Serve Dev port
dg_port : 4001 # TODO: Doppelganger site. Use this if you want to switch between parallel deployments
og_image : '/assets/images/wizard-on-journey.png'

### Github Information
github_user : &github_user "bamr87"
github_site : 'bamr87.github.io'

### Owner Information -------------------------------------------------------------

name : &name "Amr"
email : &email "[email protected]"
github_user : &github_user "bamr87"
description : &description >- # this means to ignore newlines until the next variable
email : "[email protected]"
description : >- # this means to ignore newlines until the next variable
Scrolls and spells of IT magic.
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Expand Down Expand Up @@ -87,10 +91,10 @@ home_dir_pc : &home-win 'C:\Users\amrab\'
home_dir_mac : &home-mac '/Users/bamr87/'
local_git_pc : [ *home-win, 'github' ]
local_git_mac : [ *home-mac, 'github' ]
logo : /images/gravatar-small.png # path of logo image to display in the masthead, e.g. "/assets/images/88x88.png"
logo : /assets/images/gravatar-small.png # path of logo image to display in the masthead, e.g. "/assets/images/88x88.png"
logo_link : 'https://www.it-journey.dev'

teaser : /images/favicon_gpt_computer_retro.png # path of fallback teaser image, e.g. "/assets/images/500x300.png"
teaser : /assets/images/favicon_gpt_computer_retro.png # path of fallback teaser image, e.g. "/assets/images/500x300.png"
breadcrumbs : true # true, false (default)
words_per_minute : 200
_posts_file_structure : "year-month-day-title.md"
Expand All @@ -99,7 +103,7 @@ _posts_file_structure : "year-month-day-title.md"

author:
name : *name # *name is a YAML reference pointing to the &anchor earlier
avatar : "/images/gravatar-small.png"
avatar : "/assets/images/gravatar-small.png"
email_hash : '71d7a4fc9712df49e13d606e620f89c7' # https://en.gravatar.com/site/check/{ site.email }
gravatar : [ 'https://s.gravatar.com/avatar/', *email_hash, '?s=80' ]
bio : "IT nerd trying to be an IT hero"
Expand Down Expand Up @@ -152,7 +156,7 @@ powered_by:
url: "https://www.mathjax.org/"
icon: "bi-calculator"
- name: "GitHub Pages"
version: "228"
version: "231"
url: "https://pages.github.com/"
icon: "bi-github"
- name: "docker"
Expand Down
2 changes: 1 addition & 1 deletion _includes/branding.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<!-- Title Section -->

<div class="navbar-brand">
<a class="nav-link" href=" {{ site.logo_link}}{{ page.url }}">
<a class="nav-link" href="{{ site.logo_link}}{{ page.url }}">
<i class="d-sm-inline d-md-none {{ site.default_icon }} {{ site.default_icon }}-{{ site.title_icon | default: site.powered_by.default }}" aria-hidden="true"></i>
<!-- display name if there's enough space, else icon only -->
<span class="d-none d-md-inline">
Expand Down
2 changes: 1 addition & 1 deletion _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<!-- set the URL for the logo image in the _config file -->
{% capture logo_path %}{{ site.logo }}{% endcapture %}
<a class="navbar-brand" href="/">
<img src="{{ site.public_folder }}/{{ logo_path | relative_url }}" alt="Logo" width="30" height="30">
<img src="{{ logo_path | relative_url }}" alt="Logo" width="30" height="30">
</a>
</div>
<!-- include branding.html -->
Expand Down
55 changes: 16 additions & 39 deletions _includes/seo.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,23 @@

<!-- -->

{%- if site.url -%}
{%- assign seo_url = site.url | append: site.baseurl -%}
{%- endif -%}
{%- assign seo_url = seo_url | default: site.github.url -%}

{% assign title_separator = site.title_separator | default: '-' | replace: '|', '&#124;' %}

{%- if page.title -%}
{%- assign seo_title = page.title | append: " " | append: title_separator | append: " " | append: site.title -%}
{%- endif -%}

{%- if seo_title -%}
{%- assign seo_title = seo_title | markdownify | strip_html | strip_newlines | escape_once -%}
{%- endif -%}

{% if page.canonical_url %}
{%- assign canonical_url = page.canonical_url %}
{% else %}
{%- assign canonical_url = page.url | replace: "index.html", "" | absolute_url %}
{% endif %}
{%- assign seo_url = site.url | append: site.baseurl -%}
{%- assign canonical_url = site.url %}
{%- assign seo_title = page.title | default: site.title | append: " " | append: title_separator | append: " " | append: site.title -%}
{% assign title_separator = site.title_separator | default: '-' %}
{%- assign seo_description = page.description | default: site.description -%}

{%- assign seo_description = page.description | default: page.excerpt | default: site.description -%}
{%- if seo_description -%}
{%- assign seo_description = seo_description | markdownify | strip_html | newline_to_br | strip_newlines | replace: '<br />', ' ' | escape_once | strip -%}
{%- endif -%}
{%- assign author = page.author | default: site.author -%}

{%- assign author = page.author | default: page.authors[0] | default: site.author -%}
{%- assign author = site.data.authors[author] | default: author -%}
<!-- TODO: build author data set for SEO -->

{%- if author.twitter -%}
{%- assign author_twitter = author.twitter | replace: "@", "" -%}
{%- endif -%}
{%- assign author_twitter = site.author.twitter_username %}

{%- assign page_large_image = page.header.og_image | default: page.header.overlay_image | default: page.header.image | absolute_url -%}
{%- assign page_large_image = page_large_image | escape -%}

{%- assign page_teaser_image = page.header.teaser | default: site.og_image | absolute_url -%}
{%- assign page_teaser_image = page_teaser_image | escape -%}
{%- assign page_teaser_image = page.preview | default: site.og_image -%}
{%- assign page_teaser_image = {{ site.public_folder }}/page_teaser_image | escape -%}

{%- assign site_og_image = site.og_image | absolute_url -%}
{%- assign site_og_image = site_og_image | escape -%}
Expand All @@ -59,11 +38,10 @@
<title>{{ seo_title | default: site.title }}{% if paginator %}{% unless paginator.page == 1 %} {{ title_separator }} {{ site.data.ui-text[site.locale].page | default: "Page" }} {{ paginator.page }}{% endunless %}{% endif %}</title>
<meta name="description" content="{{ seo_description }}">

{% if author.name %}
<meta name="author" content="{{ author.name | default: author }}">
{% if og_type == "article" %}
<meta property="article:author" content="{{ author.name | default: author }}">
{% endif %}
<meta name="author" content="{{ author.name | default: author }}">
{% if og_type == "article" %}
<meta property="article:author" content="{{ author.name | default: author }}">

{% endif %}

<meta property="og:type" content="{{ og_type }}">
Expand All @@ -72,9 +50,8 @@
<meta property="og:title" content="{{ page.title | default: site.title | markdownify | strip_html | strip_newlines | escape_once }}">
<meta property="og:url" content="{{ canonical_url }}">

{% if seo_description %}
<meta property="og:description" content="{{ seo_description }}">
{% endif %}
<meta property="og:description" content="{{ seo_description }}">


{% if page_large_image %}
<meta property="og:image" content="{{ page_large_image }}">
Expand Down
8 changes: 3 additions & 5 deletions pages/_posts/2022-12-05-sharex.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: sharex
author: Amr
excerpt: null
description: null
snippet: null
categories:
- posts
Expand All @@ -11,14 +9,14 @@ tags:
- sharex
meta: 2022-12-06T18:15:47.348Z
draft: true
lastmod: 2022-12-06T18:19:49.634Z
lastmod: 2024-05-15T23:02:26.365Z
preview: /images/sharex-imgur.png
---

After enabling

![](../assets/images/sharex-upload-task-imgur.png)
![](/assets/images/sharex-upload-task-imgur.png)

This config file updates after image capture.

![](../assets/images/sharex-imgur.png)
![](/assets/images/sharex-imgur.png)

0 comments on commit fca390a

Please sign in to comment.