up versions

This commit is contained in:
Adam Matthiesen 2024-01-25 00:54:05 -08:00
parent a917c63dbe
commit e2fb3c9ad4
10 changed files with 55 additions and 24 deletions

View File

@ -1,7 +1,7 @@
{
"name": "@matthiesenxyz/astro-ghostcms-theme-default",
"description": "Default Theme for astro-ghostcms",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://astro-ghostcms.xyz/",
"type": "module",
"license": "MIT",
@ -50,7 +50,7 @@
"astro": "^4.2.1"
},
"dependencies": {
"@matthiesenxyz/astro-ghostcms": "^3.1.0",
"@matthiesenxyz/astro-ghostcms": "^3.1.1",
"tiny-invariant": "^1.3.1",
"astro-font": "^0.0.77"
}

View File

@ -54,6 +54,7 @@ const { post, settings } = Astro.props as Props;
flex-wrap: wrap;
margin: 0 0 0 4px;
padding: 0;
padding-inline-end: 1rem;
list-style: none;
}

View File

@ -24,7 +24,7 @@ const { image, alt, caption = "", settings, transitionName } = Astro.props as Pr
alt={alt}
transition:name={transitionName}
/>
{caption && <figcaption>{caption}</figcaption>}
{caption && <figcaption><Fragment set:html={caption}></figcaption>}
</figure>
<style lang="scss">

View File

@ -19,8 +19,10 @@ const { content, permalink, image, settings, bodyClass = "" } = Astro.props as P
const ghostAccentColor = settings.accent_color;
---
<html lang="en" data-color-scheme="light">
<html lang="en">
<head>
<Fragment set:html={settings.codeinjection_head}>
<AstroFont
config={[
{
@ -34,7 +36,6 @@ const ghostAccentColor = settings.accent_color;
},
]}
/>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

View File

@ -161,6 +161,7 @@
flex-direction: column;
align-items: center;
text-align: center;
padding-right: auto;
}
}
@ -212,7 +213,7 @@ html.dark-mode .post-card-title {
}
html.dark-mode .post-card-excerpt {
color: color-mod(var(--color-midgrey) l(+10%));
color: var(--color-midgrey);
}
html.dark-mode .post-full-content {
@ -388,3 +389,7 @@ html.dark-mode .subscribe-form .error .message-error {
html.dark-mode .subscribe-form .success .message-success {
color: color-mod(var(--color-green) l(+5%) s(-5%));
}
html.dark-mode figcaption {
color: rgba(255, 255, 255, 0.6);
}

View File

@ -27,7 +27,7 @@ const IC = {
/** INTERNAL STRING */
IDR:"Injecting Default Routes...",
/** INTERNAL STRING */
IR:"Injecting Default Theme Routes...",
ITR:"Injecting Default Theme Routes...",
/** INTERNAL STRING */
IRD:"Route Injection Disabled - Skipping...",
/** INTERNAL STRING */
@ -111,10 +111,10 @@ export default function GhostCMS(options: UserConfig): AstroIntegration {
if( !logs ) { logger.info( IC.IDR )}
if( !logs ) { logger.info( IC.F0FR )}
injectRoute({ pattern: '/404', entrypoint: IC.PKG+'/404.astro' });
injectRoute({ pattern: '/404', entrypoint: `${IC.PKG}/404.astro` });
if( !logs ) { logger.info( IC.RSS )}
injectRoute({ pattern: '/rss.xml', entrypoint: IC.PKG+'/rss.xml.ts' });
injectRoute({ pattern: '/rss.xml', entrypoint: `${IC.PKG}/rss.xml.ts` });
// THEME ROUTES
if( !logs ) { logger.info( IC.ITR )}
@ -139,20 +139,20 @@ export default function GhostCMS(options: UserConfig): AstroIntegration {
const int = [...config.integrations];
// IMPORT INTEGRATION: @ASTROJS/SITEMAP
if( !logs ) { logger.info( IC.CF + "@astrojs/sitemap" )}
if( !logs ) { logger.info( `${IC.CF}@astrojs/sitemap` )}
if ( !int.find( ({ name }) => name === '@astrojs/sitemap' )) {
if( !logs ) { logger.info( IC.II + "@astrojs/sitemap" )}
if( !logs ) { logger.info( `${IC.II}@astrojs/sitemap` )}
int.push( ghostSitemap( uconf ));
} else { if( !logs ) { logger.info( IC.AIbU + "@astrojs/sitemap" )}
} else { if( !logs ) { logger.info( `${IC.AIbU}@astrojs/sitemap` )}
};
// IMPORT INTEGRATION: ASTRO-ROBOTS-TXT
if( !logs ) { logger.info( IC.CF + "astro-robots-txt" )}
if( !logs ) { logger.info( `${IC.CF}astro-robots-txt` )}
if ( !int.find( ({ name }) => name === 'astro-robots-txt' )) {
if( !logs ) { logger.info( IC.II + "astro-robots-txt" )}
if( !logs ) { logger.info( `${IC.II}astro-robots-txt` )}
int.push( ghostRobots( uconf ));
} else {
if( !logs ) { logger.info( IC.AIbU + "astro-robots-txt" )}
if( !logs ) { logger.info( `${IC.AIbU}astro-robots-txt` )}
};
// FINAL STEP TO KEEP INTEGRATION LIVE

View File

@ -1,7 +1,7 @@
{
"name": "@matthiesenxyz/astro-ghostcms",
"description": "Astro GhostCMS integration to allow easier importing of GhostCMS Content",
"version": "3.1.0",
"version": "3.1.1",
"homepage": "https://astro-ghostcms.xyz/",
"type": "module",
"license": "MIT",
@ -79,7 +79,7 @@
"vitest-fetch-mock": "^0.2.2"
},
"dependencies": {
"@matthiesenxyz/astro-ghostcms-theme-default": "^0.1.0",
"@matthiesenxyz/astro-ghostcms-theme-default": "^0.1.1",
"@astrojs/rss": "^4.0.2",
"@astrojs/sitemap": "^3.0.5",
"@ts-ghost/core-api": "^5.1.2",

View File

@ -2,22 +2,22 @@ import rss from "@astrojs/rss";
import { getAllPosts, getSettings } from '../api';
import invariant from "tiny-invariant";
export async function GET(context) {
export async function GET(context: { site: string; }) {
const posts = await getAllPosts();
const settings = await getSettings();
invariant(settings, "Settings not found");
const allPosts = [...posts];
const title = settings.title;
const description = settings.description;
return rss({
title: title,
description: description,
site: context.site,
items: allPosts.map((post) => ({
items: posts.map((post) => ({
title: post.title,
pubDate: post.published_at,
pubDate: new Date(post.published_at?post.published_at:post.created_at),
description: post.excerpt,
link: `/${post.slug}/`,
})),
author: post.primary_author?.name,
} ) ),
});
}

View File

@ -3,7 +3,7 @@ import fs from 'node:fs';
import { ExpressiveCodeTheme } from '@astrojs/starlight/expressive-code';
import starlight from "@astrojs/starlight";
const houstonFile = `./houston-vscode.jsonc`;
const houstonFile = './houston-vscode.jsonc';
const houston = fs.readFileSync(
new URL(houstonFile, import.meta.url),'utf-8');
const houstonTheme = ExpressiveCodeTheme.fromJSONString(houston);
@ -35,7 +35,7 @@ export default defineConfig({
{ label: 'API ( DIY ) Mode', items: [
{ label: 'Install', link: '/docs/introduction/api/install' },
{ label: 'Basic API Usage', link: '/docs/introduction/api/usage' }, ], }, ], },
//{ label: 'Advanced Usage', link: '/docs/#' },
{ label: 'Default Theme Usage', autogenerate: { directory: 'docs/theme-default'}, },
{ label: 'Tutorials', autogenerate: { directory: 'docs/tutorials' }, },
{ label: 'Reference', autogenerate: { directory: 'docs/reference' }, },
],

View File

@ -0,0 +1,24 @@
---
title: Enable Darkmode
description: How to enable Dark-Mode on the default theme
---
*Requires `@matthiesenxyz/astro-ghostcms` version 0.1.1 and above*
To enable darkmode on your Astro-Ghost install for the basic theme all you have to do is add a Code_Injection to the Site Header. Dont know how to do that? No Problem! Just look below
- To get started Login to your GhostCMS Admin Dashboard.
- Click the Settings Icon on the bottom left next to your Avatar.
- Scroll down to `Avanced` > `Code injection` and click Open
- In the Site header tab paste the following:
```
<script>document.documentElement.classList.add('dark-mode');</script>
<script>
document.addEventListener('astro:after-swap', () => {
document.documentElement.classList.add('dark-mode');
});
</script>
```
The Above script will enable darkmode, and make it persist with Astro View Transitions.