Skip to content

Commit

Permalink
index.htmlを新たに生成
Browse files Browse the repository at this point in the history
  • Loading branch information
EzoeRyou committed Nov 12, 2023
1 parent dde989a commit e618ea6
Show file tree
Hide file tree
Showing 7 changed files with 5,027 additions and 4,019 deletions.
60 changes: 60 additions & 0 deletions article/2023-11-12-new-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>
新しいindex.htmlのテスト
</title>


<link rel="stylesheet" type="text/css" href="../css/default.css" >

<style type="text/css">
</style>

<!-- highlight.js -->
<link rel="stylesheet" type="text/css" href="../css/github.css">
<script type="text/javascript" src="../js/highlight.pack.js"></script>
<script type="text/javascript">hljs.initHighlightingOnLoad();</script>

<!-- mathjax CDN -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-MML-AM_CHTML' async>
</script>


</head>

<body>

<header>
<h1><a href="https://ezoeryou.github.io/blog/">本の虫</a></h1>

<p>
著者:江添亮<br>GitHub pages: <a href="https://ezoeryou.github.io/blog/">https://ezoeryou.github.io/blog/</a><br>
Blogger: <a href="http://cpplover.blogspot.jp/">http://cpplover.blogspot.jp/</a><br>
メール: [email protected]<br>
Twitter: <a href="https://twitter.com/EzoeRyou">https://twitter.com/EzoeRyou</a><br>
GitHub: <a href="https://github.com/EzoeRyou">https://github.com/EzoeRyou</a>
</p>
</header>


<article>
<h1>
新しいindex.htmlのテスト
</h1>

<p>
古いindex.htmlが色々と限界だったので新しいindex.htmlを生成してみた。
</p>


</article>

<footer>
<p>
CC BY-SA 4.0: This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
</p>
</footer>
</body>
</html>
52 changes: 10 additions & 42 deletions bin/index
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,16 @@ title="$(sed '6q;d' $1)"
filename="$1"
filename=${filename/draft/$(date -I)}

entry='<li>\n'$(date -I)': <a href='"$filename"'>'$title"</a>"'\n</li>'
mv "$1" "$filename"

cur_year="$(date +%Y)"
cur_month="$(date +%m)"
file_year="$(sed '41q;d' index.html)"
file_month="$(sed '47q;d' index.html)"
cat index-top.html > index.html
for file in $(ls article | grep -v '^draft-' | sort -r)
do
echo '<li><a href="article/'$file'">'${file:0:10}': '$(sed '6q;d' article/$file)'</a></li>' >> index.html
done
cat index-bottom.html >> index.html

if [ $cur_year != $file_year ]
then
sed -i '38a\
<li>\
<p>\n'\
"$cur_year"'\
</p>\
\
<ul>\
<li>\
<p>\n'\
"$cur_month"'\
</p>\
\
<ul>\
</ul>\
</ul>\
</li>\n' index.html
fi

if [ $cur_month != $file_month ]
then
sed -i '44a\
<li>\
<p>\n'\
"$cur_month"'\
</p>\
\
<ul>\
</ul>\
</li>\n' index.html
fi

sed -i '50a'"$entry" index.html
mv "$1" "$filename"
git add "$filename"
git commit -am "$title"
echo "$title" "https://ezoeryou.github.io/blog/$filename" | xsel -b
# git add "$filename"
# git commit -am "$title"
# echo "$title" "https://ezoeryou.github.io/blog/$filename" | xsel -b
64 changes: 64 additions & 0 deletions bin/old-index.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash

if [ -z "$1" ]
then
echo "no argument"
exit 1
fi

if [ ! -f "$1" ]
then
echo "No such file: " $1
exit 1
fi

title="$(sed '6q;d' $1)"

filename="$1"
filename=${filename/draft/$(date -I)}

entry='<li>\n'$(date -I)': <a href='"$filename"'>'$title"</a>"'\n</li>'

cur_year="$(date +%Y)"
cur_month="$(date +%m)"
file_year="$(sed '30q;d' index.html)"
file_month="$(sed '36q;d' index.html)"

if [ $cur_year != $file_year ]
then
sed -i '38a\
<li>\
<p>\n'\
"$cur_year"'\
</p>\
\
<ul>\
<li>\
<p>\n'\
"$cur_month"'\
</p>\
\
<ul>\
</ul>\
</ul>\
</li>\n' index.html
fi

if [ $cur_month != $file_month ]
then
sed -i '44a\
<li>\
<p>\n'\
"$cur_month"'\
</p>\
\
<ul>\
</ul>\
</li>\n' index.html
fi

sed -i '50a'"$entry" index.html
mv "$1" "$filename"
git add "$filename"
git commit -am "$title"
echo "$title" "https://ezoeryou.github.io/blog/$filename" | xsel -b
14 changes: 14 additions & 0 deletions index-bottom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

</ul>

<footer>
<p>
Unless otherwise noted,<br>
<br>
Copyright (C) 2014 江添亮<br>
<br>
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
</p>
</footer>
</body>
</html>
27 changes: 27 additions & 0 deletions index-top.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!doctype html>
<html>
<head><meta charset="UTF-8">
<title>
本の虫@GitHub
</title>

<link rel="stylesheet" type="text/css" href="css/default.css"></link>

</head>

<body>

<header>
<h1><a href="https://ezoeryou.github.io/blog/">本の虫</a></h1>

<p>
著者:江添亮<br>
Blogger: <a href="https://cpplover.blogspot.jp/">https://cpplover.blogspot.jp/</a><br>
メール: [email protected]<br>
Twitter: <a href="https://twitter.com/EzoeRyou">https://twitter.com/EzoeRyou</a><br>
GitHub: <a href="https://github.com/EzoeRyou">https://github.com/EzoeRyou</a>
</p>
</header>

<ul>

Loading

0 comments on commit e618ea6

Please sign in to comment.