ppoffice / hexo-theme-icarus

A simple, delicate, and modern theme for the static site generator Hexo.
https://ppoffice.github.io/hexo-theme-icarus/
MIT License
6.34k stars 1.54k forks source link

How to add read more in blog? #295

Closed Logan1x closed 6 years ago

Logan1x commented 6 years ago

Please make sure these boxes are checked before submitting your issue. Thank you!

请在发布新Issue之前确保你已经进行了如下工作,谢谢!

How did you added read more in your blog preview , i am not able to find an option regarding this, can you help me out? img_20171210_203035

Logan1x commented 6 years ago

@ppoffice can you help out? My blog post is loading whole at once on the homepage and i don't want that. Thanks

ppoffice commented 6 years ago

@Logan1x https://github.com/ppoffice/hexo-theme-icarus/issues?utf8=%E2%9C%93&q=Read+more

orcmid commented 6 years ago

The link by ppoffice provides a list of issues related to "Read More."

You can specify the read-more point yourself by specifying the break point in Markdown. See http://orcmid.com/BlunderDome/wingnut/2017/12/01/Excerpt/

You can also specify that you want excerpts all of the time beyond a specified length. I suggest you find a template that does this by default, and see what the additions are. For example, here is the _config.yml that is used by Morgan: https://github.com/hpcslag/hexo-theme-morgan/commit/53a151622b401b4cd7051c127e7e54af092c46bb#diff-be77e11471b8ed7c056fcfd6e338e4a9

Try adding excerpt_length to your Icaras _config.yml. It might take more to trigger the button. Experiment.

Google Translate: ppoffice的链接提供了与“阅读更多”相关的问题列表。

您可以通过在Markdown中指定断点来指定多读点。 见http://orcmid.com/BlunderDome/wingnut/2017/12/01/Excerpt/

您也可以指定您想要摘录超过指定长度的所有时间。 我建议你找到一个默认情况下这样做的模板,看看增加了什么。 例如,这里是Morgan使用的_config.yml:https://github.com/hpcslag/hexo-theme-morgan/commit/53a151622b401b4cd7051c127e7e54af092c46bb#diff-be77e11471b8ed7c056fcfd6e338e4a9

尝试添加excerpt_length到你的Icaras _config.yml。 可能需要更多才能触发按钮。 实验。

Logan1x commented 6 years ago

Do I have to make changes in the index.ejs too? @orcmid

Try adding excerpt_length to your Icaras _config.yml.

Logan1x commented 6 years ago

Icarus theme's index.ejs looks like this

<% page.posts.each(function(post) { %>
    <%- partial('common/article', { post: post, index: true }) %>
<% });
if (page.total > 1) { %>
    <nav id="page-nav">
        <%- paginator({
            prev_text: '&laquo; ' + __('nav.prev'),
            next_text: __('nav.next') + ' &raquo;'
        }) %>
    </nav>
<% } %>

where do i add this? var content = post.excerpt;

orcmid commented 6 years ago

I can't help you with that. I seldom do excerpts myself, except manually. (The advantage is that you can specify exactly where the break should go.)

It may be that Icarus does not provide for automatic excerpts. Look into the layout _partials for common/article. The page.total condition is about the use of pages. Not the right place to add this. Someone who knows Icarus better may be more helpful.

Google Translate 我帮不了你。 除了手工,我很少做自己的摘录。 (好处是你可以确切地指定中断的位置。) 这可能是伊卡洛斯不提供自动摘录。 看看公共/文章的布局_partials。 page.total条件是关于页面的使用。 不是正确的地方添加这个。 有人更了解伊卡洛斯可能会更有帮助。

Logan1x commented 6 years ago

@ppoffice @orcmid how do I add image above my post title like this?

image

orcmid commented 6 years ago

Try the gallery feature. See http://orcmid.com/BlunderDome/wingnut/2017/12/04/Gallery/

It is supposed to work with all hexo-compliant themes. It may depend on fancybox being enabled.

I do not know if there is anything different for Icarus. See if you can find the source of the demonstration Icarus blog and see what the Markdown is.

Logan1x commented 6 years ago

The gallery feature is working perfectly for images but still, I am not able to take out the image above the post title. Hope @ppoffice reply soon.

ppoffice commented 6 years ago

@Logan1x https://github.com/ppoffice/hexo-theme-icarus/wiki/Theme#thumbnail

orcmid commented 6 years ago

Instead of "gallery" in front matter, use "banner: URL" See https://github.com/ppoffice/hexo-theme-icarus/wiki/Theme#thumbnail and use banner: instead of thumbnail:

You will need to place the banner in your source so it is uploaded to a web-accessible location, such as an images/ or gallery/ folder or assets/ folder.

If you look at the generated source code of the Icarus demonstration, the image you refer to is produced in the main section <div> article-inner as immediate <img> "article-banner". The demonstration image is in /hexo-theme-icarus/gallery/salt-lake.jpg

Find other theme properties that may be involved in uploading image collections that can be referenced from the blog. It may already be part of your configuration.

Logan1x commented 6 years ago

Thank you @orcmid and @ppoffice for help 😊

Logan1x commented 6 years ago

@orcmid need one more help from you for this issue #294 😅, @ppoffice said this

You may need to manually upgrade the font awesome files.

so how to upgrade font awesome files. I've tried with

<i class="fa fa-quora" aria-hidden="true"></i>

this but it doesn't work so where i what i've to add?

Logan1x commented 6 years ago

Done thanks to @ppoffice 😊

wechslerTravel commented 6 years ago

Hi thank you. Do you know how to add into google search. Tested by adding "google_analytics:" or "google_site_verification:" but none works

Logan1x commented 6 years ago

So you want to add Google custom Search ?

On Sun, 1 Apr 2018, 10:23 pm wechslerTravel, notifications@github.com wrote:

Hi thank you. Do you know how to add into google search. Tested by adding "google_analytics:" or "google_site_verification:" but none works

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ppoffice/hexo-theme-icarus/issues/295#issuecomment-377800188, or mute the thread https://github.com/notifications/unsubscribe-auth/AKcAYrf4xLDKwFREayhwMhhrSbtI2ykJks5tkQYbgaJpZM4Q8hbf .

wechslerTravel commented 6 years ago

Hi sharma,

Thank you. I tried to add my website to google search but failed by either using "google_analytics:" or "google_site_verification". But fortunately, the other way works.

Is currently icarus only support insight/baidu/swiftsearch for search within website? Unfortunately I failed by using any of those search engine? Another question is why my webpage can not get access to the "category" and "about" (404 file not found). All other part like "home" "archives" et. al. work good.

Thank you

David

On Sun, Apr 1, 2018 at 10:54 PM, Khushal Sharma notifications@github.com wrote:

So you want to add Google custom Search ?

On Sun, 1 Apr 2018, 10:23 pm wechslerTravel, notifications@github.com wrote:

Hi thank you. Do you know how to add into google search. Tested by adding "google_analytics:" or "google_site_verification:" but none works

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ppoffice/hexo-theme-icarus/issues/295# issuecomment-377800188, or mute the thread https://github.com/notifications/unsubscribe-auth/ AKcAYrf4xLDKwFREayhwMhhrSbtI2ykJks5tkQYbgaJpZM4Q8hbf .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ppoffice/hexo-theme-icarus/issues/295#issuecomment-377861460, or mute the thread https://github.com/notifications/unsubscribe-auth/AfDdZAfqo_QsdNeoDzQBst73Aa_OZvzVks5tkb0wgaJpZM4Q8hbf .

-- Wei Wei, Graduate Student Department of Bioengineering University of Washington N410, William H. Foege Building 3720 15th Ave NE, Seattle, WA, 98195

Logan1x commented 6 years ago

Yes i think currently icurus only supports insight/baidu/swiftsearch for searching in website. You can ask more by creating issue in the repo:smile:

Logan1x commented 6 years ago

You have to make category in the post so that hexo can generate catagory page

Logan1x commented 6 years ago

And for about you can add link from config file.

heypigeon commented 5 years ago

I have suggestion to stop asking/answering the questions that are not included in the issue title, so that the thread is kept clean. The issue was about adding Read More button, not Google Search or icons.

CDT commented 2 years ago

add <!-- more --> in the content part of markdown files.