diff --git a/EmbedImagesMiddlewear.sln b/EmbedImagesMiddlewear.sln index 8b1f20a..ab239e0 100644 --- a/EmbedImagesMiddlewear.sln +++ b/EmbedImagesMiddlewear.sln @@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "EmbedImagesMiddlewear", "src\EmbedImagesMiddlewear\EmbedImagesMiddlewear.xproj", "{961D39B1-890E-4210-803B-A6D269BC81BA}" EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "EmbedImagesMiddlewearExample", "src\EmbedImagesMiddlewearExample\EmbedImagesMiddlewearExample.xproj", "{643B859E-8D49-4F84-909E-BE801B05A325}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -22,11 +24,16 @@ Global {961D39B1-890E-4210-803B-A6D269BC81BA}.Debug|Any CPU.Build.0 = Debug|Any CPU {961D39B1-890E-4210-803B-A6D269BC81BA}.Release|Any CPU.ActiveCfg = Release|Any CPU {961D39B1-890E-4210-803B-A6D269BC81BA}.Release|Any CPU.Build.0 = Release|Any CPU + {643B859E-8D49-4F84-909E-BE801B05A325}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {643B859E-8D49-4F84-909E-BE801B05A325}.Debug|Any CPU.Build.0 = Debug|Any CPU + {643B859E-8D49-4F84-909E-BE801B05A325}.Release|Any CPU.ActiveCfg = Release|Any CPU + {643B859E-8D49-4F84-909E-BE801B05A325}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {961D39B1-890E-4210-803B-A6D269BC81BA} = {CD7FBF48-5725-4DA0-B342-1C3319DD3B0A} + {643B859E-8D49-4F84-909E-BE801B05A325} = {CD7FBF48-5725-4DA0-B342-1C3319DD3B0A} EndGlobalSection EndGlobal diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..121a0bb --- /dev/null +++ b/Readme.md @@ -0,0 +1,23 @@ +This is a simple aspnet middlewear that converts your small images to base64 encoded data tags in html. + +I wouldn't actually recommend doing this, I mostly did this to see what is possible in aspnet core middlwear. There is much [evidence](http://davidbcalhoun.com/2011/when-to-base64-encode-images-and-when-not-to/) to suggest that it is a bad idea + +How to use: + +```csharp +public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + + app.UseEmbedImages(env); + + } + +``` + +## Before + +`` + +## After + +`` \ No newline at end of file diff --git a/src/EmbedImagesMiddlewear/BclExtensions.cs b/src/EmbedImagesMiddlewear/BclExtensions.cs new file mode 100644 index 0000000..c685ccf --- /dev/null +++ b/src/EmbedImagesMiddlewear/BclExtensions.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace EmbedImagesMiddlewear +{ + public static class BclExtensions + { + private static Regex regexImgSrc = new Regex(@"]*?src\s*=\s*[""']?([^'"" >]+?)[ '""][^>]*?>", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline); + + public static IEnumerable ToImageLinks(this string htmlSource) + { + var matchesImgSrc = regexImgSrc.Matches(htmlSource); + foreach (Match m in matchesImgSrc) + { + yield return m.Groups[1].Value; + } + } + } +} \ No newline at end of file diff --git a/src/EmbedImagesMiddlewear/Class1.cs b/src/EmbedImagesMiddlewear/Class1.cs deleted file mode 100644 index b2e5dfd..0000000 --- a/src/EmbedImagesMiddlewear/Class1.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace EmbedImagesMiddlewear -{ - public class Class1 - { - public Class1() - { - } - } -} diff --git a/src/EmbedImagesMiddlewear/init.cs b/src/EmbedImagesMiddlewear/init.cs new file mode 100644 index 0000000..1f12b4e --- /dev/null +++ b/src/EmbedImagesMiddlewear/init.cs @@ -0,0 +1,82 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace EmbedImagesMiddlewear +{ + public class EmbedImages + { + private readonly IHostingEnvironment env; + private RequestDelegate _next; + private Regex regexImgSrc = new Regex(@"]*?src\s*=\s*[""']?([^'"" >]+?)[ '""][^>]*?>", RegexOptions.Compiled); + + public EmbedImages(RequestDelegate next, IHostingEnvironment env) + { + _next = next; + this.env = env; + } + + public async Task Invoke(HttpContext context) + { + var acceptEncoding = context.Request.Headers["Accept-Encoding"]; + if (acceptEncoding.ToString().IndexOf("gzip", StringComparison.CurrentCultureIgnoreCase) < 0) + { + await _next?.Invoke(context); + return; + } + + using (var buffer = new MemoryStream()) + { + var body = context.Response.Body; + context.Response.Body = buffer; + try + { + await _next?.Invoke(context); + string bodyText; + buffer.Seek(0, SeekOrigin.Begin); + using (var reader = new StreamReader(buffer)) + { + bodyText = await reader.ReadToEndAsync(); + } + var urls = bodyText.ToImageLinks(); + foreach (var url in urls) + { + var filePath = Path.Combine(env.WebRootPath, url.Insert(0, ".")); + var file = new FileInfo(filePath); + //if (file.Length > this.maxBytes) continue; + var contentType = string.Empty; + if (new Microsoft.AspNetCore.StaticFiles.FileExtensionContentTypeProvider().TryGetContentType(filePath, out contentType)) + { + var bytes = File.ReadAllBytes(filePath); + bodyText = bodyText.Replace(url, $"data:{contentType};base64,{Convert.ToBase64String(bytes)}"); + } + } + using (var write = new MemoryStream(Encoding.UTF8.GetBytes(bodyText))) + { + write.WriteTo(body); + } + } + finally + { + context.Response.Body = body; + } + } + } + } + + public static class BuilderExtension + { + public static void UseEmbedImages(this IApplicationBuilder app, IHostingEnvironment env) + { + app.UseMiddleware(env); + } + } +} \ No newline at end of file diff --git a/src/EmbedImagesMiddlewear/project.json b/src/EmbedImagesMiddlewear/project.json index 864b9a5..be9967b 100644 --- a/src/EmbedImagesMiddlewear/project.json +++ b/src/EmbedImagesMiddlewear/project.json @@ -2,7 +2,10 @@ "version": "1.0.0-*", "dependencies": { - "NETStandard.Library": "1.6.0" + "NETStandard.Library": "1.6.0", + "Microsoft.AspNetCore.Http.Abstractions": "1.0.0", + "Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0", + "Microsoft.AspNetCore.StaticFiles": "1.0.0" }, "frameworks": { @@ -10,4 +13,4 @@ "imports": "dnxcore50" } } -} +} \ No newline at end of file diff --git a/src/EmbedImagesMiddlewearExample/.bowerrc b/src/EmbedImagesMiddlewearExample/.bowerrc new file mode 100644 index 0000000..6406626 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "wwwroot/lib" +} diff --git a/src/EmbedImagesMiddlewearExample/Controllers/HomeController.cs b/src/EmbedImagesMiddlewearExample/Controllers/HomeController.cs new file mode 100644 index 0000000..95b342a --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/Controllers/HomeController.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace EmbedImagesMiddlewearExample.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() + { + return View(); + } + + public IActionResult About() + { + ViewData["Message"] = "Your application description page."; + + return View(); + } + + public IActionResult Contact() + { + ViewData["Message"] = "Your contact page."; + + return View(); + } + + public IActionResult Error() + { + return View(); + } + } +} diff --git a/src/EmbedImagesMiddlewearExample/EmbedImagesMiddlewearExample.xproj b/src/EmbedImagesMiddlewearExample/EmbedImagesMiddlewearExample.xproj new file mode 100644 index 0000000..3603c45 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/EmbedImagesMiddlewearExample.xproj @@ -0,0 +1,23 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 643b859e-8d49-4f84-909e-be801b05a325 + EmbedImagesMiddlewearExample + .\obj + .\bin\ + v4.5.2 + + + 2.0 + + + + + + + diff --git a/src/EmbedImagesMiddlewearExample/Program.cs b/src/EmbedImagesMiddlewearExample/Program.cs new file mode 100644 index 0000000..18ee81f --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Hosting; + +namespace EmbedImagesMiddlewearExample +{ + public class Program + { + public static void Main(string[] args) + { + var host = new WebHostBuilder() + .UseKestrel() + .UseContentRoot(Directory.GetCurrentDirectory()) + .UseIISIntegration() + .UseStartup() + .Build(); + + host.Run(); + } + } +} diff --git a/src/EmbedImagesMiddlewearExample/Project_Readme.html b/src/EmbedImagesMiddlewearExample/Project_Readme.html new file mode 100644 index 0000000..1a0f5b5 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/Project_Readme.html @@ -0,0 +1,187 @@ + + + + + Welcome to ASP.NET Core + + + + + + + + + + diff --git a/src/EmbedImagesMiddlewearExample/Properties/launchSettings.json b/src/EmbedImagesMiddlewearExample/Properties/launchSettings.json new file mode 100644 index 0000000..b1230ae --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:60245/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "EmbedImagesMiddlewearExample": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/src/EmbedImagesMiddlewearExample/Startup.cs b/src/EmbedImagesMiddlewearExample/Startup.cs new file mode 100644 index 0000000..7e807dc --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/Startup.cs @@ -0,0 +1,61 @@ +using EmbedImagesMiddlewear; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace EmbedImagesMiddlewearExample +{ + public class Startup + { + public Startup(IHostingEnvironment env) + { + var builder = new ConfigurationBuilder() + .SetBasePath(env.ContentRootPath) + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) + .AddEnvironmentVariables(); + Configuration = builder.Build(); + } + + public IConfigurationRoot Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + // Add framework services. + services.AddMvc(); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + loggerFactory.AddConsole(Configuration.GetSection("Logging")); + loggerFactory.AddDebug(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + app.UseBrowserLink(); + } + else + { + app.UseExceptionHandler("/Home/Error"); + } + app.UseEmbedImages(env); + app.UseStaticFiles(); + + app.UseMvc(routes => + { + routes.MapRoute( + name: "default", + template: "{controller=Home}/{action=Index}/{id?}"); + }); + } + } +} \ No newline at end of file diff --git a/src/EmbedImagesMiddlewearExample/Views/Home/About.cshtml b/src/EmbedImagesMiddlewearExample/Views/Home/About.cshtml new file mode 100644 index 0000000..50476d1 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/Views/Home/About.cshtml @@ -0,0 +1,7 @@ +@{ + ViewData["Title"] = "About"; +} +

@ViewData["Title"].

+

@ViewData["Message"]

+ +

Use this area to provide additional information.

diff --git a/src/EmbedImagesMiddlewearExample/Views/Home/Contact.cshtml b/src/EmbedImagesMiddlewearExample/Views/Home/Contact.cshtml new file mode 100644 index 0000000..15c12c6 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/Views/Home/Contact.cshtml @@ -0,0 +1,17 @@ +@{ + ViewData["Title"] = "Contact"; +} +

@ViewData["Title"].

+

@ViewData["Message"]

+ +
+ One Microsoft Way
+ Redmond, WA 98052-6399
+ P: + 425.555.0100 +
+ +
+ Support: Support@example.com
+ Marketing: Marketing@example.com +
diff --git a/src/EmbedImagesMiddlewearExample/Views/Home/Index.cshtml b/src/EmbedImagesMiddlewearExample/Views/Home/Index.cshtml new file mode 100644 index 0000000..9f6d8f4 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/Views/Home/Index.cshtml @@ -0,0 +1,110 @@ +@{ + ViewData["Title"] = "Home Page"; +} + + + + \ No newline at end of file diff --git a/src/EmbedImagesMiddlewearExample/Views/Shared/Error.cshtml b/src/EmbedImagesMiddlewearExample/Views/Shared/Error.cshtml new file mode 100644 index 0000000..e514139 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/Views/Shared/Error.cshtml @@ -0,0 +1,14 @@ +@{ + ViewData["Title"] = "Error"; +} + +

Error.

+

An error occurred while processing your request.

+ +

Development Mode

+

+ Swapping to Development environment will display more detailed information about the error that occurred. +

+

+ Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. +

diff --git a/src/EmbedImagesMiddlewearExample/Views/Shared/_Layout.cshtml b/src/EmbedImagesMiddlewearExample/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000..341d14b --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/Views/Shared/_Layout.cshtml @@ -0,0 +1,67 @@ + + + + + + @ViewData["Title"] - EmbedImagesMiddlewearExample + + + + + + + + + + + + +
+ @RenderBody() +
+
+

© 2016 - EmbedImagesMiddlewearExample

+
+
+ + + + + + + + + + + + + @RenderSection("scripts", required: false) + + diff --git a/src/EmbedImagesMiddlewearExample/Views/_ViewImports.cshtml b/src/EmbedImagesMiddlewearExample/Views/_ViewImports.cshtml new file mode 100644 index 0000000..f5b87c5 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/Views/_ViewImports.cshtml @@ -0,0 +1,2 @@ +@using EmbedImagesMiddlewearExample +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/src/EmbedImagesMiddlewearExample/Views/_ViewStart.cshtml b/src/EmbedImagesMiddlewearExample/Views/_ViewStart.cshtml new file mode 100644 index 0000000..a5f1004 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} diff --git a/src/EmbedImagesMiddlewearExample/appsettings.json b/src/EmbedImagesMiddlewearExample/appsettings.json new file mode 100644 index 0000000..fa8ce71 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/src/EmbedImagesMiddlewearExample/bower.json b/src/EmbedImagesMiddlewearExample/bower.json new file mode 100644 index 0000000..69159b6 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/bower.json @@ -0,0 +1,10 @@ +{ + "name": "asp.net", + "private": true, + "dependencies": { + "bootstrap": "3.3.6", + "jquery": "2.2.0", + "jquery-validation": "1.14.0", + "jquery-validation-unobtrusive": "3.2.6" + } +} diff --git a/src/EmbedImagesMiddlewearExample/bundleconfig.json b/src/EmbedImagesMiddlewearExample/bundleconfig.json new file mode 100644 index 0000000..04754ba --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/bundleconfig.json @@ -0,0 +1,24 @@ +// Configure bundling and minification for the project. +// More info at https://go.microsoft.com/fwlink/?LinkId=808241 +[ + { + "outputFileName": "wwwroot/css/site.min.css", + // An array of relative input file paths. Globbing patterns supported + "inputFiles": [ + "wwwroot/css/site.css" + ] + }, + { + "outputFileName": "wwwroot/js/site.min.js", + "inputFiles": [ + "wwwroot/js/site.js" + ], + // Optionally specify minification options + "minify": { + "enabled": true, + "renameLocals": true + }, + // Optinally generate .map file + "sourceMap": false + } +] diff --git a/src/EmbedImagesMiddlewearExample/project.json b/src/EmbedImagesMiddlewearExample/project.json new file mode 100644 index 0000000..fa7f6f5 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/project.json @@ -0,0 +1,66 @@ +{ + "dependencies": { + "Microsoft.NETCore.App": { + "version": "1.0.0", + "type": "platform" + }, + "Microsoft.AspNetCore.Diagnostics": "1.0.0", + "Microsoft.AspNetCore.Mvc": "1.0.0", + "Microsoft.AspNetCore.Razor.Tools": { + "version": "1.0.0-preview2-final", + "type": "build" + }, + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", + "Microsoft.AspNetCore.StaticFiles": "1.0.0", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", + "Microsoft.Extensions.Configuration.Json": "1.0.0", + "Microsoft.Extensions.Logging": "1.0.0", + "Microsoft.Extensions.Logging.Console": "1.0.0", + "Microsoft.Extensions.Logging.Debug": "1.0.0", + "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0", + "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0", + "EmbedImagesMiddlewear": "1.0.0-*" + }, + + "tools": { + "BundlerMinifier.Core": "2.0.238", + "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final", + "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" + }, + + "frameworks": { + "netcoreapp1.0": { + "imports": [ + "dotnet5.6", + "portable-net45+win8" + ] + } + }, + + "buildOptions": { + "emitEntryPoint": true, + "preserveCompilationContext": true + }, + + "runtimeOptions": { + "configProperties": { + "System.GC.Server": true + } + }, + + "publishOptions": { + "include": [ + "wwwroot", + "Views", + "Areas/**/Views", + "appsettings.json", + "web.config" + ] + }, + + "scripts": { + "prepublish": [ "bower install", "dotnet bundle" ], + "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] + } +} \ No newline at end of file diff --git a/src/EmbedImagesMiddlewearExample/web.config b/src/EmbedImagesMiddlewearExample/web.config new file mode 100644 index 0000000..dc0514f --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/web.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/src/EmbedImagesMiddlewearExample/wwwroot/.gitignore b/src/EmbedImagesMiddlewearExample/wwwroot/.gitignore new file mode 100644 index 0000000..f1ff06d --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/wwwroot/.gitignore @@ -0,0 +1 @@ +lib/ \ No newline at end of file diff --git a/src/EmbedImagesMiddlewearExample/wwwroot/_references.js b/src/EmbedImagesMiddlewearExample/wwwroot/_references.js new file mode 100644 index 0000000..b6fe9d6 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/wwwroot/_references.js @@ -0,0 +1,6 @@ +/// +/// +/// +/// +/// +/// diff --git a/src/EmbedImagesMiddlewearExample/wwwroot/css/site.css b/src/EmbedImagesMiddlewearExample/wwwroot/css/site.css new file mode 100644 index 0000000..a157770 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/wwwroot/css/site.css @@ -0,0 +1,38 @@ +body { + padding-top: 50px; + padding-bottom: 20px; +} + +/* Wrapping element */ +/* Set some basic padding to keep content from hitting the edges */ +.body-content { + padding-left: 15px; + padding-right: 15px; +} + +/* Set widths on the form inputs since otherwise they're 100% wide */ +input, +select, +textarea { + max-width: 280px; +} + +/* Carousel */ +.carousel-caption p { + font-size: 20px; + line-height: 1.4; +} + +/* Make .svg files in the carousel display properly in older browsers */ +.carousel-inner .item img[src$=".svg"] +{ + width: 100%; +} + +/* Hide/rearrange for smaller screens */ +@media screen and (max-width: 767px) { + /* Hide captions */ + .carousel-caption { + display: none + } +} diff --git a/src/EmbedImagesMiddlewearExample/wwwroot/css/site.min.css b/src/EmbedImagesMiddlewearExample/wwwroot/css/site.min.css new file mode 100644 index 0000000..3beb45f --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/wwwroot/css/site.min.css @@ -0,0 +1 @@ +body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}} \ No newline at end of file diff --git a/src/EmbedImagesMiddlewearExample/wwwroot/favicon.ico b/src/EmbedImagesMiddlewearExample/wwwroot/favicon.ico new file mode 100644 index 0000000..a3a7999 Binary files /dev/null and b/src/EmbedImagesMiddlewearExample/wwwroot/favicon.ico differ diff --git a/src/EmbedImagesMiddlewearExample/wwwroot/images/banner1.svg b/src/EmbedImagesMiddlewearExample/wwwroot/images/banner1.svg new file mode 100644 index 0000000..1ab32b6 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/wwwroot/images/banner1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/EmbedImagesMiddlewearExample/wwwroot/images/banner2.svg b/src/EmbedImagesMiddlewearExample/wwwroot/images/banner2.svg new file mode 100644 index 0000000..9679c60 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/wwwroot/images/banner2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/EmbedImagesMiddlewearExample/wwwroot/images/banner3.svg b/src/EmbedImagesMiddlewearExample/wwwroot/images/banner3.svg new file mode 100644 index 0000000..9be2c25 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/wwwroot/images/banner3.svg @@ -0,0 +1 @@ +banner3b \ No newline at end of file diff --git a/src/EmbedImagesMiddlewearExample/wwwroot/images/banner4.svg b/src/EmbedImagesMiddlewearExample/wwwroot/images/banner4.svg new file mode 100644 index 0000000..38b3d7c --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/wwwroot/images/banner4.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/EmbedImagesMiddlewearExample/wwwroot/images/rose.jpg b/src/EmbedImagesMiddlewearExample/wwwroot/images/rose.jpg new file mode 100644 index 0000000..d727167 Binary files /dev/null and b/src/EmbedImagesMiddlewearExample/wwwroot/images/rose.jpg differ diff --git a/src/EmbedImagesMiddlewearExample/wwwroot/js/site.js b/src/EmbedImagesMiddlewearExample/wwwroot/js/site.js new file mode 100644 index 0000000..82ecce7 --- /dev/null +++ b/src/EmbedImagesMiddlewearExample/wwwroot/js/site.js @@ -0,0 +1 @@ +// Write your Javascript code. diff --git a/src/EmbedImagesMiddlewearExample/wwwroot/js/site.min.js b/src/EmbedImagesMiddlewearExample/wwwroot/js/site.min.js new file mode 100644 index 0000000..e69de29