本文整理汇总了Python中invenio.config.CFG_SITE_URL.replace方法的典型用法代码示例。如果您正苦于以下问题:Python CFG_SITE_URL.replace方法的具体用法?Python CFG_SITE_URL.replace怎么用?Python CFG_SITE_URL.replace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类invenio.config.CFG_SITE_URL
的用法示例。
在下文中一共展示了CFG_SITE_URL.replace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tmpl_pageheader
# 需要导入模块: from invenio.config import CFG_SITE_URL [as 别名]
# 或者: from invenio.config.CFG_SITE_URL import replace [as 别名]
#.........这里部分代码省略.........
# substring found --> offer trackback link in header
if recordIndexInURI != -1:
recid = uri[recordIndexInURI:len(uri)].split('/')[2].split("?")[0] #recid might end with ? for journal records
headerLinkbackTrackbackLink = get_trackback_auto_discovery_tag(recid)
if CFG_WEBSTYLE_INSPECT_TEMPLATES:
inspect_templates_message = '''
<table width="100%%" cellspacing="0" cellpadding="2" border="0">
<tr bgcolor="#aa0000">
<td width="100%%">
<font color="#ffffff">
<strong>
<small>
CFG_WEBSTYLE_INSPECT_TEMPLATES debugging mode is enabled. Please
hover your mouse pointer over any region on the page to see which
template function generated it.
</small>
</strong>
</font>
</td>
</tr>
</table>
'''
else:
inspect_templates_message = ""
sitename = CFG_SITE_NAME_INTL.get(ln, CFG_SITE_NAME)
if headertitle == sitename:
pageheadertitle = headertitle
else:
pageheadertitle = headertitle + ' - ' + sitename
metabase = ""
stripped_url = CFG_SITE_URL.replace("://", "")
if not CFG_BASE_URL and '/' in stripped_url:
metabase = "<base href='%s'>" % (CFG_SITE_URL,)
out = """\
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="%(ln_iso_639_a)s" xml:lang="%(ln_iso_639_a)s" xmlns:og="http://opengraphprotocol.org/schema/" >
<head>
<title>%(pageheadertitle)s</title>
%(metabase)s
<link rev="made" href="mailto:%(sitesupportemail)s" />
<link rel="stylesheet" href="%(cssurl)s/img/invenio%(cssskin)s.css" type="text/css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="%(cssurl)s/img/invenio%(cssskin)s-ie7.css" />
<![endif]-->
<!--[if gt IE 8]>
<style type="text/css">div.restrictedflag {filter:none;}</style>
<![endif]-->
%(canonical_and_alternate_urls)s
<!-- <link rel="alternate" type="application/rss+xml" title="%(sitename)s RSS" href="%(rssurl)s" /> -->
<link rel="search" type="application/opensearchdescription+xml" href="%(siteurl)s/opensearchdescription" title="%(sitename)s" />
<link rel="unapi-server" type="application/xml" title="unAPI" href="%(unAPIurl)s" />
<link rel="icon" href="/img/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
%(linkbackTrackbackLink)s
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="%(ln)s" />
<meta name="description" content="%(description)s" />
<meta name="keywords" content="%(keywords)s" />
<meta name="google-site-verification" content="mLqufkdPNxUHXFW4obCfN5NJXr4sD_SlnvsOla7RZAE" />
<meta name="msvalidate.01" content="EA9805F0F62E4FF22B98853713964B28" />
<script type="text/javascript" src="%(cssurl)s/js/jquery.min.js"></script>