Skip to content

Commit 216a7a2

Browse files
committed
releasing 10.09
1 parent 910a69f commit 216a7a2

File tree

10 files changed

+537
-90
lines changed

10 files changed

+537
-90
lines changed

.data/app.xml

Lines changed: 448 additions & 57 deletions
Large diffs are not rendered by default.

blade/_000-blade.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<p>
2020
<em>RazorBlade</em> can be installed as a <a href="https://github.com/DNN-Connect/razor-blade/releases" target="_blank">stand-alone DNN module</a> or if you are creating your own module, you can include it in your distribution. 2sxc 9.40+ includes <em>RazorBlade</em> 1.01, 2sxc 10.06 includes 2.0 and 10.09 includes v2.02. If you see errors, you probably need to install a newer version of <em>RazorBlade</em>.
2121
</p>
22-
@rzr.RazorVersionBox(2.01)
22+
@rzr.RazorVersionBox(3.00)
2323
</trim>
2424

2525
<hr>

blade/_330-open-graph.cshtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
</trim>
1414

1515
@{
16-
HtmlPage.AddOpenGraph("og:xyz", "other");
16+
// note: 'og:' is auto-prefixed if not given in the key
17+
HtmlPage.AddOpenGraph("title", "Demo of OpenGraph headers");
18+
HtmlPage.AddOpenGraph("type", "website");
1719
}
1820

1921
<hide>

blade/_800-tags-overview.cshtml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
Learn how to use <code>ToSic.Razor.Blade</code> fluent <code>Tag</code> API to do really cool stuff. This uses <a href="https://github.com/DNN-Connect/razor-blade" target="_blank">ToSic.Razor.Blade</a>.
1616
</p>
1717

18-
@rzr.RazorVersionBox(3.0)
18+
@rzr.RazorVersionBox(3.00)
1919
</trim>
2020

2121
<hr>
@@ -53,9 +53,15 @@
5353
"The API automatically fixes unsafe URLs like Umlauts, japanese characters etc. - SuperSmart 😎",
5454
"new!", rzr.VersionInfo(version, 3.00))
5555

56-
todo image picture with src and srcset
56+
@hlp.TutorialLink("Picture Tags for various sizes / resolutions", "blade825picture",
57+
"Here's an example how to easily generate picture tags, which are the future of Images",
58+
"new!", rzr.VersionInfo(version, 3.00))
59+
60+
@hlp.TutorialLink("Start and End Tags", "blade828",
61+
"In some cases you may want to just get the start or end-tag.",
62+
"new!", rzr.VersionInfo(version, 3.00))
63+
5764

58-
todo: links and iframe with safe href
5965

6066
@hlp.TutorialLink("Create custom (non Html5) tags", "blade829",
6167
"Working with tags in your code to stay error-free and do amazing stuff",

blade/_820-tag-tag.cshtml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,6 @@
3939
}
4040
@infoBox
4141

42-
<trim>
43-
<hr>
44-
<h2>Creating Open/Close Tags separately</h2>
45-
<div>
46-
A <code>Tag</code> object also has a <code>.TagStart</code> and <code>.TagEnd</code> property, which just contains that part of the tag, allowing you to place these tags around your work.
47-
</div>
48-
</trim>
49-
@{
50-
var successBox = Tag.Div()
51-
.Class("alert alert-success");
52-
}
53-
@successBox.TagStart
54-
This tag was written using both <code>.Open</code> and <code>.Close</code>
55-
because it may be easier for you that way.
56-
@successBox.TagEnd
57-
5842
<trim>
5943
<hr>
6044
<h2>Building Tags within Tags using <code>Add(...)</code></h2>

blade/_825-img.cshtml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,44 @@
11
@using ToSic.Razor.Blade;
22
<hide>
33
@RenderPage("_header.cshtml")
4+
@{
5+
var rzrHelp = CreateInstance("_api-docs.cshtml");
6+
}
47
</hide>
58
<trim>
69
<h2><em>RazorBlade</em> Fluent Tag API <code>@@Tag.Img().Src(...)</code> and <code>Srcset(...)</code> <em>v3</em></h2>
710
<div>
811
One of the magic bits of the Html5 tags is that they are smart. For example, url properties like <code>Src()</code> or <code>Href()</code> will safely encode if they are not yet encoded.
912
This is super important for CMS solutions where the image file may easily contain umlaut characters or spaces. <br>
13+
14+
@rzrHelp.ApiLinks(new string[] {
15+
"Img()", "https://razor-blade.net/api/ToSic.Razor.Html5.Img.html",
16+
".Src()", "https://razor-blade.net/api/ToSic.Razor.Html5.Img.html#ToSic_Razor_Html5_Img_Src_System_String_",
17+
".Srcset()", "https://razor-blade.net/api/ToSic.Razor.Html5.Img.html#ToSic_Razor_Html5_Img_Srcset_System_String_",
18+
})
19+
1020
<em>Note that it's <code>Srcset()</code> and not <code>SrcSet</code>. For consistency, everything is always lower case. </em>
1121
</div>
1222
</trim>
1323
<hr>
1424
@{
25+
// demo of path with umlauts and japanese characters
26+
var kaizenUrl = "überschrift-small.png?name=改善";
1527
var path = App.Path + "/blade/assets/tag-img/";
16-
var kaizenUrl = "改善-small.png";
1728
var kaizenFullPath = path + kaizenUrl;
1829
var kaizenFullHd = kaizenFullPath.Replace("small", "large");
1930
}
2031
This file is called @kaizenUrl <br>
2132
@Tag.Img().Src(kaizenFullPath)
22-
33+
<hide>
2334
<pre>@Tag.Img().Src(kaizenFullPath).ToString()</pre>
2435
<hr>
36+
</hide>
37+
2538
And now the same thing with <code>Srcset</code> which allows high-density images: <br>
2639
@Tag.Img().Srcset(kaizenFullPath, 1).Srcset(kaizenFullHd, 2)
40+
<hide>
2741
<pre>@Tag.Img().Srcset(kaizenFullPath, 1).Srcset(kaizenFullHd, 2).ToString()</pre>
2842

29-
30-
<hide>
3143
@RenderPage("../shared/_source-code.cshtml", new { Path = VirtualPath })
3244
</hide>

blade/_825-picture.cshtml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,43 @@
11
@using ToSic.Razor.Blade;
22
<hide>
33
@RenderPage("_header.cshtml")
4+
@{
5+
var rzrHelp = CreateInstance("_api-docs.cshtml");
6+
}
47
</hide>
58
<trim>
6-
<h2><em>RazorBlade</em> Fluent Tag API <code>@@Tag.Img().Src(...)</code> <em>v3</em></h2>
9+
<h2><em>RazorBlade</em> Fluent Tag API <code>@@Tag.Picture()</code> with many sources <em>v3</em></h2>
710
<div>
8-
One of the magic bits of the Html5 tags is that they are smart. For example, url properties like <code>Src()</code> or <code>Href()</code> will safely encode if they are not yet encoded.
9-
This is super important for CMS solutions where the image file may easily contain umlaut characters or spaces.
11+
<code>picture</code> tags are the future of <code>img</code> tags. But it can be messy to create them, so here goes 😉.
12+
This example will return a small image if your screen is small, a large one otherwise. Try resizing the width of your browser to test. The image will become blurry if the browser is less than 800px wide.
13+
14+
@rzrHelp.ApiLinks(new string[] {
15+
"Picture()", "https://razor-blade.net/api/ToSic.Razor.Html5.Picture.html",
16+
"Source()", "https://razor-blade.net/api/ToSic.Razor.Html5.Source.html",
17+
})
1018
</div>
1119
</trim>
20+
<hr>
1221
@{
13-
var kaizenUrl = "改善.png";
22+
var path = App.Path + "/blade/assets/tag-img/";
23+
var small = "überschrift-small.png";
24+
var large = "überschrift-large.png";
1425
}
26+
@Tag.Picture(
27+
Tag.Source().Srcset(path + large).Media("(min-width: 800px)"),
28+
Tag.Img().Src(path + small)
29+
)
30+
<hide>
31+
<pre>@Tag.Picture(
32+
Tag.Source().Srcset(path + large).Media("(min-width: 800px)"),
33+
Tag.Img().Src(path + small)
34+
).ToString()</pre>
1535

16-
<hr>
17-
This file is called @kaizenUrl <br>
18-
@Tag.Img().Src(App.Path + "/blade/assets/tag-img/" + kaizenUrl)
36+
<style>
37+
picture, picture source, picture img {
38+
width: 100%;
39+
}
40+
</style>
1941

20-
<hide>
2142
@RenderPage("../shared/_source-code.cshtml", new { Path = VirtualPath })
2243
</hide>

blade/_828-tag-start-end.cshtml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@using ToSic.Razor.Blade;
2+
<hide>
3+
@RenderPage("_header.cshtml")
4+
@{
5+
var rzrHelp = CreateInstance("_api-docs.cshtml");
6+
}
7+
</hide>
8+
<trim>
9+
<h2><em>RazorBlade</em> Fluent Tag API <code>TagStart</code>/<code>TagEnd</code> <em>v3</em></h2>
10+
<div>
11+
A <code>Tag</code> object also has a <code>.TagStart</code> and <code>.TagEnd</code> property, which just contains that part of the tag, allowing you to place these tags around your work.
12+
</div>
13+
@rzrHelp.ApiLinks(new string[] {
14+
".TagStart", "https://razor-blade.net/api/ToSic.Razor.Markup.TagBase.html#ToSic_Razor_Markup_TagBase_TagStart",
15+
".TagEnd", "https://razor-blade.net/api/ToSic.Razor.Markup.TagBase.html#ToSic_Razor_Markup_TagBase_TagEnd",
16+
})
17+
<hr>
18+
<h3>The result</h3>
19+
</trim>
20+
21+
@{
22+
var successBox = Tag.Div().Class("alert alert-success");
23+
}
24+
@successBox.TagStart
25+
This tag was written using both <code>.TagStart</code> and <code>.TagEnd</code>
26+
because it may be easier for you that way.
27+
@successBox.TagEnd
28+
29+
<hide>
30+
@RenderPage("../shared/_source-code.cshtml", new { Path = VirtualPath })
31+
</hide>
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)