The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BlogAreaRegistration.cs 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. using System.Web.Optimization;
  4. namespace Teknik.Areas.Blog
  5. {
  6. public class BlogAreaRegistration : AreaRegistration
  7. {
  8. public override string AreaName
  9. {
  10. get
  11. {
  12. return "Blog";
  13. }
  14. }
  15. public override void RegisterArea(AreaRegistrationContext context)
  16. {
  17. context.MapSubdomainRoute(
  18. "Blog.Blog", // Route name
  19. new List<string>() { "dev", "blog" }, // Subdomains
  20. "{username}", // URL with parameters
  21. new { controller = "Blog", action = "Blog", username = string.Empty }, // Parameter defaults
  22. new[] { typeof(Controllers.BlogController).Namespace }
  23. );
  24. context.MapSubdomainRoute(
  25. "Blog.Post", // Route name
  26. new List<string>() { "dev", "blog" }, // Subdomains
  27. "{username}/{id}", // URL with parameters
  28. new { controller = "Blog", action = "Post", username = "", id = 0 }, // Parameter defaults
  29. new[] { typeof(Controllers.BlogController).Namespace }
  30. );
  31. context.MapSubdomainRoute(
  32. "Blog.Action", // Route name
  33. new List<string>() { "dev", "blog" }, // Subdomains
  34. "Action/{controller}/{action}", // URL with parameters
  35. new { controller = "Blog", action = "Blog" }, // Parameter defaults
  36. new[] { typeof(Controllers.BlogController).Namespace }
  37. );
  38. // Register Script Bundles
  39. BundleTable.Bundles.Add(new ScriptBundle("~/bundles/blog").Include(
  40. "~/Scripts/ocupload/1.1.2/ocupload.js",
  41. "~/Scripts/PageDown/Markdown.Converter.js",
  42. "~/Scripts/PageDown/Markdown.Sanitizer.js",
  43. //"~/Scripts/bootstrap-markdown.js", Uneeded?
  44. "~/Scripts/bootbox/bootbox.min.js",
  45. "~/Areas/Blog/Scripts/Blog.js"));
  46. // Register Style Bundles
  47. BundleTable.Bundles.Add(new StyleBundle("~/Content/blog").Include(
  48. "~/Areas/Blog/Content/Blog.css",
  49. "~/Content/bootstrap-markdown.min.css"));
  50. }
  51. }
  52. }