Skip to content

Commit

Permalink
Merge pull request #299 from EvanNotFound/dev
Browse files Browse the repository at this point in the history
v2.5.2
  • Loading branch information
EvanNotFound authored Nov 14, 2023
2 parents 3b41508 + 60d5778 commit 9fca526
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 300 deletions.
29 changes: 9 additions & 20 deletions layout/_meta/article-copyright.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -40,41 +40,30 @@
url: 'https://creativecommons.org/licenses/by-nd/4.0'
},
'cc_by_nc_sa': {
label: __('license_content', '<a class="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a>'),
label: __('copyright.license_content', '<a class="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY-NC-SA 4.0</a>'),
url: 'https://creativecommons.org/licenses/by-nc-sa/4.0'
},
'public_domain': {
label: __('copyright.public_domain'),
url: null
}
};
const isValidLicense = (licenseKey) => {
return licenseMap.hasOwnProperty(licenseKey);
};
const getLicenseType = () => {
if (page.copyright && page.copyright !== "") {
return 'custom';
} else if (page.license && isValidLicense(page.license)) {
return page.license;
} else if (theme.articles.copyright.default && isValidLicense(theme.articles.copyright.default)) {
return theme.articles.copyright.default;
} else {
return 'cc_by_nc_sa';
}
};
const licenseType = getLicenseType();
let licenseType = 'cc_by_nc_sa'; // Default license type
if (page.copyright && page.copyright !== "") {
licenseType = 'custom';
} else if (page.license && licenseMap[page.license]) {
licenseType = page.license;
} else if (theme.articles.copyright.default && licenseMap[theme.articles.copyright.default]) {
licenseType = theme.articles.copyright.default;
}
%>

<% if (licenseType === 'custom') { %>
<%- page.copyright %>
<% } else { %>
<%- licenseMap[licenseType].label %>
<% } %>


</li>
</ul>
</div>
2 changes: 1 addition & 1 deletion layout/article-content.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<%- articleRecommendationGenerator(page) %>
<% if (page.prev || page.next) { %>
<div class="article-nav mt-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<div class="article-nav my-8 flex justify-between items-center px-2 sm:px-6 md:px-8">
<% if (page.prev) { %>
<div class="article-prev border-border-color shadow-redefine-flat shadow-shadow-color-2 rounded-medium px-4 py-2 hover:shadow-redefine-flat-hover hover:shadow-shadow-color-2">
<a class="prev"
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-redefine",
"version": "2.5.1",
"version": "2.5.2",
"private": false,
"description": "Redefine your writing in Hexo Theme Redefine.",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions scripts/events/welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ hexo.on("ready", async () => {
| | | | _ | |___| | | | |___ | _ <| |___| |_| | |___| _| | || |\\ | |___ |
| |_| |_| |_|_____|_| |_|_____| |_| \\_\\_____|____/|_____|_| |___|_| \\_|_____| |
| |
| current version v${version} |
| latest version v${jsonData["dist-tags"].latest} |
| current v${version} latest v${jsonData["dist-tags"].latest} |
| https://github.com/EvanNotFound/hexo-theme-redefine |
+======================================================================================+
`,
);
Expand All @@ -55,8 +55,8 @@ hexo.on("ready", async () => {
| | | | _ | |___| | | | |___ | _ <| |___| |_| | |___| _| | || |\\ | |___ |
| |_| |_| |_|_____|_| |_|_____| |_| \\_\\_____|____/|_____|_| |___|_| \\_|_____| |
| |
| current version v2.5.1 |
| fetch latest version failed |
| current v${version} fetch latest failed |
| https://github.com/EvanNotFound/hexo-theme-redefine |
+======================================================================================+
`,
);
Expand Down
Loading

0 comments on commit 9fca526

Please sign in to comment.