Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesisfroellerix committed Apr 28, 2023
0 parents commit 85b9c67
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build and Deploy Docs
on:
push:
branches:
- master
- main
permissions:
contents: write
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Install pandoc
run: sudo apt-get update && sudo apt-get install pandoc

- uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Install styling
run: npm install github-markdown-css

- name: Build 🔧
run: |
#!/bin/bash
mkdir dist
touch dist/.nojekyll
mv node_modules/github-markdown-css/github-markdown.css docs/github-markdown.css
cp docs/*.css dist/
if [ -d "docs/img/" ]; then
cp -r docs/img/ dist/img/
fi
for file in docs/*.md; do
name=$(basename "$file" .md)
pandoc "$file" -f markdown -t html -o "dist/$name.html"
done
for file in dist/*.html; do
name=$(basename "$file" .html)
content=$(cat "$file")
echo -e "<!DOCTYPE html>
<html lang=\"en\">
<head>
<meta charset=\"UTF-8\">
<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
<title>Docs</title>
$(for cssfile in dist/*.css; do
cssname=$(basename "$cssfile")
if [[ "$cssname" != "github-markdown.css" && "$cssname" != "style.css" ]]; then
echo "<link rel=\"stylesheet\" href=\"./$cssname\">"
fi
done)
<link rel=\"stylesheet\" href=\"./github-markdown.css\">
<link rel=\"stylesheet\" href=\"./style.css\">
</head>
<body class=\"markdown-body\">
${content}
</body>
</html>" > "dist/$name.html"
done
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
branch: docs
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
### Windows ###
# src: https://www.toptal.com/developers/gitignore/api/windows

# Windows thumbnail cache files
**/Thumbs.db
**/Thumbs.db:encryptable
**/ehthumbs.db
**/ehthumbs_vista.db

# Dump file
**/*.stackdump

# Folder config file
**/[Dd]esktop.ini

# Recycle Bin used on file shares
**/$RECYCLE.BIN/

# Windows Installer files
**/*.cab
**/*.msi
**/*.msix
**/*.msm
**/*.msp

# Windows shortcuts
**/*.lnk

### Linux ###
# src: https://www.toptal.com/developers/gitignore/api/linux
**/*~

# temporary files which can be created if a process still has a handle open of a deleted file
**/.fuse_hidden*

# KDE directory preferences
**/.directory

# Linux trash folder which might appear on any partition or disk
**/.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
**/.nfs*

### Dev ###
**/*.idea
**/*.vscode
**/*.code-workspace
**/*vendor
**/*node_modules
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# GH_Pages-AutoPublish

Publish Markdown-files automatically on push.
Images and .md files are automatically pushed to gh-pages.
Styling is applied by <https://github.com/sindresorhus/github-markdown-css>.
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Doc-Index

## DOC-01
12 changes: 12 additions & 0 deletions docs/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.markdown-body {
box-sizing: border-box !important;
min-width: 200px !important;
max-width: 980px !important;
padding: 45px !important;
}

@media (max-width: 767px) {
.markdown-body {
padding: 15px !important;
}
}

0 comments on commit 85b9c67

Please sign in to comment.