mirror of
https://github.com/trambarhq/relaks-wordpress-example.git
synced 2025-09-25 06:51:30 +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) {
|
if (post) {
|
||||||
return { pageType: 'post', postSlug, siteURL };
|
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) {
|
async loadPageData(url) {
|
||||||
@@ -186,6 +193,7 @@ class Route {
|
|||||||
let { siteURL } = this.params;
|
let { siteURL } = this.params;
|
||||||
let siteURLInsecure = 'http:' + siteURL.substr(6);
|
let siteURLInsecure = 'http:' + siteURL.substr(6);
|
||||||
if (node.name === 'a') {
|
if (node.name === 'a') {
|
||||||
|
node.attribs.href = _.trim(node.attribs.href);
|
||||||
if (node.attribs.href) {
|
if (node.attribs.href) {
|
||||||
if (!_.startsWith(node.attribs.href, '/')) {
|
if (!_.startsWith(node.attribs.href, '/')) {
|
||||||
if (_.startsWith(node.attribs.href, siteURL)) {
|
if (_.startsWith(node.attribs.href, siteURL)) {
|
||||||
|
@@ -39,7 +39,8 @@ A {
|
|||||||
margin-right: -0.4em;
|
margin-right: -0.4em;
|
||||||
text-shadow: 0 0 0 #fff;
|
text-shadow: 0 0 0 #fff;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: text-shadow 1s, color 1s;
|
transition: text-shadow 1s, color 1s, opacity 0.5s;
|
||||||
|
color: #cccccc;
|
||||||
|
|
||||||
&:link, &:visited {
|
&:link, &:visited {
|
||||||
color: #cccccc;
|
color: #cccccc;
|
||||||
@@ -59,6 +60,10 @@ A {
|
|||||||
&.disabled {
|
&.disabled {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
opacity: 0.5 !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.highlighted {
|
&.highlighted {
|
||||||
|
@@ -9,7 +9,7 @@ class MediaView extends PureComponent {
|
|||||||
let { media, size } = this.props;
|
let { media, size } = this.props;
|
||||||
let info = _.get(media, [ 'media_details', 'sizes', size ]);
|
let info = _.get(media, [ 'media_details', 'sizes', size ]);
|
||||||
if (!info) {
|
if (!info) {
|
||||||
return;
|
info = media;
|
||||||
}
|
}
|
||||||
let props = {
|
let props = {
|
||||||
src: info.source_url,
|
src: info.source_url,
|
||||||
|
@@ -299,13 +299,15 @@ class SideNavSync extends PureComponent {
|
|||||||
let { date } = route.params;
|
let { date } = route.params;
|
||||||
let className, url;
|
let className, url;
|
||||||
if (monthEntry.year === selectedYear) {
|
if (monthEntry.year === selectedYear) {
|
||||||
|
if (date && monthEntry.month === date.month) {
|
||||||
|
className = 'selected';
|
||||||
|
}
|
||||||
|
|
||||||
let postList = _.find(postLists, { monthEntry });
|
let postList = _.find(postLists, { monthEntry });
|
||||||
if (!postList || !_.isEmpty(postList.posts)) {
|
if (!postList || !_.isEmpty(postList.posts)) {
|
||||||
url = route.prefetchArchiveURL(monthEntry);
|
url = route.prefetchArchiveURL(monthEntry);
|
||||||
}
|
} else {
|
||||||
|
className = 'disabled';
|
||||||
if (date && monthEntry.month === date.month) {
|
|
||||||
className = 'selected';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
Reference in New Issue
Block a user