Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/components/header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const BLUESKY = getEnv(import.meta.env, Astro, 'BLUESKY')

const staticProxy = getEnv(import.meta.env, Astro, 'STATIC_PROXY') ?? '/static/'
const hideDescription = getEnv(import.meta.env, Astro, 'HIDE_DESCRIPTION')
const hideTitle = getEnv(import.meta.env, Astro, 'HIDE_TITLE')
---

<div id="header">
Expand All @@ -34,11 +35,15 @@ const hideDescription = getEnv(import.meta.env, Astro, 'HIDE_DESCRIPTION')
class="header-avatar"
/>
</a>
<div class="header-title">
<a href={SITE_URL} class="site-title" title={channel?.title}>
{channel?.title}
</a>
</div>
{
!hideTitle && (
<div class="header-title">
<a href={SITE_URL} class="site-title" title={channel?.title}>
{channel?.title}
</a>
</div>
)
}
<div class="header-icons">
<a href={RSS_URL} target="_blank" rel="alternate" type="application/rss+xml" title="RSS Feed">
<img {...rss} alt="RSS" class="social-icon" width="1em" />
Expand Down
5 changes: 4 additions & 1 deletion src/lib/env.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export function getEnv(env, Astro, name) {
return env[name] ?? Astro.locals?.runtime?.env?.[name]
const value = env[name] ?? Astro.locals?.runtime?.env?.[name] ?? (typeof process !== 'undefined' ? process.env[name] : undefined)
if (value === 'true') return true
if (value === 'false') return false
return value
}