Esempio n. 1
0
PROJECTS_FILENAME = 'projects.yaml'

LABS_SCHEMA = sy.Map({
    "labs":
    sy.MapPattern(
        sy.Str(),
        sy.Map({
            "name":
            sy.Str(),
            "prof":
            sy.Map({
                "name": sy.Seq(sy.Str()),
                "email": sy.Email(),
            }),
            "url":
            sy.Url(),
            "contacts":
            sy.EmptyList() | sy.Seq(
                sy.Map({
                    "name": sy.Str(),
                    sy.Optional("email"): sy.Email(),
                }), ),
            sy.Optional("notes"):
            sy.Str(),
        }))
})

PROJECTS_SCHEMA = sy.Map({
    "projects":
    sy.MapPattern(
        sy.Str(),
        'event':
        yaml.Str(),
        yaml.Optional('lang', default='cs'):
        yaml.Enum([
            'cs',
            'en',
        ]),
        yaml.Optional('type', default='talk'):
        yaml.Enum([
            'talk',
            'workshop',
            'interview',
            'text',
        ]),
        yaml.Optional('url'):
        yaml.Url(),
        yaml.Optional('resources_type', default='slides'):
        yaml.Enum([
            'slides',
            'text',
        ]),
        yaml.Optional('resources_url'):
        yaml.Url(),
    }), )


def register():
    signals.initialized.connect(load_appearances)


def load_appearances(pelican):
Esempio n. 3
0
import logging
from datetime import datetime, timezone
from pathlib import Path
from operator import itemgetter

from pelican import signals
import feedparser
import strictyaml as yaml

logger = logging.getLogger(__name__)

SCHEMA = yaml.Seq(
    yaml.Map({
        'title': yaml.Str(),
        'lang': yaml.Enum(['en', 'cs']),
        'link': yaml.Url(),
        'href': yaml.Url(),
    }), )


def register():
    signals.article_generator_finalized.connect(load_feeds)


def load_feeds(article_generator):
    settings = article_generator.settings
    articles = article_generator.articles

    # prepare blog articles
    blog_feed_path = settings.get('FEED_ALL_ATOM_URL',
                                  settings['FEED_ALL_ATOM'])
Esempio n. 4
0
SCHEMA = yaml.Seq(
    yaml.Map({
        'date': yaml.Datetime(),
        'title': yaml.Str(),
        'event': yaml.Str(),
        yaml.Optional('lang', default='cs'): yaml.Enum([
            'cs',
            'en',
        ]),
        yaml.Optional('type', default='talk'): yaml.Enum([
            'talk',
            'workshop',
            'interview',
        ]),
        yaml.Optional('url'): yaml.Url(),
        yaml.Optional('resources_type', default='slides'): yaml.Enum([
            'slides',
            'text',
        ]),
        yaml.Optional('resources_url'): yaml.Url(),
    }),
)


def register():
    signals.initialized.connect(load_appearances)


def load_appearances(pelican):
    path = Path('./content/data/appearances.yml')
Esempio n. 5
0
import itertools
from datetime import datetime, timezone
from pathlib import Path
from operator import attrgetter

from pelican import signals, generators
import feedparser
import strictyaml as yaml


logger = logging.getLogger(__name__)


SCHEMA = yaml.Seq(
    yaml.Map({
        'href': yaml.Url(),
        yaml.Optional('if'): yaml.Str(),
    }),
)


def register():
    signals.get_generators.connect(get_generators)


def get_generators(pelican_object):
    return PocketFeedGenerator


class Item():
    def __init__(self, entry):