Skip to content

Commit

Permalink
fix: use permalink from template config
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Jan 22, 2023
1 parent 0c38102 commit 4e4f742
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/generators/output/to-disk.js
Expand Up @@ -139,7 +139,7 @@ module.exports = async (env, spinner, config) => {
...config.events
})

const destination = config.permalink || file
const destination = get(compiled, 'config.permalink', file)

/**
* Generate plaintext
Expand All @@ -150,7 +150,7 @@ module.exports = async (env, spinner, config) => {

// Check if plaintext: true globally, fallback to template's front matter
const plaintextConfig = get(templateConfig, 'plaintext', get(compiled.config, 'plaintext', false))
const plaintextPath = get(plaintextConfig, 'destination.path', config.permalink || file)
const plaintextPath = get(plaintextConfig, 'destination.path', destination)

if (Boolean(plaintextConfig) || !isEmpty(plaintextConfig)) {
await Plaintext
Expand Down

0 comments on commit 4e4f742

Please sign in to comment.