How to create a custom solution template (see also this repository)
Create the projects, for each project export as a project template.
Next create a folder that will hold the custom solution template.
Extract from .zip files each project into the custom solution template folder. Note that each project has a MyTemplate.vstemplate file.
In the root of the solution folder place a icon file that represents the template that shows up in Visual Studio.
In the root folder create a new file named root.vstemplate. The contents will tell Visual Studio what to do.
The first section is pretty much self explanatory while the second section tells Visual Studio what projects to include and to create if desired virtual folders.
Example folder structure, one test project, two class projects.

The solution template
<VSTemplate Version="3.0.0" Type="ProjectGroup" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
<TemplateData>
<Name>OED EF Core base solution</Name>
<Description>Base EF Core solution</Description>
<Icon>efcore.ico</Icon>
<ProjectType>CSharp</ProjectType>
</TemplateData>
<TemplateContent>
<ProjectCollection>
<SolutionFolder Name="Class projects">
<ProjectTemplateLink ProjectName="DataLibrary">
DataLibrary\MyTemplate.vstemplate
</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="ConfigurationHelper">
ConfigurationHelper\MyTemplate.vstemplate
</ProjectTemplateLink>
</SolutionFolder>
<SolutionFolder Name="Unit test projects">
<ProjectTemplateLink ProjectName="BaseUnitTestProject">
BaseUnitTestProject\MyTemplate.vstemplate
</ProjectTemplateLink>
</SolutionFolder>
</ProjectCollection>
</TemplateContent>
</VSTemplate>
Note in this case there is no main project which in this case is intentional but you could add one. Also worth mentioning, say you create a solution template for web which today defaults to an older version of BootStrap 5. Same will happen with your template so you need to consider that. Same goes for NuGet packages.
Personally I found the above works great but too restrictive and moved to doing this with dotnet cli with batch files. Below is a base prototype which grew into a custom console project with a menu system to allow me to pick and choose project types so do not think too much about this as it was a concept idea.
@echo off
:: ------------------------------------------------------------
:: create a solution with a razor pages project and a class library
:: add Serilog packages and EF Core
:: add virtualization folders
:: add a readme.md file
:: NOTE that the Nuget packages are the latest versions as of 07-2023
:: ------------------------------------------------------------
md RazorSolution
cd RazorSolution
:: create solution
dotnet new sln -n RazorSolution
:: Here we are not using top level statements
dotnet new webapp -o Demo1 --use-program-main
:: Add Serilog packages
dotnet add Demo1\Demo1.csproj package Serilog.AspNetCore -v 7.0.0
dotnet add Demo1\Demo1.csproj package Serilog.Sinks.Console -v 4.1.0
:: Add Serilog Themes Library by Karen Payne
dotnet add Demo1\Demo1.csproj package SeriLogThemesLibrary -v 1.0.0.1
:: add virtualization folder
dotnet sln RazorSolution.sln add Demo1\Demo1.csproj --solution-folder RazorPages
:: add class library
dotnet new classlib -o DataLibrary
:: add Entity Framework Core package
dotnet add DataLibrary\DataLibrary.csproj package Microsoft.EntityFrameworkCore.SqlServer -v 7.0.9
:: add virtualization folder for class projects
dotnet sln RazorSolution.sln add DataLibrary\DataLibrary.csproj --solution-folder "Classes Projects"
cd Demo1
:: add reference to class library
dotnet add reference ../DataLibrary/DataLibrary.csproj
cd..
:: new file which once open the solution add it to the solution
echo # About> readme.md
pause
You are better off IMHO to keeping with a standard blank solution and add custom projects as outlined at How to create your own templates for dotnet new. So then the templates are in Visual Studio e.g.

And from the CLI