Skip to content

How to move outputs up one directory? #172

Discussion options

You must be logged in to vote

I got the following to do what I wanted.

changing
pages/components/capturing-unexpected-parameters/
to
components/capturing-unexpected-parameters/

DestinationPath: 
  =>
  { 
    List<string> extensions = new List<string> {"html","cshtml","md"};
    var pagesPath = new NormalizedPath("pages");
    var relativePath = pagesPath.GetRelativePath(Document.Destination);
    Context.LogDebug($"relativePath:{relativePath}");
    if(extensions.Any(str => str == Document.Destination.Extension))
    {
      var newDestination = relativePath.ChangeExtension("html");
      return newDestination;
    } else
    {
      return relativePath;
    }
  }

Maybe there is a cleaner way?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@daveaglick
Comment options

Answer selected by daveaglick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants