moegi-design / ghost-theme-Moegi

An elegant & fresh ghost theme.
https://notes.ljl.li
164 stars 26 forks source link

我想在左侧显示脚注 #16

Closed oit63 closed 5 years ago

oit63 commented 5 years ago

我想左侧显示脚注,diu你看可以做吗?我觉得这样效果很好。更方便读者理解。

比如 https://blog.oyanglul.us/grokking-monad/part1 这样是放在右侧的。

ddiu8081 commented 5 years ago

似乎没发现 ghost 有官方的脚注支持... 不过是个很有意思的想法,如果难度不大的话我可以考虑实现一下~

oit63 commented 5 years ago

没有API是个遗憾,不知道具体看难度大不大呢~

oit63 commented 5 years ago

用上标注音和这种并排脚注来写注释真的是皮得不要不要的

oit63 commented 5 years ago

怎么样,Diu兄,有没有思路?

oit63 commented 5 years ago

我干脆就撸了欧阳兄的css,code injection先

ddiu8081 commented 5 years ago

@tenhow 行吧...有点没看懂这个是怎么定位的...

oit63 commented 5 years ago

我做了个injection,https://blog.no.mk/test

oit63 commented 5 years ago

原理就是紧挨着脚注引用的地方插个span,然后给这个span 定一个浮动样式

.sidenotel {
    float: left;
    clear: left;
    margin-left: -40%;
    width: 30%;
    position: relative;
}
oit63 commented 5 years ago

代码你可以看index里的或者 https://gist.github.com/tenhow/6d535033bccef7cce377949227316055 里面// 增加旁注 的部分

oit63 commented 5 years ago

diu兄,有没有可能给ghost 搞一个纯html文本(没有任何其他代码的那种,如导航菜单代码等), 我想给每个系列文章搞个动态导航, 我现在是写到github page里的,然后载入内容页后自动get回来。 我看了下ghost是用好像叫.ghs后缀的(具体我记不清了)再渲染出来的。

ddiu8081 commented 5 years ago

不太明白这个纯 HTML 的意思 系列文章导航的话,是这样子么? https://blog.ddiu.site/bjbus-api/ 这个是直接用 markdown 写列表的

oit63 commented 5 years ago

这种样式 https://github.no.mk/reactivecocoa

ddiu8081 commented 5 years ago

这种样式 https://github.no.mk/reactivecocoa

是要对这个目录写一个样式,让它好看点?

oit63 commented 5 years ago

我的思路是这样的,你看哈,

  1. 我想实现系列文章的动态导航(就是同一个系列的文章用一个导航内容) 如 reactivecocoa 系列 https://blog.no.mk/reactivecocoa

  2. 你看我用jquery加入的首和尾 下面的导航都是从 https://github.no.mk/reactivecocoa 拉回的(这样免去后端)

  3. 现在是用的github来编辑导航(利用的域名绑定github page) 要是可以用ghost的文章管理能写出一个只有li列表的页面比如 这样的url格式(https://blog.no.mk/reactivecocoa-nav),就更方便了

就不知道有没有可能,利用在ghost里面通过主题定义之类的手段实现这个想法

ddiu8081 commented 5 years ago

懂了,可以实现。 参考 https://blog.ddiu.site/prehtmltest/ 是只渲染纯内容部分。

方法和 page-archives.hbs 类似。 以 /prehtml 页面为例,具体方法在主题根目录建立 page-prehtml.hbs 文件,写入纯内容的部分:

{{#post}}
    {{content}}
{{/post}}

然后在后台建立 prehtml页面,输入内容即可。

参考官方文档 Page Context

oit63 commented 5 years ago

谢谢,从文档看到了这个 https://docs.ghost.org/api/handlebars-themes/structure/#custom-template-namehbs 好像说是可以搞一个可以在编辑的时候选择的模板

oit63 commented 5 years ago

顺藤摸瓜找了这个issue,有动图 https://github.com/TryGhost/Ghost/issues/9060

oit63 commented 5 years ago

懂了,可以实现。 参考 blog.ddiu.site/prehtmltest 是只渲染纯内容部分。

方法和 page-archives.hbs 类似。 以 /prehtml 页面为例,具体方法在主题根目录建立 page-prehtml.hbs 文件,写入纯内容的部分:

{{#post}} {{content}} {{/post}} 然后在后台建立 prehtml页面,输入内容即可。

参考官方文档 Page Context

我跟着你说的做了 在 /var/lib/ghost/content/themes/ghost-theme-moegi-master/ 里面创建了 page-prehtml.hbs 然后发布页没有变化呢 https://blog.no.mk/prehtmltest 也没有用

ddiu8081 commented 5 years ago

发布页 URL 就填prehtml ,保持和page-后面的一样

oit63 commented 5 years ago

懵蔽中,忽然想起是不是有缓存。然后把都docker 重启了,世界清净了。 纯html和template下拉菜单都出来了

oit63 commented 5 years ago

感谢Diu,已经实现了 https://blog.no.mk/reactivecocoa-nav/

oit63 commented 5 years ago

结合你的页面代码和template方式用,很方便了 2019-01-25 4 32 38

oit63 commented 5 years ago

问题暂时得到解决了,那我关了哈!