Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modified emptyOutputDir in a way that we can now avoid removing files… #864

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
12 changes: 12 additions & 0 deletions app/back-end/modules/render-html/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,22 @@ class Renderer {
if (UtilsHelper.dirExists(this.outputDir)) {
let files = fs.readdirSync(this.outputDir);

let storeExcludes = this.siteConfig.advanced.storeExcludesArray;
// console.log(storeExcludes)

let storeExcludesArray = storeExcludes.split(",");

filesIteration:
for (let file of files) {
if (file === '.' || file === '..' || file === 'media') {
continue;
}

for (let excludeName of storeExcludesArray) {
if (file === excludeName.trim()) {
continue filesIteration
}
}

fs.rmdirSync(path.join(this.outputDir, file), { recursive: true });
}
Expand Down
20 changes: 19 additions & 1 deletion app/src/components/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,23 @@
</small>
</field>
</div>

<div slot="tab-10">
<field
label="Excluded Files">
<input
slot="field"
type="text"
spellcheck="false"
v-model="advanced.storeExcludesArray"/>
<small
slot="note"
class="note">
Type a comma-separated list of HTML files or catalogs to exclude from the list of files that will be re-generated on Syncing the output.<br>
For example: <strong>ignoreme.html,ignoreme</strong>
</small>
</field>
</div>
</tabs>
</fields-group>

Expand Down Expand Up @@ -1602,7 +1619,8 @@ export default {
'GDPR',
'Website Speed',
'RSS/JSON Feed',
'Posts Listing'
'Posts Listing',
'Sync Excludes'
];
},
seoOptions () {
Expand Down