Skip to content

Commit

Permalink
chore: copy files from Ourairyu's source code
Browse files Browse the repository at this point in the history
  • Loading branch information
ourai committed Mar 22, 2023
1 parent 98b8d56 commit ae671b5
Show file tree
Hide file tree
Showing 22 changed files with 384 additions and 15 deletions.
37 changes: 37 additions & 0 deletions src/jekyll/_assets/javascripts/pages/index.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
$(document).on "click", ".Nav-cell a", ->
$el = $(@)
cls = "is-active"

$(".Navs .#{cls}, .Grids .#{cls}").removeClass cls

$(".Grids [data-flag='#{$el.attr "data-flag"}']")
.add $el
.addClass cls

return false

$(document).ready ->
$(".Navs [data-flag]:first").click()

$(".Repo, .Site").each ->
$(@).attr("target", "_blank") if @hostname isnt location.hostname

$cnt = $('.Moments')

$('.js-affix').each ->
$(@)
.on
"affixed-top.bs.affix": ->
$(@).css
position: 'static'
width: 'auto'
"affixed.bs.affix": ->
$(@).css
position: "fixed"
width: $(@).parent().width()
.affix
offset:
top: $(@).offset().top
bottom: ->
return $(document).height() - ($cnt.offset().top + $cnt.outerHeight(true))

Empty file.
55 changes: 55 additions & 0 deletions src/jekyll/_assets/stylesheets/components/_card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.Card {
position: relative;
overflow: hidden;
min-height: 150px;
background-color: #FFF;
@include border-radius(6px);
@include box-shadow(0 1px 2px 0 rgba(0, 0, 0, 0.22));

&-link,
&-thumbnail {
@include stretch;
}

&-link {
z-index: 3;
padding: 15px;
text-decoration: none !important;
font-size: 14px;
line-height: 1.2;

&,
&:hover {
color: #555;
}
}

&-thumbnail {
z-index: 2;
background: {
position: 50% 50%;
repeat: no-repeat;
size: cover;
}
opacity: .15;
border-radius: 6px;

img {
display: none;
}
}

&-name {
margin: 0;
font-size: 18px;
color: #333;
}

&-description {
margin: {
top: 10px;
bottom: 0;
}
line-height: 1.5;
}
}
77 changes: 77 additions & 0 deletions src/jekyll/_assets/stylesheets/components/_component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
.LightBox {
font-size: 14px;

ul,
li {
@include display-flex;
}

ul {
list-style-type: none;
margin-bottom: 0;
padding-left: 0;
@include align-items(stretch);
}

li {
@include flex-grow(1);
}

a,
h3,
p {
position: relative;
}

a {
display: block;
width: 100%;
text-decoration: none;
color: rgba(255, 255, 255, .8);
@include covered_background(none, #222);

&:after {
@include stretch;
z-index: 1;
content: $UN-space;
background-color: rgba(0, 0, 0, .2);
@include transition(background-color 0.2s ease);
}

&:hover:after {
background-color: rgba(0, 0, 0, .5);
}
}

h3,
p {
z-index: 2;
}

h3 {
margin: 0 0 10px;
font-size: 1.4em;
line-height: 1.25;
color: #fff;
}

p {
margin-bottom: 0 !important;
line-height: 1.5 !important;
}

@media all and (max-width: $screen-xs-max) {
ul {
@include flex-direction(column);
}

h3 {
margin-bottom: 0;
text-align: center;
}

p {
display: none;
}
}
}
40 changes: 35 additions & 5 deletions src/jekyll/_assets/stylesheets/components/_page.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
$headerHeight: 61px;
$headerHeight: 60px;
$headerBorderWidth: 1px;
$footerHeight: 180px;

html,
Expand All @@ -7,8 +8,8 @@ body {
}

.Page-header {
margin-bottom: -($headerHeight);
border-bottom: 1px solid #dedede;
margin-bottom: -($headerHeight + $headerBorderWidth);
border-bottom: $headerBorderWidth solid #dedede;
background-color: #F5F5F5;

.navbar {
Expand All @@ -21,8 +22,37 @@ body {
family: Georgia;
weight: bold;
}
color: inherit;
text-shadow: 1px 1px #fff;

&,
a {
color: inherit;
}

a {
&:hover,
&:focus {
text-decoration: none;
}

+ a {
position: relative;
margin-left: 1.4em;
font: {
family: Sans-serif;
weight: normal;
}

&:before {
content: $UN-space;
position: absolute;
top: 7px;
bottom: 7px;
left: -.7em;
border-left: 1px solid currentColor;
}
}
}
}

.navbar-toggle {
Expand Down Expand Up @@ -68,7 +98,7 @@ body {
}

&:before {
height: $headerHeight;
height: $headerHeight + $headerBorderWidth;
}

&:after {
Expand Down
3 changes: 3 additions & 0 deletions src/jekyll/_assets/stylesheets/components/_utilities.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.u-bold {
font-weight: bold !important;
}
1 change: 1 addition & 0 deletions src/jekyll/_assets/stylesheets/disqusjs.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/jekyll/_assets/stylesheets/global.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
@import "./helper";

@import "bootstrap-sprockets";
@import "./bootstrap-custom";
@import "bootstrap-custom";

@import "font-awesome-sprockets";
@import "font-awesome";

@import "./reset";

@import "./components/utilities";
@import "./components/component";
@import "./components/widget";
@import "./components/page";
@import "./components/article";
Expand Down
13 changes: 10 additions & 3 deletions src/jekyll/_includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
<footer class="Page-footer Footer">
<div class="{% if site.data.local.repos[page.repo] %}container-fluid{% else %}container{% endif %}">
{% assign site_url = site.baseurl | prepend: site.url %}
{% assign utm_params = "utm_source=ourai.github.io/lime&utm_medium=common-footer" %}
<div class="Footer-description">
<!-- Important links -->
<nav class="Footer-navs">
<ul>
<li><a href="https://oss.ourai.ws/?utm_source=ourai.github.io/lime&utm_medium=common-footer" title="访问「Ourai Open Source」" target="_blank" rel="external "><span>OOSS</span></a></li>
<li><a href="https://oss.ourai.ws/?{{ utm_params }}" title="访问「Ourai Open Source」" target="_blank" rel="external "><span>OOSS</span></a></li>
<li><a href="{{ '/about/' | prepend: site_url }}"><span>关于</span></a></li>
<li><a href="https://ourai.ws/sponsor/?{{ utm_params }}" target="_blank" rel="external "><span>赞助</span></a></li>
</ul>
</nav>
<!-- Copyright -->
<div class="Footer-copyright">
<p>&copy; 2015-{{ site.time | date: "%Y" }} <a href="https://ourai.ws/?utm_source=ourai.github.io/lime&utm_medium=common-footer" target="_blank">欧雷流</a> 版权所有</p>
<p><a href="https://linxoid.com/ourai/?utm_source=ourai.github.io/lime&utm_medium=common-footer" target="_blank" rel="external ">欧雷</a> 用 ♥ 设计与开发</p>
<p>&copy; 2015-{{ site.time | date: "%Y" }} <a href="https://ourai.ws/?{{ utm_params }}" target="_blank">欧雷流</a> 版权所有</p>
<p><a href="https://linxoid.com/ourai/?{{ utm_params }}" target="_blank" rel="external ">欧雷</a> 用 ♥ 设计与开发</p>
</div>
<div class="Footer-licenses">
<p>本站通过 <a href="https://knosysio.github.io/?{{ utm_params }}" target="_blank" rel="external ">KnoSys</a> 借助 <a href="http:https://jekyllrb.com" target="_blank" rel="external ">Jekyll</a> 生成</p>
</div>
</div>
</div>
Expand Down
6 changes: 2 additions & 4 deletions src/jekyll/_includes/head.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<meta charset="UTF-8">
<!-- SEO -->
{% include metadata/seo.html %}
<!-- 页面渲染兼容性 -->
{% include metadata/render.html %}
<!-- 站点 icon -->
<link rel="icon" href="{{ 'favicon.ico' | asset_path }}">
{% include metadata/feed.html %}
{% include metadata/brand.html %}
2 changes: 2 additions & 0 deletions src/jekyll/_includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
<nav class="Page-navs navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="{{ '/guides/' | prepend: site_url }}">指南</a></li>
<li><a href="{{ '/posts/' | prepend: site_url }}">博客</a></li>
<li class="dropdown">
<a class="dropdown-toggle" href="{{ '/about/' | prepend: site_url }}" data-toggle="dropdown">关于 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="{{ '/about/' | prepend: site_url }}">本站</a></li>
<li><a href="https://linxoid.com/ourai/?utm_source=ourai.github.io/lime&utm_medium=common-header" target="_blank" rel="external ">作者</a></li>
<li><a href="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/ourai/lime" target="_blank" rel="external ">GitHub</a></li>
</ul>
Expand Down
2 changes: 2 additions & 0 deletions src/jekyll/_includes/metadata/brand.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<meta name="theme-color" content="#0871ab">
<link rel="icon" href="{{ 'favicon.ico' | asset_path }}">
6 changes: 6 additions & 0 deletions src/jekyll/_includes/metadata/feed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% assign feed_config = site.site-modules.social.feed %}
{% if feed_config %}
<!-- 订阅 -->
{% if feed_config.atom %}{% feed_meta %}{% endif %}
{% if feed_config.rss %}<link type="application/rss+xml" rel="alternate" href="//{{ site.ourairyu.site.domain }}/rss.xml" title="{{ site.title }}">{% endif %}
{% endif %}
1 change: 1 addition & 0 deletions src/jekyll/_includes/metadata/render.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- 页面渲染兼容性 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
1 change: 1 addition & 0 deletions src/jekyll/_includes/metadata/seo.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- SEO -->
{% if site.url %}
{% assign seo_url = site.url | append: site.baseurl %}
{% endif %}
Expand Down
6 changes: 6 additions & 0 deletions src/jekyll/_includes/partials/anti-spider.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% assign admin = site.author %}
{% assign author = page.author %}
<!-- 爬虫抓取的文章中显示来源 -->
<blockquote class="sr-only">
<p>本文首发于<a href="{{ admin.uri }}">{{ site.title }}</a>,作者是<a href="{{ author.uri | default: admin.uri }}" title="访问{{ author.name | default: admin.name }}的网站">{{ author.name | default: admin.name }}</a>。由于会时不时对文章进行补充、修正或润色,为了保证你所看到的是最新版本,<strong>请阅读<a href="{{ page.url | prepend: site.ourairyu.site.url }}" title="阅读《{{ page.title }}》原文">原文</a></strong></p>
</blockquote>
5 changes: 5 additions & 0 deletions src/jekyll/_includes/partials/articles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<ul class="ArticleList">
{% for post in include.posts %}
<li class="ArticleList-item"><time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%F" }}</time><i class="fa fa-pencil"></i><a href="{{ post.url }}">{{ post.title }}</a>{% if post.album %}<i class="fa fa-camera"></i>{% endif %}{% if post.tags contains 'vlog' %}<i class="fa fa-video-camera"></i>{% endif %}</li>
{% endfor %}
</ul>
44 changes: 44 additions & 0 deletions src/jekyll/_includes/partials/disqus.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{% if site.module.comment == true %}
{% assign comment_config = site.site-modules.social.comment.disqus %}
{% if jekyll.environment == "production" %}
{% assign disqus_shortname = comment_config.shortname %}
{% else %}
{% assign disqus_shortname = "" %}
{% endif %}
<div id="disqus_thread"></div>
{% if comment_config.proxy %}
{% javascript disqusjs.min %}
<script>
var dsqjs = new DisqusJS({
shortname: '{{ disqus_shortname }}',
siteName: '{{ site.ourairyu.site.name }}',
identifier: '{{ page.url }}',
url: 'http:https://' + location.host + '{{ page.url }}',
title: '{{ page.title }}',
api: '{{ comment_config.api.endpoint }}',
apikey: '{{ comment_config.api.key }}',
admin: '{{ comment_config.username }}',
adminLabel: '鹳狸猿'
});
</script>
{% else %}
<script>
var disqus_config = function () {
this.page.url = "http:https://" + location.host + "{{ page.url }}";
this.page.identifier = "{{ page.url }}";
this.page.title = "{{ page.title }}";
};

(function() {
var d = document, s = d.createElement('script');

s.src = '//{{ disqus_shortname }}.disqus.com/embed.js';

s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="external ">comments powered by Disqus.</a></noscript>
<script id="dsq-count-scr" src="//{{ disqus_shortname }}.disqus.com/count.js" async></script>
{% endif %}
{% endif %}
Loading

0 comments on commit ae671b5

Please sign in to comment.