Example #1
0
        public override void ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, string operationName)
        {
            if (MarkdownFormat == null)
            {
                MarkdownFormat = MarkdownFormat.Instance;
            }

            var contentPage = MarkdownPage ?? MarkdownFormat.FindByPathInfo(PathInfo);

            if (contentPage == null)
            {
                httpRes.StatusCode = (int)HttpStatusCode.NotFound;
                httpRes.EndHttpHandlerRequest();
                return;
            }

            MarkdownFormat.ReloadModifiedPageAndTemplates(contentPage);

            if (httpReq.DidReturn304NotModified(contentPage.GetLastModified(), httpRes))
            {
                return;
            }

            var model = Model;

            if (model == null)
            {
                httpReq.Items.TryGetValue("Model", out model);
            }

            MarkdownFormat.ProcessMarkdownPage(httpReq, contentPage, model, httpRes);
        }
Example #2
0
        public override void ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, string operationName)
        {
            if (MarkdownFormat == null)
                MarkdownFormat = MarkdownFormat.Instance;

            var contentPage = MarkdownPage ?? MarkdownFormat.FindByPathInfo(PathInfo);
            if (contentPage == null)
            {
                httpRes.StatusCode = (int) HttpStatusCode.NotFound;
                httpRes.EndHttpRequest();
                return;
            }

            MarkdownFormat.ReloadModifiedPageAndTemplates(contentPage);

            if (httpReq.DidReturn304NotModified(contentPage.GetLastModified(), httpRes))
                return;

            MarkdownFormat.ProcessMarkdownPage(httpReq, contentPage, null, httpRes);
        }
Example #3
0
        public override void ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, string operationName)
        {
            var contentPage = RazorPage;
            if (contentPage == null)
            {
                var pageFilePath = this.FilePath.WithoutExtension();
                contentPage = RazorFormat.GetContentPage(pageFilePath);
            }
            if (contentPage == null)
            {
                httpRes.StatusCode = (int)HttpStatusCode.NotFound;
                return;
            }

            RazorFormat.ReloadModifiedPageAndTemplates(contentPage);

            if (httpReq.DidReturn304NotModified(contentPage.GetLastModified(), httpRes))
                return;

            RazorFormat.ProcessRazorPage(httpReq, contentPage, null, httpRes);
        }
        public override void ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, string operationName)
        {
            var contentPage = MarkdownPage;
            if (contentPage == null)
            {
                contentPage = MarkdownFormat.GetContentPage(
                    this.FilePath.WithoutExtension(),
                    PathInfo.TrimStart(MarkdownFormat.DirSeps).WithoutExtension());
            }
            if (contentPage == null)
            {
                httpRes.StatusCode = (int) HttpStatusCode.NotFound;
                return;
            }

            MarkdownFormat.ReloadModifiedPageAndTemplates(contentPage);

            if (httpReq.DidReturn304NotModified(contentPage.GetLastModified(), httpRes))
                return;

            MarkdownFormat.ProcessMarkdownPage(httpReq, contentPage, null, httpRes);
        }
Example #5
0
        public override void ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, string operationName)
        {
            var contentPage = MarkdownPage;

            if (contentPage == null)
            {
                var pageFilePath = this.FilePath.WithoutExtension();
                contentPage = MarkdownFormat.GetContentPage(pageFilePath);
            }
            if (contentPage == null)
            {
                httpRes.StatusCode = (int)HttpStatusCode.NotFound;
                return;
            }

            MarkdownFormat.ReloadModifiedPageAndTemplates(contentPage);

            if (httpReq.DidReturn304NotModified(contentPage.GetLastModified(), httpRes))
            {
                return;
            }

            MarkdownFormat.ProcessMarkdownPage(httpReq, contentPage, null, httpRes);
        }