mirror of
https://github.com/MeiK2333/github-style.git
synced 2025-10-07 10:04:04 +00:00
Update posts
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
{{ define "content" }}
|
||||
{{ $data := .Data }}
|
||||
<div class="post-warp archive">
|
||||
<h2 class="post-title" style="text-align:right;padding-bottom:2em">- {{ $data.Plural | humanize }} · {{ .Title }} -</h2>
|
||||
{{ range (.Paginate .Pages).Pages }}
|
||||
<article class="archive-item">
|
||||
<a href="{{ .Permalink }}" class="archive-item-link hvr-underline-from-center">{{ .Title }}</a>
|
||||
<span class="archive-item-date">
|
||||
{{ .Date.Format "January 2, 2006" }}
|
||||
</span>
|
||||
</article>
|
||||
{{ end }}
|
||||
{{ partial "paginator.html" . }}
|
||||
<div class="application-main " data-commit-hovercards-enabled>
|
||||
<main id="js-pjax-container" data-pjax-container>
|
||||
<div class="container-xl clearfix px-3 mt-4">
|
||||
|
||||
{{ partial "user-profile.html" . }}
|
||||
|
||||
{{ partial "posts.html" .}}
|
||||
|
||||
</main>
|
||||
</div>
|
||||
{{end }}
|
@@ -1,7 +1,3 @@
|
||||
{{ define "content" }}
|
||||
{{ if eq .Site.Params.home_mode "post" }}
|
||||
{{ partial "post.html" . }}
|
||||
{{ else }}
|
||||
{{ partial "home.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
@@ -23,3 +23,5 @@
|
||||
<span class="f6 text-gray-light"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ partial "script.html" }}
|
@@ -1,86 +1,10 @@
|
||||
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
|
||||
{{ $section := where .Site.RegularPages "Section" "in" $mainSections }}
|
||||
{{ $section_count := len $section }}
|
||||
{{ $n_posts := $.Param "recent_posts_number" | default 6 }}
|
||||
<div class="application-main " data-commit-hovercards-enabled>
|
||||
<main id="js-pjax-container" data-pjax-container>
|
||||
<div class="container-xl clearfix px-3 mt-4">
|
||||
|
||||
{{ partial "user-profile.html" . }}
|
||||
|
||||
<div class="col-lg-9 col-md-8 col-12 float-md-left pl-md-2">
|
||||
|
||||
<div class="UnderlineNav width-full user-profile-nav js-sticky top-0">
|
||||
<nav class="UnderlineNav-body" data-pjax aria-label="User profile">
|
||||
<a aria-current="page" class="UnderlineNav-item mr-0 mr-md-1 mr-lg-3 selected "
|
||||
href="{{ .Site.BaseURL }}">
|
||||
Overview
|
||||
</a>
|
||||
<a class="UnderlineNav-item mr-0 mr-md-1 mr-lg-3 " href="{{ .Site.BaseURL }}/posts">
|
||||
Posts
|
||||
<span class="Counter hide-lg hide-md hide-sm">
|
||||
{{ $section_count}}
|
||||
</span>
|
||||
</a>
|
||||
<a class="UnderlineNav-item mr-0 mr-md-1 mr-lg-3 " href="{{ .Site.BaseURL }}/about">
|
||||
About
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="position-relative">
|
||||
<div class="mt-4">
|
||||
<div class="js-pinned-items-reorder-container">
|
||||
<h2 class="f4 mb-2 text-normal">
|
||||
Pinned
|
||||
</h2>
|
||||
|
||||
<ol
|
||||
class="d-flex flex-wrap list-style-none gutter-condensed mb-4 js-pinned-items-reorder-list">
|
||||
{{ range (first $n_posts $section) }}
|
||||
<li class="col-12 col-md-6 col-lg-6 mb-3 d-flex flex-content-stretch">
|
||||
<div name="pinned-post"
|
||||
class="Box pinned-item-list-item d-flex p-3 width-full js-pinned-item-list-item public source sortable-button-item">
|
||||
<div class="pinned-item-list-item-content">
|
||||
<div class="d-flex width-full flex-items-center position-relative">
|
||||
<svg class="octicon octicon-repo mr-2 text-gray flex-shrink-0"
|
||||
viewBox="0 0 12 16" version="1.1" width="12" height="16"
|
||||
aria-hidden="true">
|
||||
<path fill-rule="evenodd"
|
||||
d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z" />
|
||||
</svg>
|
||||
<a href="{{ .URL }}" class="text-bold flex-auto min-width-0 ">
|
||||
<span class="repo js-pinnable-item"
|
||||
title="{{ .Title }}">{{ .Title }}</span>
|
||||
</a>
|
||||
</div>
|
||||
{{ .Summary | safeHTML }}
|
||||
<div class="f6 text-gray mt-2">
|
||||
<span class="mr-3">
|
||||
<svg class="octicon octicon-law mr-1" viewBox="0 0 14 16"
|
||||
version="1.1" width="14" height="16" aria-hidden="true">
|
||||
<path fill-rule="evenodd"
|
||||
d="M7 4c-.83 0-1.5-.67-1.5-1.5S6.17 1 7 1s1.5.67 1.5 1.5S7.83 4 7 4zm7 6c0 1.11-.89 2-2 2h-1c-1.11 0-2-.89-2-2l2-4h-1c-.55 0-1-.45-1-1H8v8c.42 0 1 .45 1 1h1c.42 0 1 .45 1 1H3c0-.55.58-1 1-1h1c0-.55.58-1 1-1h.03L6 5H5c0 .55-.45 1-1 1H3l2 4c0 1.11-.89 2-2 2H2c-1.11 0-2-.89-2-2l2-4H1V5h3c0-.55.45-1 1-1h4c.55 0 1 .45 1 1h3v1h-1l2 4zM2.5 7L1 10h3L2.5 7zM13 10l-1.5-3-1.5 3h3z">
|
||||
</path>
|
||||
</svg>MIT License
|
||||
</span>
|
||||
|
||||
Updated <relative-time datetime="{{ .PublishDate.Format "2006-01-02" }}" class="no-wrap"
|
||||
title="Modify at {{ .Lastmod.Format "2006/01/02" }}">
|
||||
{{ .PublishDate.Format "January 2, 2006" }}</relative-time>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div id="pinned-items-modal-wrapper"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ partial "overview.html" .}}
|
||||
|
||||
</main>
|
||||
</div>
|
||||
|
||||
{{ partial "script.html" }}
|
70
layouts/partials/overview.html
Normal file
70
layouts/partials/overview.html
Normal file
@@ -0,0 +1,70 @@
|
||||
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
|
||||
{{ $section := where .Site.RegularPages "Section" "in" $mainSections }}
|
||||
{{ $section_count := len $section }}
|
||||
{{ $n_posts := $.Param "recent_posts_number" | default 6 }}
|
||||
<div class="col-lg-9 col-md-8 col-12 float-md-left pl-md-2">
|
||||
<div class="UnderlineNav width-full user-profile-nav js-sticky top-0">
|
||||
<nav class="UnderlineNav-body" data-pjax aria-label="User profile">
|
||||
<a aria-current="page" class="UnderlineNav-item mr-0 mr-md-1 mr-lg-3 selected " href="{{ .Site.BaseURL }}">
|
||||
Overview
|
||||
</a>
|
||||
<a class="UnderlineNav-item mr-0 mr-md-1 mr-lg-3 " href="{{ .Site.BaseURL }}/posts">
|
||||
Posts
|
||||
<span class="Counter hide-lg hide-md hide-sm">
|
||||
{{ $section_count}}
|
||||
</span>
|
||||
</a>
|
||||
<a class="UnderlineNav-item mr-0 mr-md-1 mr-lg-3 " href="{{ .Site.BaseURL }}/about">
|
||||
About
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="position-relative">
|
||||
<div class="mt-4">
|
||||
<div class="js-pinned-items-reorder-container">
|
||||
<h2 class="f4 mb-2 text-normal">
|
||||
Pinned
|
||||
</h2>
|
||||
|
||||
<ol class="d-flex flex-wrap list-style-none gutter-condensed mb-4 js-pinned-items-reorder-list">
|
||||
{{ range (first $n_posts $section) }}
|
||||
<li class="col-12 col-md-6 col-lg-6 mb-3 d-flex flex-content-stretch">
|
||||
<div
|
||||
class="Box pinned-item-list-item d-flex p-3 width-full js-pinned-item-list-item public source sortable-button-item">
|
||||
<div class="pinned-item-list-item-content" name="pinned-post">
|
||||
<div class="d-flex width-full flex-items-center position-relative">
|
||||
<svg class="octicon octicon-repo mr-2 text-gray flex-shrink-0" viewBox="0 0 12 16"
|
||||
version="1.1" width="12" height="16" aria-hidden="true">
|
||||
<path fill-rule="evenodd"
|
||||
d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z" />
|
||||
</svg>
|
||||
<a href="{{ .URL }}" class="text-bold flex-auto min-width-0 ">
|
||||
<span class="repo js-pinnable-item" title="{{ .Title }}">{{ .Title }}</span>
|
||||
</a>
|
||||
</div>
|
||||
{{ .Summary | safeHTML }}
|
||||
<div class="f6 text-gray mt-2">
|
||||
<span class="mr-3">
|
||||
<svg class="octicon octicon-law mr-1" viewBox="0 0 14 16" version="1.1"
|
||||
width="14" height="16" aria-hidden="true">
|
||||
<path fill-rule="evenodd"
|
||||
d="M7 4c-.83 0-1.5-.67-1.5-1.5S6.17 1 7 1s1.5.67 1.5 1.5S7.83 4 7 4zm7 6c0 1.11-.89 2-2 2h-1c-1.11 0-2-.89-2-2l2-4h-1c-.55 0-1-.45-1-1H8v8c.42 0 1 .45 1 1h1c.42 0 1 .45 1 1H3c0-.55.58-1 1-1h1c0-.55.58-1 1-1h.03L6 5H5c0 .55-.45 1-1 1H3l2 4c0 1.11-.89 2-2 2H2c-1.11 0-2-.89-2-2l2-4H1V5h3c0-.55.45-1 1-1h4c.55 0 1 .45 1 1h3v1h-1l2 4zM2.5 7L1 10h3L2.5 7zM13 10l-1.5-3-1.5 3h3z">
|
||||
</path>
|
||||
</svg>MIT License
|
||||
</span>
|
||||
|
||||
Updated <relative-time datetime="{{ .PublishDate.Format "2006-01-02" }}"
|
||||
class="no-wrap" title="Modify at {{ .Lastmod.Format "2006/01/02" }}">
|
||||
{{ .PublishDate.Format "January 2, 2006" }}</relative-time>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div id="pinned-items-modal-wrapper"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,78 @@
|
||||
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
|
||||
{{ $section := where .Site.RegularPages "Section" "in" $mainSections }}
|
||||
{{ $section_count := len $section }}
|
||||
{{ $n_posts := $.Param "recent_posts_number" | default 6 }}
|
||||
<div class="col-lg-9 col-md-8 col-12 float-md-left pl-md-2">
|
||||
<div class="UnderlineNav width-full user-profile-nav top-0 is-placeholder"
|
||||
style="visibility: hidden; display: none; height: 56px;"></div>
|
||||
<div class="UnderlineNav width-full user-profile-nav js-sticky top-0"
|
||||
style="position: static; top: 0px; left: 330.5px; width: 911.5px;">
|
||||
<nav class="UnderlineNav-body" data-pjax aria-label="User profile">
|
||||
<a aria-current="page" class="UnderlineNav-item mr-0 mr-md-1 mr-lg-3 " href="{{ .Site.BaseURL }}">
|
||||
Overview
|
||||
</a>
|
||||
<a class="UnderlineNav-item mr-0 mr-md-1 mr-lg-3 selected" href="{{ .Site.BaseURL }}/posts">
|
||||
Posts
|
||||
<span class="Counter hide-lg hide-md hide-sm">
|
||||
{{ $section_count}}
|
||||
</span>
|
||||
</a>
|
||||
<a class="UnderlineNav-item mr-0 mr-md-1 mr-lg-3 " href="{{ .Site.BaseURL }}/about">
|
||||
About
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="position-relative">
|
||||
<div id="user-repositories-list">
|
||||
<ul data-filterable-for="your-repos-filter" data-filterable-type="substring">
|
||||
{{ range .Paginator.Pages }}
|
||||
<li class="col-12 d-flex width-full py-4 border-bottom public fork">
|
||||
<div class="col-10 col-lg-9 d-inline-block">
|
||||
<div class="d-inline-block mb-1">
|
||||
<h3>
|
||||
<a href="{{ .URL }}">{{ .Title }}</a>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div name="posts-post">
|
||||
{{ .Summary | safeHTML }}
|
||||
</div>
|
||||
|
||||
<div class="f6 text-gray mt-2">
|
||||
<span class="mr-3">
|
||||
<svg class="octicon octicon-law mr-1" viewBox="0 0 14 16" version="1.1" width="14"
|
||||
height="16" aria-hidden="true">
|
||||
<path fill-rule="evenodd"
|
||||
d="M7 4c-.83 0-1.5-.67-1.5-1.5S6.17 1 7 1s1.5.67 1.5 1.5S7.83 4 7 4zm7 6c0 1.11-.89 2-2 2h-1c-1.11 0-2-.89-2-2l2-4h-1c-.55 0-1-.45-1-1H8v8c.42 0 1 .45 1 1h1c.42 0 1 .45 1 1H3c0-.55.58-1 1-1h1c0-.55.58-1 1-1h.03L6 5H5c0 .55-.45 1-1 1H3l2 4c0 1.11-.89 2-2 2H2c-1.11 0-2-.89-2-2l2-4H1V5h3c0-.55.45-1 1-1h4c.55 0 1 .45 1 1h3v1h-1l2 4zM2.5 7L1 10h3L2.5 7zM13 10l-1.5-3-1.5 3h3z">
|
||||
</path>
|
||||
</svg>MIT License
|
||||
</span>
|
||||
Updated <relative-time datetime="{{ .PublishDate.Format "2006-01-02" }}" class="no-wrap"
|
||||
title="Modify at {{ .Lastmod.Format "2006/01/02" }}">
|
||||
{{ .PublishDate.Format "January 2, 2006" }}</relative-time>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ if gt .Paginator.TotalPages 1}}
|
||||
<div class="paginate-container">
|
||||
<div class="BtnGroup" data-test-selector="pagination">
|
||||
{{ if .Paginator.HasPrev }}
|
||||
<a rel="nofollow" class="btn btn-outline BtnGroup-item"
|
||||
href="{{ .Paginator.Prev.URL }}">Previous</a>
|
||||
{{ else }}
|
||||
<button class="btn btn-outline BtnGroup-item" disabled="disabled">Previous</button>
|
||||
{{ end }}
|
||||
{{ if .Paginator.HasNext }}
|
||||
<a rel="nofollow" class="btn btn-outline BtnGroup-item" href="{{ .Paginator.Next.URL }}">Next</a>
|
||||
{{ else }}
|
||||
<button class="btn btn-outline BtnGroup-item" disabled="disabled">Next</button>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -6,11 +6,18 @@
|
||||
integrity="sha512-UjV5G8yJkGcA9OW3TPPQx+Rk3uyOfOVmYEWLj7ADv81bEy8Jp9oDULYFdQxOxJq518DFlt0+dBqobwvarLrNgA=="
|
||||
type="application/javascript" src="https://github.githubassets.com/assets/github-bootstrap-35e32afb.js"></script>
|
||||
<script>
|
||||
let classs = ['pinned-item-desc', 'text-gray', 'text-small', 'd-block', 'mt-2', 'mb-3'];
|
||||
const pinned_posts = document.getElementsByName('pinned-post');
|
||||
const classs = ['pinned-item-desc', 'text-gray', 'text-small', 'd-block', 'mt-2', 'mb-3'];
|
||||
for (let i = 0; i < pinned_posts.length; i++) {
|
||||
for (let j = 0; j < classs.length; j++) {
|
||||
pinned_posts[i].getElementsByTagName('p')[0].classList.add(classs[j]);
|
||||
}
|
||||
}
|
||||
classs = [/*'col-9', */'d-inline-block', 'text-gray', 'mb-2', 'pr-4'];
|
||||
const posts_posts = document.getElementsByName('posts-post');
|
||||
for (let i = 0; i < posts_posts.length; i++) {
|
||||
for (let j = 0; j < classs.length; j++) {
|
||||
posts_posts[i].getElementsByTagName('p')[0].classList.add(classs[j]);
|
||||
}
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user