File tree Expand file tree Collapse file tree 4 files changed +36
-48
lines changed
DasBlog.Services/ConfigFile Expand file tree Collapse file tree 4 files changed +36
-48
lines changed Original file line number Diff line number Diff line change @@ -79,44 +79,8 @@ public string Root {
79
79
}
80
80
}
81
81
}
82
-
83
- public string CdnFrom
84
- {
85
- get
86
- {
87
- return _cdnFrom ;
88
- }
89
- set
90
- {
91
- if ( ! string . IsNullOrEmpty ( value ) )
92
- {
93
- _cdnFrom = value + ( value . EndsWith ( "/" ) ? "" : "/" ) ;
94
- }
95
- else
96
- {
97
- _cdnFrom = value ;
98
- }
99
- }
100
- }
101
-
102
- public string CdnTo
103
- {
104
- get
105
- {
106
- return _cdnTo ;
107
- }
108
- set
109
- {
110
- if ( ! string . IsNullOrEmpty ( value ) )
111
- {
112
- _cdnTo = value + ( value . EndsWith ( "/" ) ? "" : "/" ) ;
113
- }
114
- else
115
- {
116
- _cdnTo = value ;
117
- }
118
- }
119
- }
82
+ public string CdnFrom { get ; set ; }
83
+ public string CdnTo { get ; set ; }
120
84
121
85
public string AllowedHosts { get ; set ; }
122
86
public string Copyright { get ; set ; }
Original file line number Diff line number Diff line change 29
29
30
30
<!-- END OF SUGGESTED SETTINGS -->
31
31
32
- <!-- OPTIONAL: Content Delivery Network (CDN)
33
- The two CDN settings below (CdnFrom/CdnTo) is a search and replace pattern.
34
- Note: This setting will not work from localhost when posting a new blog post.
35
- -->
36
- <!-- The part of your <Root> or binary hosting path you want to replace (ex. http://example.com/content/binary/): -->
37
- <CdnFrom ></CdnFrom >
38
- <!-- The URL of the cdn servcie you are replacing to (ex. http://cdn.example.com/content/binary/): -->
39
- <CdnTo ></CdnTo >
40
-
41
32
<MastodonServerUrl />
42
33
<MastodonAccount />
43
34
65
56
<LogDir >logs</LogDir >
66
57
<BinariesDir >content/binary</BinariesDir >
67
58
59
+ <!-- OPTIONAL: Content Delivery Network (CDN)
60
+ The two CDN settings below (CdnFrom/CdnTo) is a search and replace pattern.
61
+ * Default binaries storage is <Root>/<BinariesDir>.
62
+ * Note: This setting will not work from localhost when posting a new blog post.
63
+ -->
64
+ <!-- The part of your <Root>/<BinariesDir> hosting path you want to replace (ex. http://example.com/content/binary/): -->
65
+ <CdnFrom ></CdnFrom >
66
+ <!-- The URL of the cdn servcie you are replacing to (ex. http://cdn.example.com/content/binary/): -->
67
+ <CdnTo ></CdnTo >
68
+
68
69
<EnableTitlePermaLink >true</EnableTitlePermaLink >
69
70
<EnableTitlePermaLinkUnique >false</EnableTitlePermaLinkUnique >
70
71
<EnableTitlePermaLinkSpaces >false</EnableTitlePermaLinkSpaces >
Original file line number Diff line number Diff line change @@ -240,9 +240,16 @@ public class SiteViewModel
240
240
241
241
[ DisplayName ( "Time zone index" ) ]
242
242
[ Description ( "" ) ]
243
-
244
243
public int DisplayTimeZoneIndex { get ; set ; }
245
244
245
+ [ DisplayName ( "CDN from" ) ]
246
+ [ Description ( "The part of your Root URL to replace with the CDN URL. (optional)" ) ]
247
+ public string CdnFrom { get ; set ; }
248
+
249
+ [ DisplayName ( "CDN to" ) ]
250
+ [ Description ( "The CDN URL that will replace 'CDN from'. (optional)" ) ]
251
+ public string CdnTo { get ; set ; }
252
+
246
253
[ DisplayName ( "Comments require approval" ) ]
247
254
[ Description ( "" ) ]
248
255
public bool CommentsRequireApproval { get ; set ; }
Original file line number Diff line number Diff line change 694
694
@Html.ValidationMessageFor(m => m.SiteConfig.DisplayTimeZoneIndex, null, new { @class = " text-danger" } )
695
695
696
696
</div >
697
+
698
+ <div class =" form-group row mb-3" >
699
+
700
+ @Html.LabelFor(m => @Model.SiteConfig.CdnFrom , null, new { @class = " col-form-label col-sm-2" } )
701
+ <div class =" col-sm-5" >
702
+ @Html.TextBoxFor(m => @Model.SiteConfig.CdnFrom , null, new { @class = " form-control sm-10" } )
703
+ </div >
704
+ @Html.ValidationMessageFor(m => m.SiteConfig.CdnFrom, null, new { @class = " text-danger" } )
705
+
706
+ @Html.LabelFor(m => @Model.SiteConfig.CdnTo , null, new { @class = " col-form-label col-sm-2" } )
707
+ <div class =" col-sm-5" >
708
+ @Html.TextBoxFor(m => @Model.SiteConfig.CdnTo , null, new { @class = " form-control sm-10" } )
709
+ </div >
710
+ @Html.ValidationMessageFor(m => m.SiteConfig.CdnTo, null, new { @class = " text-danger" } )
711
+
712
+ </div >
697
713
698
714
<h3 >Security</h3 >
699
715
You can’t perform that action at this time.
0 commit comments