Example #1
0
        public ActionResult Article(string slug, ArticleRevisionDate revisionDate = null, bool redirect = true)
        {
            var model = new WikiArticleViewModel(this.Request.RequestContext, slug, revisionDate, redirect);

            this.Seo.CanonicalUrl = this.GetArticleCanonicalUrl(model);

            return(this.View(model));
        }
Example #2
0
        private string GetArticleCanonicalUrl(WikiArticleViewModel model)
        {
            string canonicalUrl = null;

            if (model.ShouldRedirect)
            {
                canonicalUrl = this.Url.WikiArticle(model.ArticleRedirectTo);
            }
            else if (model.HasArticle)
            {
                canonicalUrl = this.Url.WikiArticle(model.ArticleId);
            }

            return(canonicalUrl);
        }
Example #3
0
        public ActionResult Index()
        {
            var model = new WikiArticleViewModel(this.Request.RequestContext, string.Empty);

            return(this.View("Article", model));
        }