-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (64 loc) · 2.41 KB
/
mkdocs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: MkDocs
on:
push:
branches:
- master
paths:
- mkdocs.yml
- bloglist
- docs/**
- custom_dir/**
- overrides/**
- .github/workflows/**
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Update BlogList
run: |
cat << "EOF" > docs/blogs.md
---
title: ブログ目次
description: ブログ目次
---
<h1>ブログ目次</h1>
<h2>ブログ一覧</h2>
EOF
cat bloglist | tac | tr '\n' ' ' > bloglist-fixed
for filename in $(cat bloglist-fixed)
do
echo '<hr style="border-top: 2px dashed #bbb;">' >> docs/blogs.md
echo $filename
url=$(echo ${filename} | sed "s/docs\///g" | sed "s/.md//g")
url="https://linuxcodevserver.github.io/${url}"
echo "url :$url"
title=$(cat $filename | grep "title: " | sed "s/title:\ //g")
echo "title: $title"
echo '<a href="'$url'"><h2>'"${title}"'</h2></a>' >> docs/blogs.md
categories=$(cat $filename | grep "categories: " | sed -e "s/categories:\ //g")
author=$(cat $filename | grep "author: " | sed "s/author:\ //g")
echo "categories: $categories"
echo "author: $author"
description=$(cat $filename | grep "description: " | sed "s/description:\ //g")
echo "<span><b>Categories: ${categories}</b></span>" >> docs/blogs.md
echo "<span>Author: ${author}</span>"
echo '<p style="width: 70%, height: 70%; color: gray;">'"${description}"'</p>' >> docs/blogs.md
echo '<p style="width: 70%, height: 70%, color: black:">'"Written by: $author"'</p>' >> docs/blogs.md
echo "description: $description"
done
echo '<hr style="border-top: 2px dashed #bbb;">' >> docs/blogs.md
rm bloglist-fixed
- name: Configure Git
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
git fetch origin gh-pages
- name: Install MkDocs
run: |
python3 -m pip install setuptools
python3 -m pip install -r requirements.txt
- name: Deploy HTML files
run: python3 -m mkdocs gh-deploy