mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 17:41:43 -05:00
Merge pull request #1292 from xavcz/dochead
Fix HeadTags <-> Flexbox + add 2 helpers for images
This commit is contained in:
commit
e3d2ffc90f
4 changed files with 29 additions and 8 deletions
|
@ -8,13 +8,15 @@ const PostListHeader = () => {
|
|||
({PostViews, SearchForm, CategoriesList, HeadTags} = Telescope.components)
|
||||
|
||||
return (
|
||||
<div className="post-list-header">
|
||||
<div>
|
||||
<HeadTags />
|
||||
<div className="post-list-categories">
|
||||
<ListContainer collection={Categories} limit={0} resultsPropName="categories" component={CategoriesList}/>
|
||||
<div className="post-list-header">
|
||||
<div className="post-list-categories">
|
||||
<ListContainer collection={Categories} limit={0} resultsPropName="categories" component={CategoriesList}/>
|
||||
</div>
|
||||
<PostViews />
|
||||
<SearchForm/>
|
||||
</div>
|
||||
<PostViews />
|
||||
<SearchForm/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
|||
const PostThumbnail = ({post}) => {
|
||||
return (
|
||||
<a className="post-thumbnail" href={Posts.getLink(post)} target={Posts.getLinkTarget(post)}>
|
||||
<img src={post.thumbnailUrl} />
|
||||
<img src={Posts.getThumbnailUrl(post)} />
|
||||
</a>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -317,4 +317,13 @@ Telescope.utils.getFieldLabel = (fieldName, collection) => {
|
|||
const label = collection.simpleSchema()._schema[fieldName].label;
|
||||
const nameWithSpaces = Telescope.utils.camelToSpaces(fieldName.replace("telescope.", ""));
|
||||
return label || nameWithSpaces;
|
||||
}
|
||||
}
|
||||
|
||||
Telescope.utils.getLogoUrl = () => {
|
||||
const logoUrl = Telescope.settings.get("logoUrl");
|
||||
if (!!logoUrl) {
|
||||
const prefix = Telescope.utils.getSiteUrl().slice(0,-1);
|
||||
// the logo may be hosted on another website
|
||||
return logoUrl.indexOf('://') > -1 ? logoUrl : prefix + logoUrl;
|
||||
}
|
||||
};
|
|
@ -142,4 +142,14 @@ Posts.getNotificationProperties = function (post) {
|
|||
properties.htmlBody = post.htmlBody;
|
||||
|
||||
return properties;
|
||||
};
|
||||
};
|
||||
|
||||
Posts.getThumbnailUrl = (post) => {
|
||||
const thumbnailUrl = post.thumbnailUrl;
|
||||
if (!!thumbnailUrl) {
|
||||
const prefix = Telescope.utils.getSiteUrl().slice(0,-1);
|
||||
// the thumbnail may be hosted on another website
|
||||
return thumbnailUrl.indexOf('://') > -1 ? thumbnailUrl : prefix + thumbnailUrl;
|
||||
}
|
||||
};
|
||||
Posts.helpers({ getThumbnailUrl() { return Posts.getThumbnailUrl(this); } });
|
Loading…
Add table
Reference in a new issue