Пример #1
0
def init_site():
    """ Initialize a nikola demo site. """

    from nikola.plugins.command.init import CommandInit, SAMPLE_CONF

    command = CommandInit()
    SAMPLE_CONF['SITE_URL'] = _get_site_url()
    SAMPLE_CONF.update(DATA)
    command.execute({'demo': True}, ['demo'])

    local('mv demo/* . && rmdir demo')
    local('touch files/.nojekyll')
    local('rm *.pyc')
Пример #2
0
    def _init_site(self):
        from nikola.plugins.command.init import CommandInit

        command_init = CommandInit()
        command_init.execute(options={'demo': True, 'quiet': True}, args=['demo'])

        sys.path.insert(0, '')
        os.chdir('demo')
        import conf
        _reload(conf)
        sys.path.pop(0)

        self._site = nikola.Nikola(**conf.__dict__)
Пример #3
0
    def _init_site(self):
        from nikola.plugins.command.init import CommandInit

        command_init = CommandInit()
        command_init.execute(options={'demo': True, 'quiet': True}, args=['demo'])

        sys.path.insert(0, '')
        os.chdir('demo')
        import conf
        _reload(conf)
        sys.path.pop(0)

        self._site = nikola.Nikola(**conf.__dict__)
        self._site.init_plugins()
    def _init_site(self, monkeypatch, tmp_path):
        from nikola.plugins.command.init import CommandInit

        monkeypatch.chdir(tmp_path)
        command_init = CommandInit()
        command_init.execute(options={
            'demo': True,
            'quiet': True
        },
                             args=['demo'])

        sys.path.insert(0, '')
        monkeypatch.chdir(tmp_path / 'demo')
        import conf  # noqa
        _reload(conf)
        sys.path.pop(0)

        self._site = nikola.Nikola(**conf.__dict__)
        self._site.init_plugins()
Пример #5
0
 def _create_demo_site(self):
     from nikola.plugins.command.init import CommandInit
     command_init = CommandInit()
     command_init.execute(options={'demo': True, 'quiet': True}, args=['demo'])
     os.chdir('demo')
     sys.path.insert(0, '')