Skip to content

Commit

Permalink
Feature: Enhance Head Tag Logic and Support Custom RSS Links
Browse files Browse the repository at this point in the history
1. Modified `default.hbs` to include conditional logic for the head tag. This update ensures that for all pages except `/links`, the standard head tag content is rendered using `ghost_head`. When the page is `/links`, a customized head tag is handled in `links.hbs`, including a link to the RSS feed specifically for the links page.

2. In `links/rss.hbs`, updated the title tag to prepend the name of the links page to the blog's top-level title.

3. Fragile change: in `links.hbs` now manually inserting the content typically generated by `ghost_head` in the head tag. Although not ideal, this change ensures the head tag correctly references the custom RSS feed for the `/links` page. This approach is a temporary workaround, and hopefully a more robust solution will be sought in future updates.
  • Loading branch information
danielraffel committed Jan 30, 2024
1 parent 7b31887 commit 5317e88
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 2 deletions.
4 changes: 3 additions & 1 deletion default.hbs
@@ -1,13 +1,15 @@
<!DOCTYPE html>
<html{{#match @custom.color_scheme "Dark"}} class="theme-dark"{{/match}}{{#match @custom.color_scheme "Light"}} class="theme-light"{{/match}} lang="{{@site.locale}}">

{{^is "links"}}
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{#is "post"}}{{meta_title}} - {{/is}}{{#is "page"}}{{meta_title}} - {{/is}}{{#is "tag"}}{{tag.name}} - {{/is}}{{@site.title}}</title>
<link rel="stylesheet" href="{{asset "built/screen.css"}}">
{{ghost_head}}
{{ghost_head}}
</head>
{{/is}}

<body class='{{body_class}}{{{block "body_class"}}} is-head-{{#match @custom.navigation_layout "Logo on the left"}}left-logo{{else match @custom.navigation_layout "Logo in the middle"}}middle-logo{{else}}stacked{{/match}}{{#match @custom.title_font "=" "Elegant serif"}} has-serif-title{{/match}}{{#match @custom.body_font "=" "Elegant serif"}} has-serif-body{{/match}}'>
<div class="site">
Expand Down
132 changes: 132 additions & 0 deletions links.hbs
@@ -1,5 +1,137 @@
{{!< default}}

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{#is "post"}}{{meta_title}} - {{/is}}{{#is "page"}}{{meta_title}} - {{/is}}{{#is "tag"}}{{tag.name}} - {{/is}}{{@site.title}}</title>
<link rel="stylesheet" href="{{asset "built/screen.css"}}">
<link rel="canonical" href="http://danielraffel.me/links/">
<meta name="referrer" content="no-referrer-when-downgrade">

<meta property="og:site_name" content="Daniel&#x27;s Journal">
<meta property="og:type" content="website">
<meta property="og:title" content="🔗 Links - Daniel&#x27;s Journal">
<meta property="og:url" content="http://danielraffel.me/links/">
<meta property="article:publisher" content="https://www.facebook.com/ghost">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="🔗 Links - Daniel&#x27;s Journal">
<meta name="twitter:url" content="http://danielraffel.me/links/">
<meta name="twitter:site" content="@danielraffel">

<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Series",
"publisher": {
"@type": "Organization",
"name": "Daniel&#x27;s Journal",
"url": "http://danielraffel.me/",
"logo": {
"@type": "ImageObject",
"url": "http://danielraffel.me/favicon.ico",
"width": 48,
"height": 48
}
},
"url": "http://danielraffel.me/links/",
"name": "🔗 Links",
"mainEntityOfPage": "http://danielraffel.me/links/"
}
</script>

<meta name="generator" content="Ghost 5.76">
<link rel="alternate" type="application/rss+xml" title="Daniel&#x27;s Journal" href="http://danielraffel.me/links/rss/">
<script defer src="https://cdn.jsdelivr.net/ghost/portal@~2.37/umd/portal.min.js" data-i18n="false" data-ghost="http://danielraffel.me/" data-key="f59b73ee18c4dd395b137d1638" data-api="http://danielraffel.me/ghost/api/content/" crossorigin="anonymous"></script><style id="gh-members-styles">.gh-post-upgrade-cta-content,
.gh-post-upgrade-cta {
display: flex;
flex-direction: column;
align-items: center;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
text-align: center;
width: 100%;
color: #ffffff;
font-size: 16px;
}
.gh-post-upgrade-cta-content {
border-radius: 8px;
padding: 40px 4vw;
}
.gh-post-upgrade-cta h2 {
color: #ffffff;
font-size: 28px;
letter-spacing: -0.2px;
margin: 0;
padding: 0;
}
.gh-post-upgrade-cta p {
margin: 20px 0 0;
padding: 0;
}
.gh-post-upgrade-cta small {
font-size: 16px;
letter-spacing: -0.2px;
}
.gh-post-upgrade-cta a {
color: #ffffff;
cursor: pointer;
font-weight: 500;
box-shadow: none;
text-decoration: underline;
}
.gh-post-upgrade-cta a:hover {
color: #ffffff;
opacity: 0.8;
box-shadow: none;
text-decoration: underline;
}
.gh-post-upgrade-cta a.gh-btn {
display: block;
background: #ffffff;
text-decoration: none;
margin: 28px 0 0;
padding: 8px 18px;
border-radius: 4px;
font-size: 16px;
font-weight: 600;
}
.gh-post-upgrade-cta a.gh-btn:hover {
opacity: 0.92;
}</style>
<script defer src="https://cdn.jsdelivr.net/ghost/sodo-search@~1.1/umd/sodo-search.min.js" data-key="f59b73ee18c4dd395b137d1638" data-styles="https://cdn.jsdelivr.net/ghost/sodo-search@~1.1/umd/main.css" data-sodo-search="http://danielraffel.me/" crossorigin="anonymous"></script>

<link href="http://danielraffel.me/webmentions/receive/" rel="webmention">
<script defer src="/public/cards.min.js?v=13c5f32475"></script>
<link rel="stylesheet" type="text/css" href="/public/cards.min.css?v=13c5f32475">
<script defer src="/public/member-attribution.min.js?v=13c5f32475"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-C83LDDT74K"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-C83LDDT74K');
</script>
<!-- favicons -->
<link rel="apple-touch-icon" sizes="180x180" href="https://danielraffel.me/content/images/2023/10/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://danielraffel.me/content/images/2023/10/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="https://danielraffel.me/content/images/2023/10/favicon-16x16.png">
<link rel="manifest" href="https://danielraffel.me/content/images/2023/10/site.webmanifest">
<link rel="mask-icon" href="https://danielraffel.me/content/images/2023/10/safari-pinned-tab.svg" color="#000000">
<link rel="shortcut icon" href="https://danielraffel.me/content/images/2023/10/favicon.ico">
<meta name="msapplication-TileColor" content="#9f00a7">
<meta name="msapplication-config" content="https://danielraffel.me/content/images/2023/10/browserconfig.xml">
<meta name="theme-color" content="#ffffff"><style>:root {--ghost-accent-color: #FF1A75;}</style>
</head>

<main class="site-main">

<div class="page-title" style="text-align:center; margin-bottom:2rem;">
Expand Down
2 changes: 1 addition & 1 deletion links/rss.hbs
@@ -1,6 +1,6 @@
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
<channel>
<title>Daniel's Journal</title>
<title>Intriguing Stuff - Daniel's Journal</title>
<description><![CDATA[ {{@site.description}} ]]></description>
<link>{{@site.url}}</link>
<image>
Expand Down

0 comments on commit 5317e88

Please sign in to comment.