-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3e7e2f9
commit bdbe605
Showing
6 changed files
with
74 additions
and
15 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Connect.Razor.Types.SchemaOrg | ||
{ | ||
/// <summary> | ||
/// Helper Type to keep code shorter when creating JSON LD data | ||
/// </summary> | ||
// ReSharper disable once InheritdocConsiderUsage | ||
// WIP!!! Work in progress | ||
internal class List: Dictionary<string, object> | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<img src="assets/razor-blade-logo.png" width="100%"> | ||
|
||
# Razor Blade HtmlPage API | ||
|
||
_return to [overview](https://github.com/DNN-Connect/razor-blade)_ | ||
|
||
## Properties To Change Title, Description, Keywords | ||
|
||
1. `HtmlPage.Description` (get/set) - Read/Write the page description. _v1.1_ | ||
|
||
1. `HtmlPage.Keywords` (get/set) - Read/Write the page keywords. _v1.1_ | ||
|
||
1. `HtmlPage.Title` (get/set) - Read/Write the page title. _v1.1_ | ||
|
||
## Commands to Add Headers | ||
|
||
1. `HtmlPage.AddMeta(name, content)` - Adds a meta-tag with this name and content to the header. _v1.1_ | ||
|
||
1. `AddJsonLd(...)` create a [JSON-LD (linked data) header](https://en.wikipedia.org/wiki/JSON-LD) see also [google guideline](https://developers.google.com/search/docs/guides/intro-structured-data) and [Schema.org](https://schema.org/). _v1.1_ | ||
1. `AddToJsonLd(string)` - uses a string, which should already be a valid json | ||
1. `AddToJsonLd(object)` - will JSON-serialize whatever you pass into it. For now, we recommend using `Dictionary<string, object>` to prepare the data you want to add. | ||
|
||
1. `AddOpenGraph(property, content)` add an [open-graph tag](http://ogp.me/) to the header for facebook, twitter and co. _v1.1_ | ||
|
||
1. `HtmlPage.AddToHead(string)` - Add anything to the `<head>` section of the page. The string should usually contain a meta, link or script tag. _v1.1_ | ||
|
||
## Performance Optimizations | ||
|
||
The commands above are available for comfortable use. Internally, each command finds the page object and manipulates it. If you would like to optimize the code a bit, the `GetPage()` command gives you an object with the same features, but will run a few percent faster. So you can also do this: | ||
|
||
```razor | ||
var p = HtmlPage.GetPage(); | ||
p.Title = "..."; | ||
p.Keywords = "...; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters