mirror of
https://github.com/trambarhq/relaks-wordpress-example.git
synced 2025-09-24 22:41:31 +02:00
Fixed archive links.
Fixed media view. Fixed route to tag pages.
This commit is contained in:
@@ -152,6 +152,13 @@ class Route {
|
||||
if (post) {
|
||||
return { pageType: 'post', postSlug, siteURL };
|
||||
}
|
||||
|
||||
// see if it's pointing to a tag when no prefix is used
|
||||
let tagSlug = _.last(slugs);
|
||||
tag = await wp.fetchTag(tagSlug);
|
||||
if (tag) {
|
||||
return { pageType: 'tag', tagSlug: tag.slug, siteURL };
|
||||
}
|
||||
}
|
||||
|
||||
async loadPageData(url) {
|
||||
@@ -186,6 +193,7 @@ class Route {
|
||||
let { siteURL } = this.params;
|
||||
let siteURLInsecure = 'http:' + siteURL.substr(6);
|
||||
if (node.name === 'a') {
|
||||
node.attribs.href = _.trim(node.attribs.href);
|
||||
if (node.attribs.href) {
|
||||
if (!_.startsWith(node.attribs.href, '/')) {
|
||||
if (_.startsWith(node.attribs.href, siteURL)) {
|
||||
|
@@ -39,7 +39,8 @@ A {
|
||||
margin-right: -0.4em;
|
||||
text-shadow: 0 0 0 #fff;
|
||||
cursor: pointer;
|
||||
transition: text-shadow 1s, color 1s;
|
||||
transition: text-shadow 1s, color 1s, opacity 0.5s;
|
||||
color: #cccccc;
|
||||
|
||||
&:link, &:visited {
|
||||
color: #cccccc;
|
||||
@@ -59,6 +60,10 @@ A {
|
||||
&.disabled {
|
||||
opacity: 0.5;
|
||||
cursor: default;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.5 !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.highlighted {
|
||||
|
@@ -9,7 +9,7 @@ class MediaView extends PureComponent {
|
||||
let { media, size } = this.props;
|
||||
let info = _.get(media, [ 'media_details', 'sizes', size ]);
|
||||
if (!info) {
|
||||
return;
|
||||
info = media;
|
||||
}
|
||||
let props = {
|
||||
src: info.source_url,
|
||||
|
@@ -299,13 +299,15 @@ class SideNavSync extends PureComponent {
|
||||
let { date } = route.params;
|
||||
let className, url;
|
||||
if (monthEntry.year === selectedYear) {
|
||||
if (date && monthEntry.month === date.month) {
|
||||
className = 'selected';
|
||||
}
|
||||
|
||||
let postList = _.find(postLists, { monthEntry });
|
||||
if (!postList || !_.isEmpty(postList.posts)) {
|
||||
url = route.prefetchArchiveURL(monthEntry);
|
||||
}
|
||||
|
||||
if (date && monthEntry.month === date.month) {
|
||||
className = 'selected';
|
||||
} else {
|
||||
className = 'disabled';
|
||||
}
|
||||
}
|
||||
return (
|
||||
|
Reference in New Issue
Block a user