Skip to content

Commit

Permalink
Add support for base url in site config
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranahmedse committed May 26, 2022
1 parent 167fa5d commit f95d73c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kamranahmedse/github-pages-blog-action",
"version": "0.0.5",
"version": "0.0.6",
"description": "Create good looking blog from your markdown files in a GitHub repository\n\n",
"main": "lib/main.js",
"scripts": {
Expand Down
28 changes: 27 additions & 1 deletion src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,39 @@ type PostType = {
html: string;
};

type SiteConfigType = {
title: string;
subtitle: string;
baseUrl: string;
owner: {
name: string;
email: string;
};
social: {
github: string;
twitter: string;
medium: string;
};
newsletter: {
currentCount: string;
revueUsername: string;
};
seo: {
title: string;
description: string;
author: string;
keywords: string[];
};
cname: string;
};

const htmlConverter = new showdown.Converter();

export async function prepareTheme(configuration: ConfigurationType) {
const outputDir = configuration.outputDir;
const repoPath = configuration.repoPath;

const siteConfig = require(path.join(configuration.repoPath, './site.json'));
const siteConfig: SiteConfigType = require(path.join(configuration.repoPath, './site.json'));
const postsDir = path.join(configuration.repoPath, './posts');
const themePath = path.join(__dirname, '../theme');

Expand Down
4 changes: 2 additions & 2 deletions theme/_includes/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/shades-of-purple.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js"></script>

<link rel="stylesheet" href="/css/normalize.css"/>
<link rel="stylesheet" href="/css/theme.css"/>
<link rel="stylesheet" href="<%- `${siteConfig.seo.baseUrl}/` %>css/normalize.css"/>
<link rel="stylesheet" href="<%- `${siteConfig.seo.baseUrl}/` %>css/theme.css"/>
</head>
<body>
<nav class="nav">
Expand Down

0 comments on commit f95d73c

Please sign in to comment.