Пример #1
0
 def handle(self, *args, **options):
     if len(args) == 0:
         raise CommandError("Title of page required.")
     title = " ".join(args)
     title = title.strip()
     if not options["url"]:
         raise CommandError("--url is required.")
     create_page(title=title, url=options["url"], content="")
Пример #2
0
 def handle(self, *args, **options):
     if len(args) == 0:
         raise CommandError("Title of page required.")
     title = " ".join(args)
     title = title.strip()
     if not options["url"]:
         raise CommandError("--url is required.")
     create_page(title=title, url=options["url"], content="")
Пример #3
0
    def handle_noargs(self, **options):
        # create empty config.yaml
        if path("config.yaml").exists():
            print "config.yaml exists, skipping."
        else:
            file("config.yaml", "w").write(config_yaml)

        # create index.html
        if path("index.html").exists():
            print "index.html exists, skipping."
        else:
            create_page(url="index.html", title="Blog", content=index_html)

        # archive, tags, categories etc will be handled by views.py in future.
        # create _posts with one dummy post
        if path("_posts").exists():
            print "_posts exists, skipping."
        else:
            create_post(dummy_post_title, dummy_post_md)

        print 'All Done.'
        print 'Run "djangothis jekyll_post" or "djangothis jekyll_page" to'
        print 'create new blog post or page.'
        print 'Run "djangothis" to start server.'
Пример #4
0
    def handle_noargs(self, **options):
        # create empty config.yaml
        if path("config.yaml").exists():
            print "config.yaml exists, skipping."
        else:
            file("config.yaml", "w").write(config_yaml)

        # create index.html
        if path("index.html").exists():
            print "index.html exists, skipping."
        else:
            create_page(url="index.html", title="Blog", content=index_html)

        # archive, tags, categories etc will be handled by views.py in future.
        # create _posts with one dummy post
        if path("_posts").exists():
            print "_posts exists, skipping."
        else:
            create_post(dummy_post_title, dummy_post_md)

        print 'All Done.'
        print 'Run "djangothis jekyll_post" or "djangothis jekyll_page" to'
        print 'create new blog post or page.'
        print 'Run "djangothis" to start server.'