docs: rename article slug

This commit is contained in:
2021-02-13 22:17:45 +09:00
parent ac0d966308
commit 2afd947660
68 changed files with 18 additions and 32 deletions

View File

@@ -0,0 +1,2 @@
<!-- Umami Analytics -->
<script async defer data-website-id="<%- config.umami.id %>" src="https://<%- config.umami.host %>/umami.js"></script>

View File

@@ -0,0 +1,55 @@
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Icon -->
<link rel="shortcut icon" href="<%- url_for('images/favicon.ico') %>" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="<%- url_for('images/apple-touch-icon.png') %>"
/>
<link
rel="icon"
type="image/png"
href="<%- url_for('images/favicon-32x32.png') %>"
sizes="32x32"
/>
<link
rel="icon"
type="image/png"
href="<%- url_for('images/favicon-16x16.png') %>"
sizes="16x16"
/>
<link
rel="mask-icon"
href="<%- url_for('images/safari-pinned-tab.svg') %>"
color="#5bbad5"
/>
<!-- Metadata -->
<%
const pageUrl = `${config.url}/${page.canonical_path.replace('index.html', '')}`
const title = page.title || config.title
const description = strip_html(page.excerpt) || config.description
%>
<title><%- title %></title>
<link rel="canonical" href="<%- pageUrl %>">
<meta name="description" content="<%- description %>">
<meta property="og:title" content="<%- title %>">
<meta property="og:description" content="<%- description %>">
<meta property="og:url" content="<%- pageUrl %>">
<meta property="og:site_name" content="<%- config.title %>">
<meta property="og:locale" content="<%- config.language %>">
<meta property="twitter:title" content="<%- title %>">
<meta name="twitter:site" content="@<%- config.twitter.username %>">
<meta name="twitter:card" content="summary">
<!-- Styles -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"
/>
<%- css('css/index') %>
</head>

View File

@@ -0,0 +1,24 @@
<header class="header">
<a class="logo" href="<%- config.root %>"
><img src="<%- url_for('/images/logo.svg') %>" style="height: 50px"
/></a>
<nav>
<ul class="menu">
<li class="menu__item">
<a href="/me">Me</a>
</li>
<li class="menu__item">
<a href="https://github.com/<%- config.github.username %>">GitHub</a>
</li>
<li class="menu__item">
<a href="https://twitter.com/<%- config.twitter.username %>">Twitter</a>
</li>
<li class="menu__item">
<a href="/wallpaper">Wallpaper</a>
</li>
<li class="menu__item">
<a href="/pay">Pay</a>
</li>
</ul>
</nav>
</header>

View File

@@ -0,0 +1,29 @@
<% if (page.prev || page.next) { %>
<nav class="page-nav">
<% if (page.prev) { %>
<a class="page-prev" href="<%- url_for(page.prev_link) %>">
&lt;
<!-- <span>
<% if (page.prev.title) { %>
<%= page.prev.title %>
<% } else { %>
(no title)
<% } %>
</span> -->
</a>
<% } %>
<div class="page-number date"><%= page.current %> / <%= Math.ceil(site.posts.length / config.per_page) %></div>
<% if (page.next) { %>
<a class="page-next" href="<%- url_for(page.next_link) %>">
&gt;
<!-- <span>
<% if (page.next.title) { %>
<%= page.next.title %>
<% } else { %>
(no title)
<% } %>
</span> -->
</a>
<% } %>
</nav>
<% } %>

18
themes/uio/layout/archive.ejs Executable file
View File

@@ -0,0 +1,18 @@
<section class="archives">
<div class="archive-page-counter"><%- __('archive.counter', site.posts.length) %><%- __('archive.name') %></div>
<div class="archive">
<% var lastyear; %>
<% page.posts.each(function(post) { %>
<% var year = post.date.year() %>
<% if(lastyear !== year) { %>
<h2 class="archive-year date"><%= year %></h2>
<% lastyear = year %>
<% } %>
<div class="archive-item">
<a class="archive-title" href="<%- url_for(post.path) %>"><%= post.title %></a>
<span class="archive-time date"><%= post.date.format('MM-DD') %></span>
</div>
<% }) %>
</div>
</section>
<%- partial('_partial/paginator') %>

10
themes/uio/layout/category.ejs Executable file
View File

@@ -0,0 +1,10 @@
<section class="categories">
<h1><%= page.category %></h1>
<% page.posts.each(function(post){ %>
<article class="category-item">
<a class="category-title" href="<%- url_for(post.path) %>"><%= post.title %></a>
<span class="post-date date"><%= post.date.format('YYYY-MM-DD') %></span>
</article>
<% }) %>
</section>
<%- partial('_partial/paginator') %>

35
themes/uio/layout/index.ejs Executable file
View File

@@ -0,0 +1,35 @@
<section>
<% page.posts.each(function (post) { %>
<article class="article-list__item">
<h2 class="article-list__item__title">
<a href="<%- url_for(post.path) %>"><%= post.title %></a>
</h2>
<!-- <time class="article-list__item__pubdate" pubdate><%- date(post.date, "YYYY-MM-DD") %></time> -->
<% if (theme.menu.tags && post.tags && post.tags.length) { %>
<%- list_tags(post.tags, {
show_count: false,
class: 'article-tag',
style: 'span',
separator: ', '
}) %>
<% } %>
<% if (theme.menu.categories && post.categories && post.categories.length) { %>
<%- list_categories(post.categories, {
show_count: false,
class: 'article-tag',
style: 'span',
separator: ', '
}) %>
<% } %>
<article class="article-list__item__excerpt">
<%- strip_html(post.excerpt) %>
</article>
<a
class="article-list__item__button"
href="<%- url_for(post.path) %>"
><%- __('continue') %></a
>
</article>
<% }) %>
<%- partial('_partial/paginator') %>
</section>

10
themes/uio/layout/layout.ejs Executable file
View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<%- partial('_partial/head') %>
<body>
<%- partial('_partial/header') %>
<%- body %>
<%- partial('_partial/footer') %>
</body>
</html>

5
themes/uio/layout/page.ejs Executable file
View File

@@ -0,0 +1,5 @@
<section>
<article class="article">
<div class="article__content"><%- page.content %></div>
</article>
</section>

55
themes/uio/layout/post.ejs Executable file
View File

@@ -0,0 +1,55 @@
<section>
<article class="article">
<hgroup class="article__metadata">
<% if (page.date) { %>
<h3 class="article__pubdate">
<time pubdate><%- date(page.date, "YYYY-MM-DD") %></time>
</h3>
<% } %>
<h2 class="article__title"><%- page.title %></h2>
</hgroup>
<div class="article__content"><%- page.content %></div>
<!-- Social buttons -->
<script
defer
src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.8"
id="facebook-jssdk"
></script>
<script
defer
src="https://platform.twitter.com/widgets.js"
id="twitter-wjs"
></script>
<div id="fb-root"></div>
<div class="article__social">
<a
href="https://twitter.com/share"
class="twitter-share-button"
data-size="large"
>Tweet</a
>
<div
class="fb-like"
data-layout="button"
data-action="like"
data-size="large"
data-show-faces="false"
data-share="true"
></div>
</div>
</article>
</section>
<!-- Syntax Highlight -->
<link
rel="stylesheet"
href="https://unpkg.com/highlight.js@9.18.1/styles/night-owl.css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/go.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/scss.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/lua.min.js"></script>
<script>
hljs.initHighlightingOnLoad()
</script>

View File

@@ -0,0 +1,10 @@
<% const newUrl = full_url_for(page.target.path) %>
<h1>Page address was changed</h1>
<p>The new page address is <a href="<%= newUrl %>"><%= newUrl %></a></p>
<script type="text/javascript">
setTimeout(function () {
document.location.href = "<%= newUrl %>";
}, 5000);
</script>

10
themes/uio/layout/tag.ejs Executable file
View File

@@ -0,0 +1,10 @@
<section class="tags">
<h1><%= page.tag %></h1>
<% page.posts.each(function(post){ %>
<article class="tag-item">
<a class="tag-title" href="<%- url_for(post.path) %>"><%= post.title %></a>
<span class="post-date date"><%= post.date.format('YYYY-MM-DD') %></span>
</article>
<% }) %>
</section>
<%- partial('_partial/paginator') %>