public void PublishEntryFor11ty_Test(string entryRoot, string presentationRoot, string fileName)
        {
            entryRoot        = ProgramAssemblyUtility.GetPathFromAssembly(this.GetType().Assembly, entryRoot);
            presentationRoot = ProgramAssemblyUtility.GetPathFromAssembly(this.GetType().Assembly, presentationRoot);

            var path = MarkdownEntryUtility.PublishEntryFor11ty(entryRoot, presentationRoot, fileName);

            Assert.True(File.Exists(path));
        }
        public void GenerateEntryFor11ty_Test(string entryRoot, string title)
        {
            entryRoot = ProgramAssemblyUtility.GetPathFromAssembly(this.GetType().Assembly, entryRoot);

            var entry = MarkdownEntryUtility.GenerateEntryFor11ty(entryRoot, title);

            Assert.NotNull(entry);
            Assert.True(File.Exists(ProgramFileUtility.GetCombinedPath(entryRoot, $"{entry.FrontMatter.GetValue<string>("clientId")}.md")));
        }
Beispiel #3
0
        /// <summary>
        /// Generates the <see cref="MarkdownEntry"/>
        /// at the conventional drafts root.
        /// </summary>
        /// <param name="entryDraftsRootInfo">The entry drafts root information.</param>
        /// <param name="title">The title.</param>
        /// <exception cref="NullReferenceException">The expected {nameof(entry)} is not here.</exception>
        public static void GenerateEntry(DirectoryInfo entryDraftsRootInfo, string title)
        {
            var entry = MarkdownEntryUtility.GenerateEntryFor11ty(entryDraftsRootInfo.FullName, title);

            if (entry == null)
            {
                throw new NullReferenceException($"The expected {nameof(entry)} is not here.");
            }

            var clientId = entry.FrontMatter.GetValue <string>("clientId");

            traceSource?.WriteLine($"{nameof(MarkdownEntryActivity)}: Generated entry: {clientId}");
        }
Beispiel #4
0
        /// <summary>
        /// Wrapper for <see cref="MarkdownEntryUtility.PublishEntryFor11ty(string, string, string)"/>.
        /// </summary>
        /// <param name="entryDraftsRootInfo">The entry drafts root information.</param>
        /// <param name="entryRootInfo">The entry root information.</param>
        /// <param name="entryFileName">Name of the entry file.</param>
        public static void PublishEntry(DirectoryInfo entryDraftsRootInfo, DirectoryInfo entryRootInfo, string entryFileName)
        {
            var path = MarkdownEntryUtility.PublishEntryFor11ty(entryDraftsRootInfo.FullName, entryRootInfo.FullName, entryFileName);

            traceSource?.WriteLine($"{nameof(MarkdownEntryActivity)}: Published entry: {path}");
        }