-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #243 from jaredwray/updating-readme-file-to-move-t…
…o-site-with-onPrepare updating readme file to move to site with onPrepare
- Loading branch information
Showing
5 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,7 @@ blog_output | |
blog_public | ||
dist | ||
test_output | ||
site/README.md | ||
|
||
# IDEs | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
![Writr](site/logo.png) | ||
![Writr](site/logo.svg) | ||
|
||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
const fs = require('fs-extra'); | ||
const path = require('path'); | ||
const process = require('node:process'); | ||
|
||
module.exports.options = { | ||
templatePath: './template', | ||
githubPath: 'jaredwray/writr', | ||
siteTitle: 'Writr', | ||
siteDescription: 'Beautiful Website for Your Projects', | ||
siteUrl: 'https://writr.org', | ||
}; | ||
}; | ||
|
||
module.exports.onPrepare = async (config) => { | ||
const readmePath = path.join(process.cwd(), './README.md'); | ||
const readmeSitePath = path.join(config.sitePath, 'README.md'); | ||
const readme = await fs.readFile(readmePath, 'utf8'); | ||
const updatedReadme = readme.replace('![Writr](site/logo.svg)',''); | ||
console.log('writing updated readme to ', readmeSitePath); | ||
await fs.writeFile(readmeSitePath, updatedReadme); | ||
} |