Skip to content

Commit

Permalink
Change OG image
Browse files Browse the repository at this point in the history
  • Loading branch information
MeFoDy committed Jan 27, 2024
1 parent 8b45551 commit f9e0465
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions _11ty/scripts/weekly-links-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: {{title}}
date: {{date}}
linksCount: {{linksCount}}
dateUpdated: Last Modified
cover: https://mefody.dev/images/weekly-links.jpg
tags:
- weekly
- chunk
Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ gulp.task('contributors:get', () => {
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
];
const contributorsNames = contributors
.split('\n')
Expand Down
1 change: 1 addition & 0 deletions src/chunks/weekly-2024-01-27.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: 'Weekly Links: 27 January 2024'
date: 2024-01-27
linksCount: 8
dateUpdated: Last Modified
cover: https://mefody.dev/images/weekly-links.jpg
tags:
- weekly
- chunk
Expand Down
Binary file added src/chunks/weekly-links.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/data/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
domain: 'mefody.dev',
site: 'https://mefody.dev',
feed: 'https://mefody.dev/feed/rss.xml',
social: 'https://mefody.dev/images/og.png',
social: 'https://mefody.dev/images/og.jpg',
github: 'https://github.com/MeFoDy/mefody.dev',
},
buildYear: new Date().getFullYear(),
Expand Down
Binary file added src/images/og.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion src/includes/meta-open-graph.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
{% set titleSuffix = '' %}
{% endif %}

{% set httpRegExp = r/^https?\:\/\/.*/g %}

{% if cover %}
{% set ogImage = site.paths.site + page.url + cover %}
{% if httpRegExp.test(cover) %}
{% set ogImage = cover %}
{% else %}
{% set ogImage = site.paths.site + page.url + cover %}
{% endif %}
{% else %}
{% set ogImage = site.paths.social %}
{% endif %}
Expand Down

0 comments on commit f9e0465

Please sign in to comment.