Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entry thumbnail image #10

Open
sjehuda opened this issue Dec 3, 2016 · 0 comments
Open

Entry thumbnail image #10

sjehuda opened this issue Dec 3, 2016 · 0 comments

Comments

@sjehuda
Copy link
Owner

sjehuda commented Dec 3, 2016

Entry image, between date and content should be determined by given website.
Entry image works nicely with entries that start with text, but not with entries that start with image.

QupZilla news bloh Atom feed as an example.
Compare first couple of entries with last couple of entries.
qupzilla_atom_thumbnails

QupZilla master git Atom feed
recent_commits_to_qupzillamaster

CSS

.image {
  border: 2px solid #c7cacc;
  border-radius: 10%;
  display: inline-block;
  float: left;
  margin: 15px 40px 15px auto;
  overflow: hidden;
  position: relative;
  height: 8em;
  width: 8em;

  /* for atom feeds of gitlab and github */
  height: 50px;
  width: 50px;

  /* for QupZilla news blog */
  height: 72px;
  width: 72px;
}

.image > img {
  margin: auto;
  position: absolute;
  width: 8em;
  bottom: 0;
  right: 0;
  left: 0;
  top: 0;
  transform: scale(1, 1);
  -ms-transform: scale(1, 1);
  -webkit-transform: scale(1, 1);
}

XSLT

<!-- entry image -->
<xsl:choose>
    <xsl:when test='figures'>
        <div class='image'>
            <xsl:element name='img'>
                <xsl:attribute name='src'>
                    <xsl:value-of select='figures/figure/img/@src'/>
                </xsl:attribute>
                <xsl:attribute name='alt'>
                    <xsl:choose>
                        <xsl:when test='figures/figure/figcaption'>
                            <xsl:value-of select='figures/figure/figcaption'/>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:text>thumbnail</xsl:text>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:attribute>
            </xsl:element>
        </div>
    </xsl:when>
    <xsl:when test='media:thumbnail'>
        <div class='image'>
            <xsl:element name='img'>
                <xsl:attribute name='src'>
                    <xsl:value-of select='media:thumbnail/@url'/>
                </xsl:attribute>
                <xsl:attribute name='alt'>
                    <!-- xsl:value-of select='media:content/media:title'/ -->
                    <xsl:text>thumbnail</xsl:text>
                </xsl:attribute>
            </xsl:element>
        </div>
    </xsl:when>
</xsl:choose>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant