Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
simplified meta tag rendering
  • Loading branch information
EsGeh authored and EsGeh committed Mar 21, 2019
1 parent 8b22cbf commit 91b4407
Showing 1 changed file with 21 additions and 67 deletions.
88 changes: 21 additions & 67 deletions tei2html.xsl
Expand Up @@ -61,6 +61,12 @@
<xsl:with-param name="dc_publisher">
<xsl:value-of select="//tei:publicationStmt/tei:publisher/tei:orgName[@n='EOA']"/>
</xsl:with-param>
<xsl:with-param name="dc_creator">
<xsl:variable name="people" select="//tei:titleStmt/tei:author/@ref | //tei:titleStmt/tei:editor[@role='volumeeditor']/@ref"/>
<xsl:call-template name="format_persons">
<xsl:with-param name="people" select="$people"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>

</head>
Expand Down Expand Up @@ -523,6 +529,12 @@
<xsl:with-param name="dc_publisher">
<xsl:value-of select="//tei:publicationStmt/tei:publisher/tei:orgName[@n='Press']/tei:choice/tei:expan/text()"/>
</xsl:with-param>
<xsl:with-param name="dc_creator">
<xsl:variable name="people" select="//tei:titleStmt/tei:author/@ref | //tei:titleStmt/tei:editor[@role='volumeeditor']/@ref"/>
<xsl:call-template name="format_persons">
<xsl:with-param name="people" select="$people"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</head>
<body>
Expand Down Expand Up @@ -680,76 +692,18 @@
<xsl:param name="citation_author"/>
<xsl:param name="dc_title"/>
<xsl:param name="dc_publisher"/>
<xsl:param name="dc_creator"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta http-equiv="pragma" content="no-cache"/>
<xsl:element name="meta">
<xsl:attribute name="name">
<xsl:text>citation_title</xsl:text>
</xsl:attribute>
<xsl:attribute name="content">
<xsl:value-of select="$citation_title"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="meta">
<xsl:attribute name="name">
<xsl:text>citation_date</xsl:text>
</xsl:attribute>
<xsl:attribute name="content">
<xsl:value-of select="//tei:publicationStmt/tei:date/@when"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="meta">
<xsl:attribute name="name">
<xsl:text>citation_author</xsl:text>
</xsl:attribute>
<xsl:attribute name="content">
<xsl:value-of select="$citation_author"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="meta">
<xsl:attribute name="name">
<xsl:text>DC.title</xsl:text>
</xsl:attribute>
<xsl:attribute name="content">
<xsl:value-of select="$dc_title"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="meta">
<xsl:attribute name="name">
<xsl:text>DC.issued</xsl:text>
</xsl:attribute>
<xsl:attribute name="content">
<xsl:value-of select="replace(//tei:publicationStmt/tei:date/@when, '-','/')"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="meta">
<xsl:attribute name="name">
<xsl:text>DC.publisher</xsl:text>
</xsl:attribute>
<xsl:attribute name="content">
<xsl:value-of select="$dc_publisher"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="meta">
<xsl:attribute name="name">
<xsl:text>DC.type</xsl:text>
</xsl:attribute>
<xsl:attribute name="content">
<xsl:text>Text</xsl:text>
</xsl:attribute>
</xsl:element>
<xsl:element name="meta">
<xsl:attribute name="name">
<xsl:text>DC.creator</xsl:text>
</xsl:attribute>
<xsl:attribute name="content">
<xsl:variable name="people" select="//tei:titleStmt/tei:author/@ref | //tei:titleStmt/tei:editor[@role='volumeeditor']/@ref"/>
<xsl:call-template name="format_persons">
<xsl:with-param name="people" select="$people"/>
</xsl:call-template>
</xsl:attribute>
</xsl:element>
<meta name="citation_title" content="{$citation_title}"/>
<meta name="citation_date" content="{//tei:publicationStmt/tei:date/@when}"/>
<meta name="citation_author" content="{$citation_author}"/>
<meta name="DC.title" content="{$dc_title}"/>
<meta name="DC.issued" content="{replace(//tei:publicationStmt/tei:date/@when, '-','/')}"/>
<meta name="DC.publisher" content="{$dc_publisher}"/>
<meta name="DC.type" content="Text"/>
<meta name="DC.creator" content="{$dc_creator}"/>
</xsl:template>

<xsl:template name="website_body">
Expand Down

0 comments on commit 91b4407

Please sign in to comment.