Beispiel #1
0
 def test_url(self):
     state.page = self.t.getPage(os.path.join("one", "two"))
     assert str(widgets.UrlTo("two")) == "two"
     state.page = self.t.getPage("one")
     assert str(widgets.UrlTo("one")) == "one"
Beispiel #2
0
 def test_url_internal(self):
     tutils.raises("internal page", str, widgets.UrlTo("internal"))
Beispiel #3
0
 def test_url_nopage(self):
     tutils.raises("unknown page", str, widgets.UrlTo("Nonexistent"))
Beispiel #4
0
 def test_url_anchor(self):
     s = str(widgets.UrlTo("TPageNoLink", anchor="foo"))
     assert s == "base/TPageNoLink#foo"
Beispiel #5
0
 def test_url(self):
     assert str(widgets.UrlTo("TPageNoLink"))
Beispiel #6
0
import countershape
from countershape import widgets, layout, markup, blog
from countershape.doc import *
this.site_url = "http://foo"
this.markup = markup.Markdown(extras=["code-friendly"])

ns.foot = "This is a footer"
ns.head = "My Example Blog"
ns.sidebar = widgets.SiblingPageIndex('/index.html', depth=1)

this.layout = layout.Layout("_layout.html")

this.stdHeaders = [
    widgets.UrlTo("media/css/reset.css"),
    widgets.UrlTo("media/css/docstyle.css"),
    widgets.UrlTo("media/css/content.css"),
]

blog = blog.Blog(blogname="My Blog",
                 blogdesc="my blog description",
                 base="src",
                 src="../blog-posts")

pages = [
    blog(),
    blog.index("index.html", "My Example Blog"),
    Page("about.mdtext", "About"),
    blog.archive("archive.html", "Archive"),
    blog.rss("rss.xml", title="My Blog RSS", fullrss=True),
]