-
Notifications
You must be signed in to change notification settings - Fork 363
Open
Description
Here I make an example of "links". You can see the final result in YoobinPage.
- Enter the theme folder.
- open /layout/index.ejs, insert:
<% if (site.data.links) { %>
<section id="links">
<span class="h1"><a href="<%- url_for(theme.links_url) %>"><%= __('index.links') %></a></span>
<ul class="link-list">
<% for(var obj in site.data.links){ %>
<li class="link-item">
<a href="<%= site.data.links[obj].url %>"><%= site.data.links[obj].name %></a>: <%- markdown(site.data.links[obj].desc) %>
</li>
<% } %>
</ul>
</section>
<% } %>
- open /source/css/_partial/index.styl, insert:
.link-list
padding: 0
list-style: none
.link-item
margin-bottom: 5px
p
display: inline
- open /languages/en.yml (or any language file you are using), insert this line in the index item:
links: Friend Links
- Return to the root, build new source/_dada/links.json, insert:
[
{
"name":"",
"url":"",
"desc":""
}
]
- If you want to add hyperlink to the title in the index page:
-
cd to root file, input command in the terminal:
hexo new page links -
open /cactus/_config.yml, insert:
links_url = /links/
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels