class BasicMetadata(seo.Metadata):
    title = seo.Tag(max_length=68, head=True, populate_from=default_title)
    keywords = seo.KeywordTag(populate_from=default_keywords)
    description = seo.MetaTag(max_length=155, populate_from=default_description)

    # Adding some fields for facebook (opengraph)
    og_title = seo.MetaTag(name="og:title",
                           populate_from=default_title,
                           verbose_name="facebook title")

    og_description = seo.MetaTag(name="og:description",
                                 populate_from=default_description,
                                 verbose_name='facebook description')

    og_image = seo.MetaTag(name="og:image",
                           populate_from=default_image, verbose_name='facebook image')

    twitter_card = seo.MetaTag(name="twitter:card", populate_from='summary',
                       verbose_name="twitter card")
    twitter_site = seo.MetaTag(name="twitter:site", populate_from=default_title,
                       verbose_name="twitter site")
    twitter_title = seo.MetaTag(name="twitter:title", populate_from=default_title,
                       verbose_name="twitter title")
    twitter_description = seo.MetaTag(name="twitter:description",
                                 populate_from=default_description,
                                 verbose_name='twitter description')
    twitter_image = seo.MetaTag(name="og:image",
                        populate_from=default_image, verbose_name='twitter image')
                        
    class Meta:
Esempio n. 2
0
class BasicMetadata(seo.Metadata):
    title = seo.Tag(max_length=68, head=True)
    keywords = seo.KeywordTag()
    description = seo.MetaTag(max_length=155)

    class Meta:
        seo_views = ('notes',)
Esempio n. 3
0
class Coverage(seo.Metadata):
    """
    A SEO metadata definition, which should cover all configurable options.
    """

    def get_populate_from1(self, metadata, **kwargs):
        return "wxy"

    def get_populate_from2(self, metadata, **kwargs):
        return "xyz"

    get_populate_from2.short_description = "Always xyz"

    title = seo.Tag(populate_from=seo.Literal("example.com"), head=True)
    heading = seo.Tag(max_length=68, name="hs:tag", verbose_name="tag two",
                      head=True)

    keywords = seo.KeywordTag()
    description = seo.MetaTag(max_length=155, name="hs:metatag",
                              verbose_name="metatag two")

    raw1 = seo.Raw()
    raw2 = seo.Raw(head=True, verbose_name="raw two",
                   valid_tags=("meta", "title"))

    help_text1 = seo.Tag(help_text="Some help text 1.")
    help_text2 = seo.Tag(populate_from="def")
    help_text3 = seo.Tag(populate_from=get_populate_from1,
                         help_text="Some help text 3.")
    help_text4 = seo.Tag(populate_from=get_populate_from2)
    help_text5 = seo.Tag(populate_from="heading")
    help_text6 = seo.Tag(populate_from="heading",
                         help_text="Some help text 6.")

    populate_from1 = seo.Tag(populate_from="get_populate_from1")
    populate_from2 = seo.Tag(populate_from="heading")
    populate_from3 = seo.Tag(populate_from=seo.Literal("efg"))
    populate_from4 = seo.Tag(populate_from="ghi")
    populate_from5 = seo.Tag(populate_from="ghi", editable=False)
    populate_from6 = seo.Tag(populate_from="keywords")
    populate_from7 = seo.Tag(populate_from=get_model_instance_content)

    field1 = seo.Tag(field=models.TextField)

    class Meta:
        verbose_name = "Basic Metadatum"
        verbose_name_plural = "Basic Metadata"
        use_sites = False
        groups = {
            'advanced': ('raw1', 'raw2'),
            'help_text': (
                'help_text1', 'help_text2', 'help_text3', 'help_text4',)
        }
        seo_models = ('userapp',)
        seo_views = ('userapp',)

    class HelpText:
        help_text2 = "Updated help text2."
Esempio n. 4
0
class MyMetadata(seo.Metadata):
    title = seo.Tag(head=True, max_length=68)
    description = seo.MetaTag(max_length=155)
    keywords = seo.KeywordTag()
    heading = seo.Tag(name="h1")

    class Meta:
        seo_models = ('store', 'client.profile', 'bills.bill', 'blog.article')
        seo_views = ('store', 'client', 'bills')
Esempio n. 5
0
class FlatpagesMetadata(seo.Metadata):
    title        = seo.Tag(head=True, max_length=200)
    description  = seo.MetaTag(max_length=300)
    keywords     = seo.KeywordTag()
    heading      = seo.Tag(name="h1")

    class Meta:
        seo_models = ('flatpages_i18n', )
        seo_views = ('flatpages_i18n', )
        use_i18n = True
Esempio n. 6
0
class DefaultMetadata(seo.Metadata):
    """ A very basic default class for those who do not wish to write their own.
    """
    title = seo.Tag(head=True, max_length=68)
    keywords = seo.MetaTag()
    description = seo.MetaTag(max_length=155)
    heading = seo.Tag(name="h1")

    class Meta:
        verbose_name = "Metadata"
        verbose_name_plural = "Metadata"
        use_sites = False
        # This default class is automatically created when SEO_MODELS is
        # defined, so we'll take our model list from there.
        seo_models = getattr(settings, 'SEO_MODELS', [])

    class HelpText:
        title = "This is the page title, that appears in the title bar."
        keywords = "Comma-separated keywords for search engines."
        description = "A short description, displayed in search results."
        heading = "This is the page heading, appearing in the <h1> tag."
Esempio n. 7
0
class MyMetadata(seo.Metadata):
    title = seo.Tag(head=True, max_length=68)
    description = seo.MetaTag(max_length=155)
    keywords = seo.KeywordTag()
    heading = seo.Tag(name="h1")

    class HelpText:
        title = "This will appear in the window/tab name, as well as in search results."
        keywords = "A comma separated list of words or phrases that describe the content"
        description = "This will appear in the description"

    class Meta:
        groups = {'optional': ('heading', )}
        seo_views = ('app01', )
        verbose_name = "My basic example"
        verbose_name_plural = "My basic examples"
Esempio n. 8
0
class MyMetadata(seo.Metadata):
    title = seo.Tag(head=True, max_length=68)
    description = seo.MetaTag(max_length=155)
    keywords = seo.KeywordTag()
    heading = seo.Tag(name="h1")

    # class HelpText:
    #     title = "This will appear in the window/tab name, as well as in search results."
    #     keywords = "A comma separated list of words or phrases that describe the content"
    #     description = "This will appear in the description"
    #
    class Meta:
        seo_views = ('app01', )
        seo_models = ('app01', )
        verbose_name = "seo优化"
        verbose_name_plural = "seo优化"
Esempio n. 9
0
class Metadata(seo.Metadata):
    """SEO Metadata."""

    title = seo.Tag(head=True, max_length=68)
    description = seo.MetaTag(max_length=155)
    keywords = seo.KeywordTag()
    heading = seo.Tag(name="h1")

    class Meta:
        # use_sites = True
        use_cache = True
        # use_i18n = True
        groups = {
            "optional": [
                "heading",
            ]
        }
        seo_models = [
            "accounts",
            "blog",
            "challenges",
            "foro",
            "home",
            "organizations",
        ]
        seo_views = [
            "accounts",
            "blog",
            "challenges",
            "foro",
            "home",
            "organizations",
        ]
        backends = [
            "path",
            "modelinstance",
            "model",
            "view",
        ]
        verbose_name = "SEO Metadata"
        verbose_name_plural = "SEO Metadata"
Esempio n. 10
0
class MyMetadata(seo.Metadata):
    description = seo.MetaTag(max_length=155)
    keywords = seo.KeywordTag()
    rights = seo.MetaTag(max_length=155)
    title = seo.MetaTag(name="title", verbose_name="title")
    image = seo.MetaTag(name="og:image", verbose_name='image')
    og_title = seo.MetaTag(name="og:title",
                           populate_from="title",
                           verbose_name="facebook title")
    og_site_name = seo.MetaTag(name="og:site_name",
                               populate_from="title",
                               verbose_name="facebook sitename")

    class Meta():
        use_sites = False
        seo_models = ('goto.Event', )
Esempio n. 11
0
class MyMetadata(seo.Metadata):
    title = seo.Tag(head=True, max_length=68)
    description = seo.MetaTag(max_length=155)
    keywords = seo.KeywordTag()
    heading = seo.Tag(name="h1")
Esempio n. 12
0
class MetaAdd(seo.Metadata):
    title = seo.Tag(head=True, max_length=68)
    description = seo.MetaTag(max_length=150)
    keywords = seo.KeywordTag()