diff --git a/hugo.toml b/hugo.toml index bfc0213..4176c0f 100644 --- a/hugo.toml +++ b/hugo.toml @@ -47,6 +47,7 @@ theme = 'farallon' authorName = '老孙' authorDescription = '资深网民孙先生' authorAvatar = 'https://i.sunpeiwen.com/source/img/logo.jpg' + icon = 'https://i.sunpeiwen.com/source/img/logo.jpg' commentDomain = '' telegram = 'https://t.me/s/imsunpw' feed = '/index.xml' @@ -54,12 +55,16 @@ theme = 'farallon' instagram = 'https://www.instagram.com/imsunpw/' github = 'https://github.com/jkjoy' footer_sns = true + post_like = true + post_view = true + actionDomain = 'https://v.wpista.com/' + dbAPIBase = 'https://db.imsun.org/' + twikoo = 'https://twikoo.ima.cm/' [outputs] home = [ "HTML","JSON","RSS","SITEMAP"] page = ["HTML"] - [markup.tableOfContents] endLevel = 5 startLevel = 3 \ No newline at end of file diff --git a/themes/farallon/README.md b/themes/farallon/README.md deleted file mode 100644 index ae1823a..0000000 --- a/themes/farallon/README.md +++ /dev/null @@ -1,155 +0,0 @@ -# Hugo Theme Farallon - -![Hugo Theme Farallon](https://static.fatesinger.com/2023/06/u1ak8xgmyn9ec24r.png) - -Farallon is a simple single column hugo theme with perfect performace and elegance design. - -## Usage - -``` -git submodule add https://github.com/bigfa/hugo-theme-farallon.git themes/farallon - -echo "theme = 'farallon'" >> hugo.toml -``` - -[Full demo site](https://github.com/bigfa/bigfa.github.io) - -## Release Notes - -### 0.3.7 - -- add footer sns icons - -### 0.3.6 - -- add post category card -- add github icon - -### 0.3.5 - -- add author sns icons - -### 0.3.4 - -- change category file name - -### 0.3.3 - -- add post type memo - -### 0.3.2 - -- add story author card - -### 0.3.1 - -- add sticky icon -- fixed db list style in dark mode - -### 0.3.0 - -- add search - -### 0.2.11 - -- add link shortcode - -### 0.2.10 - -- fixed category list and tag list style -- relative time support i18n - -### 0.2.9 - -- fixed url render error -- add friend links template - -### 0.2.8 - -- add `pre` and `code` style - -### 0.2.7 - -- refactory taxonomy - -### 0.2.6 - -- toc style changed - -### 0.2.5 - -- Fixed ol list style error - -### 0.2.4 - -- Added a gear template - -### 0.2.3 - -- Added a “back to top” button. - -### 0.2.2 - -- Added support for table of contents (TOC). - -### 0.2.1 - -- Fixed compatibility issues with older versions of SCSS. - -### 0.2.0 - -- Added dark mode support. -- Fixed footer style issues on mobile devices. - -### 0.1.0 - -- Added theme information. - -### 0.0.8 - -- Fixed date formatting issue on Safari browser. - -### 0.0.7 - -- Changed to local item retrieval without the need for a token. - -### 0.0.6 - -- Added support for Douban items. - -Usage: - -Scan the QR code with WeChat at https://node.wpista.com/. - -Enter your Douban numeric ID and click “Save” to automatically sync your Douban records. - -Click “Get integration token” to generate a token. - -Add the following parameter to your site configuration: - -``` -[params] -wpdToken = 'token generated above' -``` - -### 0.0.5 - -- Fixed styling issues on category/tag pages. - -### 0.0.4 - -- Added relative time display. -- Included sample data. - -### 0.0.3 - -- Used normalize.css. - -### 0.0.2 - -- Added menu settings. -- Added a parameter to control the display of site owner information. - -### 0.0.1 - -- Initial setup. diff --git a/themes/farallon/README_CN.md b/themes/farallon/README_CN.md deleted file mode 100644 index 827e5f0..0000000 --- a/themes/farallon/README_CN.md +++ /dev/null @@ -1,153 +0,0 @@ -# Hugo Theme Farallon - -![Hugo 主题 Farallon](https://static.fatesinger.com/2023/06/u1ak8xgmyn9ec24r.png) - -## 使用方法 - -``` -git submodule add https://github.com/bigfa/hugo-theme-farallon.git themes/farallon - -echo "theme = 'farallon'" >> hugo.toml -``` - -[完整演示站点](https://github.com/bigfa/bigfa.github.io) - -## Release Note - -### 0.3.7 - -- 增加页脚 SNS 图标 - -### 0.3.6 - -- 增加文章分类卡片 -- 增加 Github 图标 - -### 0.3.5 - -- 增加作者 SNS 图标 - -### 0.3.4 - -- 修改分类文件名 - -### 0.3.3 - -- 增加状态文章格式 - -### 0.3.2 - -- 文章页增加作者信息 - -### 0.3.1 - -- 增加置顶标识 -- 修复豆瓣页面暗黑模式下的样式问题 - -### 0.3.0 - -- 增加搜索 - -### 0.2.11 - -- 文章内链短代码 - -### 0.2.10 - -- 修正分类和标签归档页样式问题 -- 相对时间多语言支持 - -### 0.2.9 - -- 修复链接渲染错误 -- 增加友情链接页面模版 - -### 0.2.8 - -- 增加 `pre` 和 `code` 标签样式 - -### 0.2.7 - -- 整理分类页面 - -### 0.2.6 - -- 文章目录样式更新 - -### 0.2.5 - -- 有序列表样式修正 - -### 0.2.4 - -- 增加了一个卡片页面 - -### 0.2.3 - -- 增加了返回顶部按钮 - -### 0.2.2 - -- 增加 TOC 支持 - -### 0.2.1 - -- 修复 scss 低版本兼容性问题 - -### 0.2.0 - -- 增加暗黑模式支持 -- 修复移动端 footer 样式问题 - -### 0.1.0 - -- 添加主题信息 - -### 0.0.8 - -- 修复 safari 浏览器下时间格式化错误的问题 - -### 0.0.7 - -- 修改为本地获取条目,无需设置 token - -### 0.0.6 - -- 新增豆瓣条目支持 - -使用方法 - -微信扫码登录https://node.wpista.com/ - -输入你的豆瓣数字 id,点击保存即可自动同步豆瓣记录。 - -点击 Get integration token 会生成一个 token。 - -在你的站点配置中加入参数 - -``` -[params] - wpdToken= '上面生成的token' -``` - -### 0.0.5 - -- 修复分类页/标签页样式错误 - -### 0.0.4 - -- 增加相对时间 -- 加入示例数据 - -### 0.0.3 - -- 使用`normalize.css` - -### 0.0.2 - -- 增加菜单设置 -- 增加一个是否显示站长信息的参数 - -### 0.0.1 - -初始化 diff --git a/themes/farallon/assets/images/favicon.png b/themes/farallon/assets/images/favicon.png index a44155b..8ca5e96 100644 Binary files a/themes/farallon/assets/images/favicon.png and b/themes/farallon/assets/images/favicon.png differ diff --git a/themes/farallon/assets/images/logo.jpeg b/themes/farallon/assets/images/logo.jpeg index 4a430ad..f6c2ee5 100644 Binary files a/themes/farallon/assets/images/logo.jpeg and b/themes/farallon/assets/images/logo.jpeg differ diff --git a/themes/farallon/assets/scss/app.scss b/themes/farallon/assets/scss/app.scss index f04f63d..38162b6 100644 --- a/themes/farallon/assets/scss/app.scss +++ b/themes/farallon/assets/scss/app.scss @@ -13,7 +13,7 @@ body { font: { weight: 400; style: normal; - family: "LXGW WenKai Screen", PingFang SC, Hiragino Sans GB, Microsoft YaHei, + family: "Open Sans", PingFang SC, Hiragino Sans GB, Microsoft YaHei, STHeiti, WenQuanYi Micro Hei, Helvetica, Arial, sans-serif; size: 16px; } @@ -613,3 +613,30 @@ textarea { margin-right: 4px; } } + +.notice--wrapper { + background-color: rgba(0, 0, 0, 0.9); + color: #fff; + font-size: 12px; + + max-width: 800px; + padding: 10px 15px; + border-radius: 8px; + position: fixed; + z-index: 1000; + top: 15px; + left: 50%; + transform: translateX(-50%); + //transform: translateY(-100px); + transition: 0.5s transform; + // &.is-active { + //transform: translateX(-50%); + // transform: translateY(0); + // } +} + +@media (max-width: 768px) { + .notice--wrapper { + width: 80%; + } +} diff --git a/themes/farallon/assets/scss/modules/_db.scss b/themes/farallon/assets/scss/modules/_db.scss index bec8455..6b415d0 100644 --- a/themes/farallon/assets/scss/modules/_db.scss +++ b/themes/farallon/assets/scss/modules/_db.scss @@ -1,4 +1,16 @@ .db { + &--container { + --db-item-width: 150px; + --db-item-height: 215px; + --db-music-width: 150px; + --db-music-height: 150px; + --db-primary-color: var(--farallon-hover-color); + --db-background-white: var(--farallon-background-white); + --db-background-gray: var(--farallon-background-gray); + --db-border-color: var(--farallon-border-color); + --db-text-light: var(--farallon-text-light); + } + &--nav { padding: 30px 0 20px; display: flex; @@ -7,7 +19,7 @@ &Item { font-size: 20px; cursor: pointer; - border-bottom: 1px solid rgba($color: #000000, $alpha: 0); + border-bottom: 1px solid rgba(0, 0, 0, 0); transition: 0.5s border-color; display: flex; align-items: center; @@ -30,12 +42,12 @@ } &--image { - width: 150px; - height: 215px; + width: var(--db-item-width); + height: var(--db-item-height); object-fit: cover; border-radius: 4px; &:hover { - box-shadow: 0 0 10px var(--farallon-border-color); + box-shadow: 0 0 10px var(--db-border-color); } } @@ -45,14 +57,14 @@ line-height: 1.4; a { &:hover { - color: var(--farallon-hover-color); + color: var(--db-primary-color); text-decoration: underline; } } } &--genreItem { - background: var(--farallon-background-gray); + background: var(--db-background-gray); font-size: 12px; padding: 5px 12px; border-radius: 4px; @@ -61,12 +73,12 @@ line-height: 1.4; cursor: pointer; &.is-active { - background-color: var(--farallon-main-color); - color: var(--farallon-background-white); + background-color: var(--db-primary-color); + color: var(--db-background-white); } &:hover { - background-color: var(--farallon-hover-color); - color: var(--farallon-background-white); + background-color: var(--db-primary-color); + color: var(--db-background-white); } } @@ -85,46 +97,18 @@ display: flex; align-items: center; font-size: 14px; - color: var(--text-gray-lightest); + color: var(--db-text-light); } &--item { - width: 150px; + width: var(--db-item-width); margin-right: 20px; margin-bottom: 20px; position: relative; &__music img { - width: 150px; - height: 150px; + width: var(--db-music-width); + height: var(--db-music-height); object-fit: cover; } - .top250 { - position: absolute; - left: 0; - top: 0; - background: #f5c518; - color: #000000; - border-radius: 4px 4px 4px 0; - line-height: 1; - padding: 3px 10px 3px 5px; - font-size: 12px; - display: flex; - margin-bottom: 2px; - font-weight: 900; - &:after { - content: ""; - border-top-left-radius: 0; - border-bottom-left-radius: 0; - right: 0; - top: 0; - margin-right: -0.2rem; - border-radius: 0 0 4px 4px; - background: inherit; - height: 100%; - position: absolute; - width: 0.75rem; - transform: skewX(-20deg); - } - } } } @@ -383,75 +367,3 @@ flex-direction: column; } } - -.project { - &--headline { - font-size: 32px; - margin-top: 50px; - line-height: 1.5; - font-weight: 900; - } - - &--subtitle { - font-size: 18px; - font-weight: 200; - color: var(--farallon-text-light); - } -} - -.theme { - &--item { - padding: 25px 0; - font-size: 20px; - border-bottom: 1px solid var(--farallon-border-color-light); - &:last-child { - border-bottom: 0; - } - h3 { - line-height: 1; - margin: 0; - } - } - - &--tags { - display: flex; - align-items: center; - margin-top: 20px; - a { - border: 1px solid var(--farallon-main-color); - color: var(--farallon-main-color); - line-height: 1.2; - font-size: 12px; - padding: 3px 12px; - border-radius: 4px; - margin-right: 20px; - font-weight: bold; - &:hover { - border-color: var(--farallon-hover-color); - background-color: var(--farallon-hover-color); - color: var(--farallon-background-white); - } - } - } -} - -.plugin { - &--item { - padding: 15px 0; - font-size: 20px; - border-bottom: 1px solid var(--farallon-border-color-light); - &:last-child { - border-bottom: 0; - } - a { - &:hover { - color: var(--farallon-main-color); - text-decoration: underline; - } - } - .desc { - font-size: 14px; - color: var(--faraallon-text-gray); - } - } -} diff --git a/themes/farallon/assets/scss/modules/graph.scss b/themes/farallon/assets/scss/modules/graph.scss index c4d9c27..e634a4d 100644 --- a/themes/farallon/assets/scss/modules/graph.scss +++ b/themes/farallon/assets/scss/modules/graph.scss @@ -28,6 +28,8 @@ code { background-color: rgba(0, 0, 0, 0); font-size: 100%; + margin: 0; + padding: 0; } // font-family: source-code-pro, Menlo, Monaco, "Courier New", Courier, // monospace; diff --git a/themes/farallon/assets/scss/templates/single.scss b/themes/farallon/assets/scss/templates/single.scss index 8d681a4..849d264 100644 --- a/themes/farallon/assets/scss/templates/single.scss +++ b/themes/farallon/assets/scss/templates/single.scss @@ -40,7 +40,7 @@ &:hover, &.is-active { svg { - fill: var(--jl-hover-color); + fill: var(--farallon-hover-color); } } } @@ -292,3 +292,43 @@ } } } + +.button--like { + border: 0; + background-color: rgba(0, 0, 0, 0); + cursor: pointer; + display: flex; + align-items: center; + .count { + font-size: 14px; + margin-left: 3px; + font-weight: bold; + color: var(--farallon-text-gray); + } + &.is-active { + svg { + fill: var(--farallon-main-color); + } + .icon--active { + display: block; + } + .icon--default { + display: none; + } + .count { + color: var(--farallon-hover-color); + } + } + &:hover { + .count { + color: var(--farallon-hover-color); + } + } + .icon--active { + display: none; + } + + .icon--block { + display: none; + } +} diff --git a/themes/farallon/assets/ts/action.ts b/themes/farallon/assets/ts/action.ts new file mode 100644 index 0000000..d828442 --- /dev/null +++ b/themes/farallon/assets/ts/action.ts @@ -0,0 +1,152 @@ +import { farallonHelper } from "./utils"; + +interface farallonActionsOptions { + singleSelector?: string; + likeButtonSelctor?: string; + articleSelector?: string; + viewSelector?: string; + actionDomain: string; + text?: string; +} + +class farallonActions extends farallonHelper { + singleSelector: string = ".post--single"; + likeButtonSelctor: string = ".like-btn"; + articleSelector: string = ".post--item"; + viewSelector: string = ".article--views"; + actionDomain: string; + text: string = ""; + likeButton: HTMLElement | null = null; + post_id: string; + is_single: boolean = false; + + constructor(config: farallonActionsOptions) { + super(); + this.singleSelector = config.singleSelector ?? this.singleSelector; + this.likeButtonSelctor = + config.likeButtonSelctor ?? this.likeButtonSelctor; + this.articleSelector = config.articleSelector ?? this.articleSelector; + this.viewSelector = config.viewSelector ?? this.viewSelector; + this.actionDomain = config.actionDomain; + this.text = config.text ?? this.text; + + this.is_single = document.querySelector(this.singleSelector) + ? true + : false; + + if (this.is_single) { + const postSingle = document.querySelector( + this.singleSelector + ) as HTMLElement; + this.post_id = postSingle.dataset.id ?? ""; + this.initArticleLike(); + this.initArticleView(); + } else { + this.initArticlesView(); + } + } + + initArticleView() { + fetch(this.actionDomain + "post/" + this.post_id + "/view", { + method: "post", + }).then((res) => { + res.json().then((data) => { + ( + document.querySelector(this.viewSelector) as HTMLElement + ).innerText = data.views + this.text; + }); + }); + } + + initArticlesView() { + const articles: HTMLElement[] = Array.from( + document.querySelectorAll(this.articleSelector) + ); + + if (articles.length === 0) return; + + let ids: Array = []; + articles.forEach((article: HTMLElement) => { + return ids.push(article.dataset.id!); + }); + + const idsString = ids.join(","); + + fetch(this.actionDomain + "post/views?post_ids=" + idsString).then( + (res) => { + res.json().then((data) => { + const result = data.results; + articles.forEach((article: HTMLElement) => { + if (!article.querySelector(this.viewSelector)) return; + ( + article.querySelector( + this.viewSelector + ) as HTMLElement + ).innerText = + (result.find( + (item: any) => + item.post_id == article.dataset.id + ) + ? result.find( + (item: any) => + item.post_id == article.dataset.id + ).views + : 0) + this.text; + }); + }); + } + ); + } + + initArticleLike() { + this.likeButton = document.querySelector(this.likeButtonSelctor); + if (this.likeButton) { + fetch(this.actionDomain + "post/" + this.post_id + "/like").then( + (res) => { + res.json().then((data) => { + ( + this.likeButton!.querySelector( + ".count" + ) as HTMLElement + ).innerText = data.likes; + }); + } + ); + + this.likeButton.addEventListener("click", () => { + this.handleLike(); + }); + if (this.getCookie("like_" + this.post_id)) { + this.likeButton.classList.add("is-active"); + } + } + } + + handleLike() { + if (this.getCookie("like_" + this.post_id)) { + return this.showNotice("You have already liked this post"); + } + if (this.likeButton) { + const url = this.actionDomain + "post/" + this.post_id + "/like"; + fetch(url, { + method: "post", + }) + .then((response) => { + return response.json(); + }) + .then((data) => { + this.showNotice("Thanks for your like"); + const countElement = this.likeButton?.querySelector( + ".count" + ) as HTMLElement; + if (countElement) { + countElement.innerText = data.likes; + } + this.setCookie("like_" + this.post_id, "1", 1); + }); + this.likeButton?.classList.add("is-active"); + } + } +} + +export default farallonActions; diff --git a/themes/farallon/assets/ts/app.ts b/themes/farallon/assets/ts/app.ts index 1c49f8f..2bf1a15 100644 --- a/themes/farallon/assets/ts/app.ts +++ b/themes/farallon/assets/ts/app.ts @@ -1,34 +1,65 @@ -//@ts-nocheck -class farallonDate { - selector: string; - timeFormat: any = { - second: "second ago", - seconds: "seconds ago", - minute: "minute ago", - minutes: "minutes ago", - hour: "hour ago", - hours: "hours ago", - day: "day ago", - days: "days ago", - week: "week ago", - weeks: "weeks ago", - month: "month ago", - months: "months ago", - year: "year ago", - years: "years ago", - }; - doms: Array = []; - VERSION: string = "0.3.7"; - constructor(config: any) { - this.selector = config.selector; - if (config.timeFormat) { - this.timeFormat = config.timeFormat; - } - this.init(); - setTimeout(() => { - this.refresh(); - }, 1000 * 5); +import { farallonHelper } from "./utils"; +import farallonDate from "./date.ts"; +import farallonActions from "./action.ts"; +import { farallonComment } from "./comment.ts"; +import Douban from "./db.ts"; +declare global { + interface Window { + actionDomain: string; + timeFormat: string; + dbAPIBase: string; + } +} +class farallonBase extends farallonHelper { + is_single: boolean = false; + post_id: number = 0; + is_archive: boolean = false; + VERSION: string = "0.4.3"; + like_btn: any; + selctor: string = ".like-btn"; + actionDomain: string = window.actionDomain; + constructor() { + super(); + this.initCopyright(); + this.initThemeSwitch(); + this.initBack2Top(); + this.initSearch(); + } + initSearch() { + document + .querySelector('[data-action="show-search"]')! + .addEventListener("click", () => { + document + .querySelector(".site--header__center .inner")! + .classList.toggle("search--active"); + }); + } + + initBack2Top() { + if (document.querySelector(".backToTop")) { + const backToTop = document.querySelector( + ".backToTop" + ) as HTMLElement; + window.addEventListener("scroll", () => { + const t = window.scrollY || window.pageYOffset; + // console.log(t); + // const documentHeight = document.body.clientHeight; + //const windowHeight = window.innerHeight; + // const percent = Math.ceil((t / (documentHeight - windowHeight)) * 100); + + t > 200 + ? backToTop!.classList.add("is-active") + : backToTop!.classList.remove("is-active"); + }); + + backToTop.addEventListener("click", () => { + window.scrollTo({ top: 0, behavior: "smooth" }); + }); + } + } + + initCopyright() { const copyright = ``; @@ -46,75 +77,7 @@ class farallonDate { }); } - init() { - this.doms = Array.from(document.querySelectorAll(this.selector)); - this.doms.forEach((dom: any) => { - dom.innerText = this.humanize_time_ago( - dom.attributes["datetime"].value - ); - }); - } - - humanize_time_ago(datetime: string) { - const time = new Date(datetime); - const between: number = - Date.now() / 1000 - Number(time.getTime() / 1000); - if (between < 3600) { - return `${Math.ceil(between / 60)} ${ - Math.ceil(between / 60) == 1 - ? this.timeFormat.second - : this.timeFormat.seconds - }`; - } else if (between < 86400) { - return `${Math.ceil(between / 3600)} ${ - Math.ceil(between / 3660) == 1 - ? this.timeFormat.hour - : this.timeFormat.hours - }`; - } else if (between < 86400 * 30) { - return `${Math.ceil(between / 86400)} ${ - Math.ceil(between / 86400) == 1 - ? this.timeFormat.day - : this.timeFormat.days - }`; - } else if (between < 86400 * 30 * 12) { - return `${Math.ceil(between / (86400 * 30))} ${ - Math.ceil(between / (86400 * 30)) == 1 - ? this.timeFormat.month - : this.timeFormat.months - }`; - } else { - return ( - time.getFullYear() + - "-" + - (time.getMonth() + 1) + - "-" + - time.getDate() - ); - } - } - - refresh() { - this.doms.forEach((dom: any) => { - dom.innerText = this.humanize_time_ago( - dom.attributes["datetime"].value - ); - }); - } -} - -new farallonDate({ - selector: ".humane--time", - //@ts-ignore - timeFormat: window.timeFormat, -}); - -class farallonBase { - is_single: boolean = false; - post_id: number = 0; - is_archive: boolean = false; - VERSION: string = "0.2.3"; - constructor() { + initThemeSwitch() { const theme = localStorage.getItem("theme") ? localStorage.getItem("theme") : "auto"; @@ -165,25 +128,26 @@ class farallonBase { if (item.classList.contains("is-active")) return; document .querySelectorAll(".fixed--theme span") - .forEach((item) => { + .forEach((item: Element) => { item.classList.remove("is-active"); }); - // @ts-ignore - if (item.dataset.actionValue == "dark") { + if ((item as HTMLElement).dataset.actionValue == "dark") { localStorage.setItem("theme", "dark"); document.querySelector("body")!.classList.remove("auto"); document.querySelector("body")!.classList.add("dark"); item.classList.add("is-active"); //this.showNotice('夜间模式已开启'); - // @ts-ignore - } else if (item.dataset.actionValue == "light") { + } else if ( + (item as HTMLElement).dataset.actionValue == "light" + ) { localStorage.setItem("theme", "light"); document.querySelector("body")!.classList.remove("auto"); document.querySelector("body")!.classList.remove("dark"); item.classList.add("is-active"); //this.showNotice('夜间模式已关闭'); - // @ts-ignore - } else if (item.dataset.actionValue == "auto") { + } else if ( + (item as HTMLElement).dataset.actionValue == "auto" + ) { localStorage.setItem("theme", "auto"); document.querySelector("body")!.classList.remove("dark"); document.querySelector("body")!.classList.add("auto"); @@ -192,68 +156,24 @@ class farallonBase { } }); }); - - if (document.querySelector(".backToTop")) { - const backToTop = document.querySelector( - ".backToTop" - ) as HTMLElement; - window.addEventListener("scroll", () => { - const t = window.scrollY || window.pageYOffset; - // console.log(t); - // const documentHeight = document.body.clientHeight; - //const windowHeight = window.innerHeight; - // const percent = Math.ceil((t / (documentHeight - windowHeight)) * 100); - - t > 200 - ? backToTop!.classList.add("is-active") - : backToTop!.classList.remove("is-active"); - }); - - backToTop.addEventListener("click", () => { - window.scrollTo({ top: 0, behavior: "smooth" }); - }); - } - - document - .querySelector('[data-action="show-search"]')! - .addEventListener("click", () => { - document - .querySelector(".site--header__center .inner")! - .classList.toggle("search--active"); - }); - } - - getCookie(t: any) { - if (0 < document.cookie.length) { - var e = document.cookie.indexOf(t + "="); - if (-1 != e) { - e = e + t.length + 1; - var n = document.cookie.indexOf(";", e); - return ( - -1 == n && (n = document.cookie.length), - document.cookie.substring(e, n) - ); - } - } - return ""; - } - - setCookie(t: any, e: any, n: any) { - var o = new Date(); - o.setTime(o.getTime() + 24 * n * 60 * 60 * 1e3); - var i = "expires=" + o.toUTCString(); - document.cookie = t + "=" + e + ";" + i + ";path=/"; - } - - showNotice(message: any, type: any = "success") { - const html = `
${message}
`; - - document.querySelector("body")!.insertAdjacentHTML("beforeend", html); - document.querySelector(".notice--wrapper")!.classList.add("is-active"); - setTimeout(() => { - document.querySelector(".notice--wrapper")!.remove(); - }, 3000); } } +new farallonActions({ + singleSelector: ".post--single", + articleSelector: ".post--item", + likeButtonSelctor: ".like-btn", + actionDomain: window.actionDomain, +}); + new farallonBase(); +new farallonDate({ + selector: ".humane--time", + timeFormat: window.timeFormat, +}); +new farallonComment(); + +new Douban({ + baseAPI: window.dbAPIBase, + container: ".db--container", +}); diff --git a/themes/farallon/assets/ts/comment.ts b/themes/farallon/assets/ts/comment.ts index d87b9b7..99e3240 100644 --- a/themes/farallon/assets/ts/comment.ts +++ b/themes/farallon/assets/ts/comment.ts @@ -1,5 +1,4 @@ -//@ts-nocheck -class farallonComment { +export class farallonComment { loading: boolean = false; post_id: any; total: any = 0; @@ -8,15 +7,16 @@ class farallonComment { constructor() { if (!document.querySelector(".post--ingle__comments")) return; - this.post_id = document.querySelector( - ".post--ingle__comments" - )!.dataset.id; + this.post_id = ( + document.querySelector(".post--ingle__comments") as HTMLElement + ).dataset.id; this.fetchComments(); this.init(); } fetchComments() { fetch( + // @ts-ignore window.commentDomain + "/post/" + this.post_id + @@ -58,9 +58,11 @@ class farallonComment { @@ -93,8 +95,9 @@ class farallonComment { @@ -158,8 +161,9 @@ class farallonComment { (value, key: any) => (formDataObj[key] = value) ); this.loading = true; - // @ts-ignore fetch( + // @ts-ignore + window.commentDomain + "/post/" + this.post_id + @@ -205,20 +209,23 @@ class farallonComment { `; // @ts-ignore - const parent_id = + const parent_id = ( document.querySelector( "#comment_parent" - )?.value; + ) as HTMLInputElement + )?.value; // @ts-ignore (a.style.display = "none"), // @ts-ignore (a.onclick = null), // @ts-ignore - (document.getElementById( - "comment_parent" + (( + document.getElementById( + "comment_parent" + ) as HTMLInputElement ).value = "0"), n && // @ts-ignore i && // @ts-ignore - (n.parentNode.insertBefore(i, n), - n.parentNode.removeChild(n)); + n.parentNode && + n.parentNode.removeChild(n); if (document.querySelector(".comment-body__fresh")) document .querySelector(".comment-body__fresh") @@ -264,5 +271,3 @@ class farallonComment { } } } - -new farallonComment(); diff --git a/themes/farallon/assets/ts/date.ts b/themes/farallon/assets/ts/date.ts new file mode 100644 index 0000000..1190076 --- /dev/null +++ b/themes/farallon/assets/ts/date.ts @@ -0,0 +1,88 @@ +class farallonDate { + readonly selector: string; + timeFormat: any = { + second: "second ago", + seconds: "seconds ago", + minute: "minute ago", + minutes: "minutes ago", + hour: "hour ago", + hours: "hours ago", + day: "day ago", + days: "days ago", + week: "week ago", + weeks: "weeks ago", + month: "month ago", + months: "months ago", + year: "year ago", + years: "years ago", + }; + doms: Array = []; + constructor(config: any) { + this.selector = config.selector; + if (config.timeFormat) { + this.timeFormat = config.timeFormat; + } + this.init(); + setTimeout(() => { + this.refresh(); + }, 1000 * 5); + } + + init() { + this.doms = Array.from(document.querySelectorAll(this.selector)); + this.doms.forEach((dom: any) => { + dom.innerText = this.humanize_time_ago( + dom.attributes["datetime"].value + ); + }); + } + + humanize_time_ago(datetime: string) { + const time = new Date(datetime); + const between: number = + Date.now() / 1000 - Number(time.getTime() / 1000); + if (between < 3600) { + return `${Math.ceil(between / 60)} ${ + Math.ceil(between / 60) == 1 + ? this.timeFormat.second + : this.timeFormat.seconds + }`; + } else if (between < 86400) { + return `${Math.ceil(between / 3600)} ${ + Math.ceil(between / 3660) == 1 + ? this.timeFormat.hour + : this.timeFormat.hours + }`; + } else if (between < 86400 * 30) { + return `${Math.ceil(between / 86400)} ${ + Math.ceil(between / 86400) == 1 + ? this.timeFormat.day + : this.timeFormat.days + }`; + } else if (between < 86400 * 30 * 12) { + return `${Math.ceil(between / (86400 * 30))} ${ + Math.ceil(between / (86400 * 30)) == 1 + ? this.timeFormat.month + : this.timeFormat.months + }`; + } else { + return ( + time.getFullYear() + + "-" + + (time.getMonth() + 1) + + "-" + + time.getDate() + ); + } + } + + refresh() { + this.doms.forEach((dom: any) => { + dom.innerText = this.humanize_time_ago( + dom.attributes["datetime"].value + ); + }); + } +} + +export default farallonDate; diff --git a/themes/farallon/assets/ts/db.ts b/themes/farallon/assets/ts/db.ts index eb7ee97..96022c2 100644 --- a/themes/farallon/assets/ts/db.ts +++ b/themes/farallon/assets/ts/db.ts @@ -1,109 +1,140 @@ -class FARALLON_DOUBAN { - ver: string; +interface StatusObject { + name: string; + value: string; +} + +interface DoubanConfig { + baseAPI: string; + container: string; + types?: Array; + onChange?: (value: string) => void; +} + +interface DoubanObject { + subject_id: string; + name: string; + card_subtitle: string; + create_time: any; + douban_score: string; + link: string; + type: string; + poster: string; + pubdate: string; + year: string; + status: string; +} + +class Douban { + readonly ver: string; type: any; finished: boolean; paged: number; - genre_list: Array; - subjects: Array; - genre: Array; - baseAPI: string = "https://node.wpista.com/v1/outer/"; - token: string; - - constructor(config: any) { - this.ver = "1.0.1"; + genre_list: Array; + subjects: Array; + status: string; + baseAPI: string; + types: Array; + container: string; + constructor(config: DoubanConfig) { + this.container = config.container; + this.types = config.types ?? [ + "movie", + "book", + "music", + "game", + "drama", + ]; + this.baseAPI = config.baseAPI; + this.ver = "1.0.6"; this.type = "movie"; + this.status = "done"; this.finished = false; this.paged = 1; - this.genre_list = []; - this.genre = []; + this.genre_list = [ + { + name: "已看", + value: "done", + }, + { + name: "在看", + value: "doing", + }, + { + name: "想看", + value: "mark", + }, + ]; this.subjects = []; - this.token = config.token; this._create(); } - on(t: any, e: any, n: any) { - var a = document.querySelectorAll(e); - a.forEach((item) => { - item.addEventListener(t, n); + on(event: string, element: string, callback: any) { + const nodeList: NodeList = document.querySelectorAll(element); + nodeList.forEach((item) => { + item.addEventListener(event, callback); }); } - _fetchGenres() { - document.querySelector(".db--genres")!.innerHTML = ""; - fetch( - this.baseAPI + "genres?token=" + this.token + "&type=" + this.type - ) - .then((response) => response.json()) - .then((t) => { - // @ts-ignore - if (t.data.length) { - this.genre_list = t.data; - this._renderGenre(); - } - }); - } - - _handleGenreClick() { - this.on("click", ".db--genreItem", (t: any) => { + _handleGenreClick(): void { + this.on("click", ".db--genreItem", (t: MouseEvent) => { const self = t.currentTarget as HTMLElement; if (self.classList.contains("is-active")) { - const index = this.genre.indexOf(self.innerText); - self.classList.remove("is-active"); - this.genre.splice(index, 1); - this.paged = 1; - this.finished = false; - this.subjects = []; - this._fetchData(); return; } document.querySelector(".db--list")!.innerHTML = ""; document.querySelector(".lds-ripple")!.classList.remove("u-hide"); - self.classList.add("is-active"); - this.genre.push(self.innerText); + this.status = self.dataset.status || ""; // Provide a default value of an empty string if self.dataset.status is undefined + this._renderGenre(); this.paged = 1; this.finished = false; this.subjects = []; this._fetchData(); - return; }); } - _renderGenre() { + _reanderTypes(): void { + document.querySelector(".db--nav")!.innerHTML = this.types + .map((item: string) => { + return `${item}`; + }) + .join(""); + this._handleNavClick(); + } + + _renderGenre(): void { document.querySelector(".db--genres")!.innerHTML = this.genre_list - .map((item: any) => { + .map((item: StatusObject) => { return `${item.name}`; + this.status == item.value ? " is-active" : "" + }" data-status="${item.value}">${item.name}`; }) .join(""); this._handleGenreClick(); } - _fetchData() { - fetch( - this.baseAPI + - "faves?token=" + - this.token + - "&type=" + - this.type + - "&paged=" + - this.paged + - "&genre=" + - JSON.stringify(this.genre) - ) + _fetchData(): void { + const params: URLSearchParams = new URLSearchParams({ + paged: this.paged.toString(), + type: this.type, + status: this.status, + }); + fetch(this.baseAPI + "list?" + params.toString()) .then((response) => response.json()) .then((t: any) => { - if (t.data.length) { + console.log(t.results); + if (t.results.length) { if ( document .querySelector(".db--list")! .classList.contains("db--list__card") ) { - this.subjects = [...this.subjects, ...t.data]; + this.subjects = [...this.subjects, ...t.results]; this._randerDateTemplate(); } else { - this.subjects = [...this.subjects, ...t.data]; + this.subjects = [...this.subjects, ...t.results]; this._randerListTemplate(); } document @@ -118,7 +149,7 @@ class FARALLON_DOUBAN { }); } - _randerDateTemplate() { + _randerDateTemplate(): void { const result = this.subjects.reduce((result, item) => { const date = new Date(item.create_time); const year = date.getFullYear(); @@ -135,14 +166,12 @@ class FARALLON_DOUBAN { let html = ``; for (let key in result) { const date = key.split("-"); - html += `
${date[1]}
${date[0]}
`; + html += `
${date[1]}
${date[0]}
`; html += result[key] .map((movie: any) => { - return `
${ - movie.is_top250 - ? 'Top 250' - : "" - }
${ movie.douban_score > 0 @@ -161,22 +190,20 @@ class FARALLON_DOUBAN { document.querySelector(".db--list")!.innerHTML = html; } - _randerListTemplate() { + _randerListTemplate(): void { document.querySelector(".db--list")!.innerHTML = this.subjects - .map((item: any) => { - return `
${ - item.is_top250 ? 'Top 250' : "" - }
${ item.create_time }
${ - item.douban_score > 0 + item.douban_score ? '' + item.douban_score : "" }${ - item.year > 0 ? " · " + item.year : "" + item.year ? " · " + item.year : "" }
@@ -186,7 +213,7 @@ class FARALLON_DOUBAN { .join(""); } - _handleScroll() { + _handleScroll(): void { window.addEventListener("scroll", () => { var t = window.scrollY || window.pageYOffset; const moreElement = document.querySelector( @@ -208,25 +235,18 @@ class FARALLON_DOUBAN { }); } - _handleNavClick() { - this.on("click", ".db--navItem", (t: any) => { - if (t.currentTarget.classList.contains("current")) return; - this.genre = []; - this.type = t.currentTarget.dataset.type; - if (this.type != "book") { - this._fetchGenres(); - document - .querySelector(".db--genres") - ?.classList.remove("u-hide"); - } else { - document.querySelector(".db--genres")!.classList.add("u-hide"); - } + _handleNavClick(): void { + this.on("click", ".db--navItem", (t: MouseEvent) => { + const self = t.currentTarget as HTMLElement; + if (self.classList.contains("current")) return; + this.status = "done"; + this.type = self.dataset.type; + this._renderGenre(); document.querySelector(".db--list")!.innerHTML = ""; document.querySelector(".lds-ripple")!.classList.remove("u-hide"); document .querySelector(".db--navItem.current")! .classList.remove("current"); - const self = t.target; self.classList.add("current"); this.paged = 1; this.finished = false; @@ -235,35 +255,26 @@ class FARALLON_DOUBAN { }); } - _create() { + _create(): void { if (document.querySelector(".db--container")) { const container = document.querySelector( - ".db--container" + this.container ) as HTMLElement; - if (container.dataset.token) { - this.token = container.dataset.token; - } else { - return; - } - const currentNavItem = document.querySelector( - ".db--navItem.current" - ); - if (currentNavItem instanceof HTMLElement) { - this.type = currentNavItem.dataset.type; - } - const currentType = document.querySelector( - ".db--list" - ) as HTMLElement; - if (currentType.dataset.type) this.type = currentType.dataset.type; - if (this.type == "movie") { - document - .querySelector(".db--genres")! - .classList.remove("u-hide"); - } - this._fetchGenres(); + if (!container) return; + container.innerHTML = ` +
+
+
+
+
+
+
+
`; + this._renderGenre(); + this._reanderTypes(); this._fetchData(); this._handleScroll(); - this._handleNavClick(); } if (document.querySelector(".js-db")) { @@ -272,10 +283,7 @@ class FARALLON_DOUBAN { const id = db.dataset.id; const type = db.dataset.type; const nodeParent = db.parentNode as HTMLElement; - fetch( - // @ts-ignore - this.baseAPI + `${type}/${id}?token=${this.token}` - ).then((response) => { + fetch(this.baseAPI + `${type}/${id}`).then((response) => { response.json().then((t) => { if (t.data) { const data = t.data; @@ -305,14 +313,13 @@ class FARALLON_DOUBAN { } } - _fetchCollection(item: any) { + _fetchCollection(item: any): void { const type = item.dataset.style ? item.dataset.style : "card"; fetch( - // @ts-ignore - obvInit.api + - "v1/movies?type=" + + this.baseAPI + + "/list?type=" + item.dataset.type + - "&paged=1&genre=&start_time=" + + "&paged=1&start_time=" + item.dataset.start + "&end_time=" + item.dataset.end @@ -322,39 +329,30 @@ class FARALLON_DOUBAN { if (t.length) { if (type == "card") { item.innerHTML += t - .map((movie: any) => { + .map((movie: DoubanObject) => { return `
-
Marked ${ - movie.create_time - }
-
${ - movie.douban_score - }
${ - movie.remark || movie.card_subtitle - }
`; +
Marked ${movie.create_time}
+
${movie.douban_score}
${movie.card_subtitle}
`; }) .join(""); } else { - const result = t.reduce((result: any, item: any) => { - if ( - Object.prototype.hasOwnProperty.call( - result, - item.create_time - ) - ) { - result[item.create_time].push(item); - } else { - result[item.create_time] = [item]; - } - return result; - }, {}); + const result = t.reduce( + (result: any, item: DoubanObject) => { + if ( + Object.prototype.hasOwnProperty.call( + result, + item.create_time + ) + ) { + result[item.create_time].push(item); + } else { + result[item.create_time] = [item]; + } + return result; + }, + {} + ); let html = ``; for (let key in result) { html += `
${key}
`; @@ -387,7 +385,4 @@ class FARALLON_DOUBAN { } } -new FARALLON_DOUBAN({ - // @ts-ignore - token: window.WPD_TOKEN, -}); +export default Douban; diff --git a/themes/farallon/assets/ts/utils.ts b/themes/farallon/assets/ts/utils.ts new file mode 100644 index 0000000..40a6251 --- /dev/null +++ b/themes/farallon/assets/ts/utils.ts @@ -0,0 +1,39 @@ +interface Helper { + getCookie(key: string): string; + setCookie(key: string, value: string, n: number): void; + showNotice(message: string, type: any): void; +} + +export abstract class farallonHelper implements Helper { + getCookie(key: string) { + if (0 < document.cookie.length) { + var e = document.cookie.indexOf(key + "="); + if (-1 != e) { + e = e + key.length + 1; + var n = document.cookie.indexOf(";", e); + return ( + -1 == n && (n = document.cookie.length), + document.cookie.substring(e, n) + ); + } + } + return ""; + } + + setCookie(key: string, value: string, n: number) { + var o = new Date(); + o.setTime(o.getTime() + 24 * n * 60 * 60 * 1e3); + var i = "expires=" + o.toUTCString(); + document.cookie = key + "=" + value + ";" + i + ";path=/"; + } + + showNotice(message: string, type: any = "success") { + const html = `
${message}
`; + + document.querySelector("body")!.insertAdjacentHTML("beforeend", html); + document.querySelector(".notice--wrapper")!.classList.add("is-active"); + setTimeout(() => { + document.querySelector(".notice--wrapper")!.remove(); + }, 3000); + } +} diff --git a/themes/farallon/go.mod b/themes/farallon/go.mod deleted file mode 100644 index 0d4eab9..0000000 --- a/themes/farallon/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/bigfa/hugo-theme-farallon - -go 1.22.2 diff --git a/themes/farallon/layouts/_default/_markup/render-link.html b/themes/farallon/layouts/_default/_markup/render-link.html index 9b27ecd..4ee5d31 100644 --- a/themes/farallon/layouts/_default/_markup/render-link.html +++ b/themes/farallon/layouts/_default/_markup/render-link.html @@ -4,10 +4,9 @@ {{ $url :=index ($urls) 0 }} {{ $dbtype := replaceRE $regex "$1" $url }} {{ $dbid := replaceRE $regex "$2" $url }} -{{ $dbFetch := getJSON "https://node.wpista.com/v1/outer/" $dbtype "/" $dbid -"?token=2bfb9a8d037a7352c9d369b85d33ac83e39a" }} +{{ $dbFetch := getJSON "https://dbapi.wpista.com/" $dbtype "/" $dbid }} {{ if $dbFetch }} -{{ $subject := $dbFetch.data }} +{{ $subject := $dbFetch }} {{ $number := (float $subject.douban_score) }}
diff --git a/themes/farallon/layouts/_default/list.html b/themes/farallon/layouts/_default/list.html index 0eab881..083cffe 100644 --- a/themes/farallon/layouts/_default/list.html +++ b/themes/farallon/layouts/_default/list.html @@ -1,12 +1,12 @@ {{ define "main" }}
{{ range .Pages.ByPublishDate.Reverse.GroupByDate "2006" }} - {{ if (where .Pages "Section" "story") }} + {{ if (where .Pages "Section" "post") }}

{{ .Key }}

{{ range .Pages.ByPublishDate.Reverse.GroupByDate "January" }}

{{ .Key }}

    - {{ range ((where .Pages "Section" "story")) }} + {{ range ((where .Pages "Section" "post")) }}
  • diff --git a/themes/farallon/layouts/_default/single.html b/themes/farallon/layouts/_default/single.html index 5b94e61..5e440ac 100644 --- a/themes/farallon/layouts/_default/single.html +++ b/themes/farallon/layouts/_default/single.html @@ -1,6 +1,7 @@ {{ define "main" }}
    -
    +
    {{ .LinkTitle }} {{ end }} {{ end }} + {{ if .Site.Params.post_view }} + + + + + + {{ end }}

    {{ .Title }}

    {{ if .IsTranslated }} @@ -48,6 +58,23 @@
    {{ .Content }}
    + {{ if .Site.Params.post_like }} +
    + +
    + {{ end }}
    {{ range (.GetTerms "tags") }} {{ .LinkTitle }} @@ -73,26 +100,7 @@ {{ if .Params.story_id }} {{ partial "commentlist.html" . }} {{ end }} - -
    -

    评论

    -
      -
    -
    - - -
    + {{ partial "twikoo.html" . }}
    - - -
    - - -
    {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} {{ $paginator := .Paginate ($pages) }} @@ -409,7 +14,7 @@ function createDay(date, title, count, post) { {{ end }} {{ end }}
    - {{ $paginator := .Paginate (where .Pages "Type" "posts") }} + {{ $paginator := .Paginate (where .Pages "Type" "story") }} {{partial "pagination.html" .}} {{ end }} \ No newline at end of file diff --git a/themes/farallon/layouts/page/about.html b/themes/farallon/layouts/page/about.html new file mode 100644 index 0000000..47551ce --- /dev/null +++ b/themes/farallon/layouts/page/about.html @@ -0,0 +1,23 @@ +{{ define "main" }} + +
    +

    {{.Title}}

    + {{ if .IsTranslated }} +
    +

    {{ i18n "translations" }}

    + +
    + {{ end }} +
    + {{ .Content }} +
    +
    + +{{ end }} \ No newline at end of file diff --git a/themes/farallon/layouts/page/gears.html b/themes/farallon/layouts/page/gears.html new file mode 100644 index 0000000..4b5e689 --- /dev/null +++ b/themes/farallon/layouts/page/gears.html @@ -0,0 +1,24 @@ +{{ define "main" }} + +
    +

    {{.Title}}

    +

    {{ .Params.subtitle }}

    +
    + {{ range .Params.faves }} +
    +
    + +
    +
    +
    {{ .brand }} · {{ .cat }}
    + {{ .title }} +
    +
    + {{ end }} +
    +
    + {{ .Content }} +
    +
    + +{{ end }} \ No newline at end of file diff --git a/themes/farallon/layouts/page/links.html b/themes/farallon/layouts/page/links.html new file mode 100644 index 0000000..12cd496 --- /dev/null +++ b/themes/farallon/layouts/page/links.html @@ -0,0 +1,22 @@ +{{ define "main" }} + +
    +

    {{.Title}}

    +

    {{ .Params.subtitle }}

    +
    + +
    +
    + {{ .Content }} +
    +
    + +{{ end }} \ No newline at end of file diff --git a/themes/farallon/layouts/page/movies.html b/themes/farallon/layouts/page/movies.html new file mode 100644 index 0000000..7ed5d4a --- /dev/null +++ b/themes/farallon/layouts/page/movies.html @@ -0,0 +1,8 @@ +{{ define "main" }} + +
    +
    +
    +
    + +{{ end }} \ No newline at end of file diff --git a/themes/farallon/layouts/page/search.html b/themes/farallon/layouts/page/search.html new file mode 100644 index 0000000..df74b5a --- /dev/null +++ b/themes/farallon/layouts/page/search.html @@ -0,0 +1,79 @@ +{{ define "main" }} + +
    + +
    + +
    + + + +{{ end }} \ No newline at end of file diff --git a/themes/farallon/layouts/partials/footer.html b/themes/farallon/layouts/partials/footer.html index d6f33c4..493f57d 100644 --- a/themes/farallon/layouts/partials/footer.html +++ b/themes/farallon/layouts/partials/footer.html @@ -21,12 +21,6 @@
-
@@ -53,13 +47,13 @@ {{- $opts := dict "minify" hugo.IsProduction -}} {{- $replay := resources.Get "js/comment.min.js" | js.Build $opts -}} -{{- $db := resources.Get "ts/db.ts" | js.Build $opts -}} {{- $app := resources.Get "ts/app.ts" | js.Build $opts -}} -{{- $comment := resources.Get "ts/comment.ts" | js.Build $opts -}} -{{ $ts := slice $replay $db $app $comment | resources.Concat "ts/bundle.js" }} +{{ $ts := slice $replay $app | resources.Concat "ts/bundle.js" }} {{ range .Site.Params.customJS }} {{ if ( or ( hasPrefix . "http://" ) ( hasPrefix . "https://" ) ) }} diff --git a/themes/farallon/layouts/partials/head.html b/themes/farallon/layouts/partials/head.html index 1fa4281..eb3d539 100644 --- a/themes/farallon/layouts/partials/head.html +++ b/themes/farallon/layouts/partials/head.html @@ -17,11 +17,10 @@ {{ end }} {{ $favicon := resources.Get "images/favicon.png" }} - + {{ if .OutputFormats.Get "RSS" }} {{ with .OutputFormats.Get "RSS" }} {{ end }} -{{ end }} - \ No newline at end of file +{{ end }} \ No newline at end of file diff --git a/themes/farallon/layouts/partials/memo.html b/themes/farallon/layouts/partials/memo.html index 92bf3e9..714af0a 100644 --- a/themes/farallon/layouts/partials/memo.html +++ b/themes/farallon/layouts/partials/memo.html @@ -1,8 +1,7 @@
{{ if .Content }} diff --git a/themes/farallon/layouts/partials/twikoo.html b/themes/farallon/layouts/partials/twikoo.html new file mode 100644 index 0000000..3dc227b --- /dev/null +++ b/themes/farallon/layouts/partials/twikoo.html @@ -0,0 +1,9 @@ + +
+ + \ No newline at end of file