示例#1
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
示例#2
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."
示例#3
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"
示例#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 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优化"
示例#5
0
文件: seo.py 项目: goto-ru/gotosite
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', )
示例#6
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"
示例#7
0
文件: seo.py 项目: lgili/Site_Gili
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")
示例#8
0
class MetaAdd(seo.Metadata):
    title = seo.Tag(head=True, max_length=68)
    description = seo.MetaTag(max_length=150)
    keywords = seo.KeywordTag()