Skip to content

Commit

Permalink
Add opengraph tags in <head>
Browse files Browse the repository at this point in the history
  • Loading branch information
irskep committed Sep 2, 2024
1 parent 2382701 commit 67f06cf
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/djockey.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ output_dir:
project_info:
version: 0.1.1
github_url: https://github.com/irskep/djockey
description: "A powerful static site generator for technical writing and project documentation"
image: static/silly_logo.png

link_mappings:
- path: src/typescript_link_mapping.json
Expand Down
2 changes: 2 additions & 0 deletions docs/src/basics/configuration.dj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ url_root: "https://your-docs-site-here"
project_info:
version: 0.0.1
github_url: https://github.com/your/project
description: "Site description for social media"
image: "Path to image inside your docs directory for social media"
input_dir: "path to your docs"
output_dir:
html: "path to your HTML output"
Expand Down
Binary file added docs/src/static/silly_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export type DjockeyConfig = {
project_info?: {
version?: string;
github_url?: string;
description?: string;
image?: string;
};

num_passes: number;
Expand Down
10 changes: 10 additions & 0 deletions templates/html/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@
{%- endif %}
{% endfor %}
<title>{{ config.site_name }} - {{ doc.title }}</title>

<meta property="og:type" content="website">
<meta property="og:url" content="{{ config.url_root }}">
<meta property="og:title" content="{{ config.site_name }} - {{ doc.title }}">
{% if config.project_info.description -%}
<meta property="og:description" content="{{ config.project_info.description }}">
{%- endif %}
{% if config.project_info.image -%}
<meta property="og:image" content="{{ config.url_root }}/{{ config.project_info.image }}">
{%- endif %}
</head>
<body>
<header class="DJHeader">
Expand Down

0 comments on commit 67f06cf

Please sign in to comment.