Skip to content

Commit

Permalink
Fix issue with permalinks
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranahmedse committed May 26, 2022
1 parent bbdfe8d commit ffdfa23
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.9",
"version": "0.0.10",
"description": "Create good looking blog from your markdown files in a GitHub repository\n\n",
"main": "lib/main.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export async function prepareTheme(configuration: ConfigurationType) {
async function prepareBlogPosts() {
info('Preparing blog posts');
const postFiles = fs.readdirSync(postsDir);
const posts = [];
const posts: PostType[] = [];

for (let contentFile of postFiles) {
const contentFilePath = path.join(postsDir, contentFile);
Expand All @@ -103,7 +103,7 @@ export async function prepareTheme(configuration: ConfigurationType) {
const postHtml = htmlConverter.makeHtml(parsed.body);

const fullFileName = (permalink || slugify(title).toLowerCase()).replace(/^\//, '');
const fullFileNameParts = fullFileName.split('/');
const fullFileNameParts = fullFileName.replace(/\/$/, '').split('/');
const fileName = fullFileNameParts.pop() || '';

const nestedPostDir = fullFileNameParts.join('/');
Expand Down

0 comments on commit ffdfa23

Please sign in to comment.