A Python content management system designed for kirsle.net featuring a blog, comments and photo albums. https://rophako.kirsle.net/
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.

33 lines
879B

  1. # -*- coding: utf-8 -*-
  2. # Legacy endpoint compatibility from kirsle.net.
  3. from flask import request, redirect, url_for
  4. from rophako import app
  5. import rophako.model.blog as Blog
  6. @app.route("/+")
  7. def google_plus():
  8. return redirect("https://plus.google.com/+NoahPetherbridge/posts")
  9. @app.route("/blog.html")
  10. def ancient_legacy_blog():
  11. post_id = request.args.get("id", None)
  12. if post_id is None:
  13. return redirect(url_for("blog.index"))
  14. # Look up the friendly ID.
  15. post = Blog.get_entry(post_id)
  16. if not post:
  17. flash("That blog entry wasn't found.")
  18. return redirect(url_for("blog.index"))
  19. return redirect(url_for("blog.entry", fid=post["fid"]))
  20. @app.route("/blog/kirsle/<fid>")
  21. def legacy_blog(fid):
  22. return redirect(url_for("blog.entry", fid=fid))
  23. @app.route("/<page>.html")
  24. def legacy_url(page):
  25. return "/{}".format(page)