Family Tree as Markdown Files - Hugo - Decade

This commit is contained in:
2023-07-17 08:50:24 -07:00
parent a154662b9a
commit 5524a9eca2
2 changed files with 34 additions and 38 deletions
Shared/Models/Stateless/Methods

@ -1,5 +1,4 @@
using System.Collections.ObjectModel;
using System.Text.RegularExpressions;
namespace View_by_Distance.Shared.Models.Stateless.Methods;
@ -395,15 +394,12 @@ internal abstract class PersonContainer
{
bool? male;
bool? first;
string fullName;
string[] matches;
string? directory;
bool isDefaultName;
bool verify = true;
const int zero = 0;
string personKeyFormatted;
string lowerHyphenFullName;
List<string> distinct = new();
Models.GenealogicalDataCommunication genealogicalDataCommunication;
GenealogicalDataCommunicationLines? genealogicalDataCommunicationLines;
ReadOnlyDictionary<string, string> personKeyFormattedToPersonFullName = GetPersonKeyFormattedToPersonFullName(personBirthdayFormat, personContainers);
@ -433,12 +429,7 @@ internal abstract class PersonContainer
if (genealogicalDataCommunication.Death is null && personContainer.PersonDirectory.Status == 'D' || genealogicalDataCommunication.Death is not null && personContainer.PersonDirectory.Status == 'A')
continue;
GenealogicalDataCommunication.WriteFile(personKeyFormatted, personContainer.Person.Name, personContainer.GenealogicalDataCommunicationRelationIndividualsLines, isDefaultName, directory, genealogicalDataCommunication, verify, first.Value);
fullName = PersonName.GetFullName(personContainer.Person.Name);
lowerHyphenFullName = $"{Regex.Replace(fullName.ToLower(), "[^a-z0-9-]", "-")}";
if (distinct.Contains(lowerHyphenFullName))
continue;
MarkDown.WriteFile(personKeyFormatted, ticks, personContainer.Person.Name, genealogicalDataCommunicationRelations, a2PeopleContentDirectory, personKeyFormattedToPersonFullName, familyIndexToCollection, isDefaultName, genealogicalDataCommunication, first.Value, fullName, lowerHyphenFullName);
distinct.Add(lowerHyphenFullName);
MarkDown.WriteFile(personKeyFormatted, ticks, personContainer.Person.Name, genealogicalDataCommunicationRelations, a2PeopleContentDirectory, personKeyFormattedToPersonFullName, familyIndexToCollection, isDefaultName, genealogicalDataCommunication, first.Value);
}
}