Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
berumuron
Boop
Commits
0bfe74ae
Commit
0bfe74ae
authored
Oct 28, 2018
by
berumuron
Browse files
Provide a first basic version of Boop!
parent
7dd7f2f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
0bfe74ae
# Boop! — a static site generator, for fun
# Boop! – a simple "low-tech" static site generator, for fun.
## Usage
In this section, we assume you are using Linux.
Create your website in a
`./content`
folder and execute the Boop! command:
```
console
$
mkdir
content
$
echo
'<h1>Welcome!</h1>'
>
content/index.html
$
./boop.py
Boop!
```
Now, you should have your "production-ready" website under a
`./output`
folder.
For example, if your website consists in a single
`index.html`
page, you should
obtain the following structure:
```
console
$
tree
.
├── content
│ └── index.html
├── output
│ └── index.html
└── boop.py
```
Yeah, it's kinda too simple for the moment (it only copies the files from
`./content`
to
`./output`
), but new features are coming soon!
boop.py
0 → 100755
View file @
0bfe74ae
#!/bin/env python3
import
os
import
shutil
def
main
():
# Make sure output dir doesn't exist (shutil will create it later)
output_path
=
os
.
path
.
join
(
os
.
curdir
,
"output"
)
if
os
.
path
.
isdir
(
output_path
):
shutil
.
rmtree
(
output_path
)
# And copy the files from ./content to ./output
input_path
=
os
.
path
.
join
(
os
.
curdir
,
"content"
)
if
os
.
path
.
isdir
(
input_path
):
shutil
.
copytree
(
input_path
,
output_path
)
if
__name__
==
"__main__"
:
main
()
print
(
"Boop!"
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment