Skip to content

Commit

Permalink
Update app.sln and app.csproj and Seo Optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Graf committed Jul 25, 2024
1 parent 978c177 commit c1c47cd
Show file tree
Hide file tree
Showing 15 changed files with 447 additions and 27 deletions.
366 changes: 360 additions & 6 deletions App_Data/app.xml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,7 @@ If you want to customize the CSS, you will usually follow the ["Create Custom St
* v06.17.00 2024-04
* strong-typed
* Auto Generated Class
* v06.17.01 2024-07
* Update app.sln and app.csproj
* Seo Optimization

8 changes: 7 additions & 1 deletion app.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<!-- This file helps VS Code provide IntelliSense - see https://go.2sxc.org/vscode -->
<!-- Template v2024-06-19. If you have issues, try getting a newer copy from the url above -->

<!-- Specify the default Namespace for C# code in this specific App -->
<PropertyGroup>
Expand Down Expand Up @@ -40,6 +41,10 @@
<ItemGroup>
<Reference Include="$(PathBin)\ToSic.*.dll" />
<Reference Include="$(PathBin)\Connect.Koi.dll" />

<!-- Common Microsoft DLLs -->
<Reference Include="$(PathBin)\System.Text.Json.dll" />

<!-- Also load files in the Dependencies folder of the current App -->
<Reference Include="Dependencies\*.dll" />
</ItemGroup>
Expand All @@ -52,10 +57,11 @@
<Reference Include="$(PathBin)\System.Web.Http.dll" />
<Reference Include="$(PathBin)\System.Web.WebPages.dll" />
<Reference Include="$(PathBin)\System.Net.Http.dll" />
<Reference Include="$(PathBin)\System.Text.Json.dll" />
<Reference Include="$(PathBin)\System.Text.Json.dll" />

<!-- System.Web is not in the DNN folder but in the .net Framework installed on the server -->
<Reference Include="System.Web" />
<Reference Include="System.Net.Http" />
</ItemGroup>

<!-- Polymorphism - if have files with the same classes confuse IntelliSense - see https://go.2sxc.org/vscode -->
Expand Down
15 changes: 14 additions & 1 deletion app.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,18 @@ EndProject
# This is necessary so that VS Code can perform intellisense in Razor
# It also requires a csproj file to exist as well
#
# Read more on https://go.2sxc.org/vscode
# Read more and get help for issues on https://go.2sxc.org/vscode
#

# Addition 2024-05
# The following section is suddenly required by the C# DevKit
# See https://github.com/microsoft/vscode-dotnettools/issues/1151
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions staging/AppCode/Data/AppResources.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial class AppResources
// Generator: CSharpDataModelsGenerator v17.99.00
// App/Edition: Events, Courses and Registration/staging
// User: 2sic Web-Developer
// When: 2024-06-17 14:29:51Z
// When: 2024-06-18 09:15:56Z
using System.Text.Json.Serialization;
using ToSic.Sxc.Adam;

Expand All @@ -25,7 +25,7 @@ namespace AppCode.Data

/// <summary>
/// AppResources data. <br/>
/// Generated 2024-06-17 14:29:51Z. Re-generate whenever you change the ContentType. <br/>
/// Generated 2024-06-18 09:15:56Z. Re-generate whenever you change the ContentType. <br/>
/// <br/>
/// Default properties such as `.Title` or `.Id` are provided in the base class. <br/>
/// Most properties have a simple access, such as `.AddNewEvent`. <br/>
Expand Down
4 changes: 2 additions & 2 deletions staging/AppCode/Data/AppSettings.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ public partial class AppSettings
// Generator: CSharpDataModelsGenerator v17.99.00
// App/Edition: Events, Courses and Registration/staging
// User: 2sic Web-Developer
// When: 2024-06-17 14:29:51Z
// When: 2024-06-18 09:15:56Z
namespace AppCode.Data
{
// This is a generated class for AppSettings (scope: System.App)
// To extend/modify it, see instructions above.

/// <summary>
/// AppSettings data. <br/>
/// Generated 2024-06-17 14:29:51Z. Re-generate whenever you change the ContentType. <br/>
/// Generated 2024-06-18 09:15:56Z. Re-generate whenever you change the ContentType. <br/>
/// <br/>
/// Default properties such as `.Title` or `.Id` are provided in the base class. <br/>
/// Most properties have a simple access, such as `.CustomerMailTemplateFile`. <br/>
Expand Down
4 changes: 2 additions & 2 deletions staging/AppCode/Data/Categories.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ public partial class Categories
// Generator: CSharpDataModelsGenerator v17.99.00
// App/Edition: Events, Courses and Registration/staging
// User: 2sic Web-Developer
// When: 2024-06-17 14:29:51Z
// When: 2024-06-18 09:15:56Z
namespace AppCode.Data
{
// This is a generated class for Categories
// To extend/modify it, see instructions above.

/// <summary>
/// Categories data. <br/>
/// Generated 2024-06-17 14:29:51Z. Re-generate whenever you change the ContentType. <br/>
/// Generated 2024-06-18 09:15:56Z. Re-generate whenever you change the ContentType. <br/>
/// <br/>
/// Default properties such as `.Title` or `.Id` are provided in the base class. <br/>
/// Most properties have a simple access, such as `.PageTitle`. <br/>
Expand Down
16 changes: 14 additions & 2 deletions staging/AppCode/Data/Event.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial class Event
// Generator: CSharpDataModelsGenerator v17.99.00
// App/Edition: Events, Courses and Registration/staging
// User: 2sic Web-Developer
// When: 2024-06-17 14:29:51Z
// When: 2024-06-18 09:15:56Z
using System.Collections.Generic;
using System.Text.Json.Serialization;
using ToSic.Sxc.Adam;
Expand All @@ -27,7 +27,7 @@ namespace AppCode.Data

/// <summary>
/// Event data. <br/>
/// Generated 2024-06-17 14:29:51Z. Re-generate whenever you change the ContentType. <br/>
/// Generated 2024-06-18 09:15:56Z. Re-generate whenever you change the ContentType. <br/>
/// <br/>
/// Default properties such as `.Title` or `.Id` are provided in the base class. <br/>
/// Most properties have a simple access, such as `.BodyContentBlocks`. <br/>
Expand Down Expand Up @@ -133,6 +133,18 @@ public abstract class ZAutoGenEvent: Custom.Data.CustomItem
/// </summary>
public string Location => _item.String("Location", fallback: "");

/// <summary>
/// MetaDescription as string. <br/>
/// For advanced manipulation like scrubHtml, use .String("MetaDescription", scrubHtml: true) etc.
/// </summary>
public string MetaDescription => _item.String("MetaDescription", fallback: "");

/// <summary>
/// MetaTitle as string. <br/>
/// For advanced manipulation like scrubHtml, use .String("MetaTitle", scrubHtml: true) etc.
/// </summary>
public string MetaTitle => _item.String("MetaTitle", fallback: "");

/// <summary>
/// Person as string. <br/>
/// For advanced manipulation like scrubHtml, use .String("Person", scrubHtml: true) etc.
Expand Down
4 changes: 2 additions & 2 deletions staging/AppCode/Data/EventDate.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial class EventDate
// Generator: CSharpDataModelsGenerator v17.99.00
// App/Edition: Events, Courses and Registration/staging
// User: 2sic Web-Developer
// When: 2024-06-17 14:29:51Z
// When: 2024-06-18 09:15:56Z
using System;
using System.Text.Json.Serialization;
using ToSic.Sxc.Adam;
Expand All @@ -26,7 +26,7 @@ namespace AppCode.Data

/// <summary>
/// EventDate data. <br/>
/// Generated 2024-06-17 14:29:51Z. Re-generate whenever you change the ContentType. <br/>
/// Generated 2024-06-18 09:15:56Z. Re-generate whenever you change the ContentType. <br/>
/// <br/>
/// Default properties such as `.Title` or `.Id` are provided in the base class. <br/>
/// Most properties have a simple access, such as `.Document`. <br/>
Expand Down
4 changes: 2 additions & 2 deletions staging/AppCode/Data/EventSettings.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial class EventSettings
// Generator: CSharpDataModelsGenerator v17.99.00
// App/Edition: Events, Courses and Registration/staging
// User: 2sic Web-Developer
// When: 2024-06-17 14:29:51Z
// When: 2024-06-18 09:15:56Z
using System.Collections.Generic;

namespace AppCode.Data
Expand All @@ -24,7 +24,7 @@ namespace AppCode.Data

/// <summary>
/// EventSettings data. <br/>
/// Generated 2024-06-17 14:29:51Z. Re-generate whenever you change the ContentType. <br/>
/// Generated 2024-06-18 09:15:56Z. Re-generate whenever you change the ContentType. <br/>
/// <br/>
/// Default properties such as `.Title` or `.Id` are provided in the base class. <br/>
/// Most properties have a simple access, such as `.Categories`. <br/>
Expand Down
4 changes: 2 additions & 2 deletions staging/AppCode/Data/ListResources.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ public partial class ListResources
// Generator: CSharpDataModelsGenerator v17.99.00
// App/Edition: Events, Courses and Registration/staging
// User: 2sic Web-Developer
// When: 2024-06-17 14:29:51Z
// When: 2024-06-18 09:15:56Z
namespace AppCode.Data
{
// This is a generated class for ListResources (scope: System.Configuration)
// To extend/modify it, see instructions above.

/// <summary>
/// ListResources data. <br/>
/// Generated 2024-06-17 14:29:51Z. Re-generate whenever you change the ContentType. <br/>
/// Generated 2024-06-18 09:15:56Z. Re-generate whenever you change the ContentType. <br/>
/// <br/>
/// Default properties such as `.Title` or `.Id` are provided in the base class. <br/>
/// Most properties have a simple access, such as `.Admin`. <br/>
Expand Down
4 changes: 2 additions & 2 deletions staging/AppCode/Data/Registrations.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial class Registrations
// Generator: CSharpDataModelsGenerator v17.99.00
// App/Edition: Events, Courses and Registration/staging
// User: 2sic Web-Developer
// When: 2024-06-17 14:29:51Z
// When: 2024-06-18 09:15:56Z
using System;
using System.Collections.Generic;
using ToSic.Sxc.Data;
Expand All @@ -26,7 +26,7 @@ namespace AppCode.Data

/// <summary>
/// Registrations data. <br/>
/// Generated 2024-06-17 14:29:51Z. Re-generate whenever you change the ContentType. <br/>
/// Generated 2024-06-18 09:15:56Z. Re-generate whenever you change the ContentType. <br/>
/// <br/>
/// Default properties such as `.Title` or `.Id` are provided in the base class. <br/>
/// Most properties have a simple access, such as `.BirthDate`. <br/>
Expand Down
4 changes: 2 additions & 2 deletions staging/AppCode/Data/SystemProtocol.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial class SystemProtocol
// Generator: CSharpDataModelsGenerator v17.99.00
// App/Edition: Events, Courses and Registration/staging
// User: 2sic Web-Developer
// When: 2024-06-17 14:29:51Z
// When: 2024-06-18 09:15:56Z
using System;

namespace AppCode.Data
Expand All @@ -24,7 +24,7 @@ namespace AppCode.Data

/// <summary>
/// SystemProtocol data. <br/>
/// Generated 2024-06-17 14:29:51Z. Re-generate whenever you change the ContentType. <br/>
/// Generated 2024-06-18 09:15:56Z. Re-generate whenever you change the ContentType. <br/>
/// <br/>
/// Default properties such as `.Title` or `.Id` are provided in the base class. <br/>
/// Most properties have a simple access, such as `.ModuleId`. <br/>
Expand Down
29 changes: 29 additions & 0 deletions staging/AppCode/Razor/DetailRazor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,34 @@ public object GetJsonLdForEventDetail(EventDate eventDate)
};
}

public void AddMetaTags(Event item, string title, string titleSuffix)
{

var metaImageUrl = item.IsNotEmpty("Image")
? Link.Image(item.Image, type: "full")
: "";

// Try to replace the term "PostTitle" in the page title with the item title, otherwise prefix the existing title
Kit.Page.SetTitle(Text.Has(item.MetaTitle) ? item.MetaTitle + titleSuffix + " " : title);

Kit.Page.SetDescription(Text.First(item.MetaDescription, item.ShortDescription));

// Add open graph meta information
var itemTitle = item.Title;
Kit.Page.AddOpenGraph("og:type", "article");
Kit.Page.AddOpenGraph("og:title", itemTitle);
Kit.Page.AddOpenGraph("og:url", Link.To(parameters: "details=" + item.UrlKey));
Kit.Page.AddOpenGraph("og:description", item.ShortDescription);
Kit.Page.AddOpenGraph("og:image", metaImageUrl);
Kit.Page.AddOpenGraph("og:image:height", "1200");
Kit.Page.AddOpenGraph("og:image:width", "630");

// // Add twitter meta information
// Kit.Page.AddMeta("twitter:card", "summary_large_image");
// Kit.Page.AddMeta("twitter:title", title);
// Kit.Page.AddMeta("twitter:description", item.ShortDescription);
// Kit.Page.AddMeta("twitter:image", metaImageUrl);
}

}
}
5 changes: 4 additions & 1 deletion staging/Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
var titleSuffix = hasEventDate
? " | " + eventStart + eventEnd
: "";
Kit.Page.SetTitle(item.Title + titleSuffix + " | ");

var title = item.Title + titleSuffix + " | ";
AddMetaTags(item, title, titleSuffix);


// Prepare toolbar without "new"
var itemToolbar = Kit.Toolbar.Default().New("-");
Expand Down

0 comments on commit c1c47cd

Please sign in to comment.