Compare commits
3 Commits
subgal_sec
...
master
Author | SHA1 | Date | |
---|---|---|---|
bf8f4a3f69 | |||
bfe35a1c5b | |||
dbaf4047b4 |
62
README.md
62
README.md
@ -1,53 +1,57 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="logo.png">
|
<img src="logo_shaded_alpha.png">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
# Prosopopee
|
# MagCMS
|
||||||
|
|
||||||
Prosopopee. Static site generator for your story.
|
MagCMS is static website and content generator for modern company websites.
|
||||||
|
|
||||||
Make beautiful customizable pictures galleries that tell a story using a static website generator written in Python. You don't need to care about css, code and presentation, manage your contents in YAML file and Prosopopee will take care about the rest.
|
Based on: Prosopopee. Static site generator for your story.
|
||||||
|
|
||||||
Prosopopee is sections oriented, make it very flexible, many kinds of section already available:
|
Make beautiful customizable company sites, landing pages or pictures galleries that tell a story using a static website generator written in Python. You don't need to care about css, code and presentation, manage your contents in YAML file and MagCMS will take care about the rest.
|
||||||
|
|
||||||
|
MagCMS is sections oriented, make it very flexible, many kinds of section already available:
|
||||||
|
|
||||||
* Parallax
|
* Parallax
|
||||||
* Group of pics (gallery)
|
* Group of pics (gallery)
|
||||||
* Paragraph
|
* Paragraph
|
||||||
* Iframe (Youtube, Maps, etc..)
|
* Iframe (Youtube, Maps, etc..)
|
||||||
* Quote
|
* Quote
|
||||||
* [And more](http://prosopopee.readthedocs.io/en/latest/sections.html)
|
* "subgal-section" which leads to subpages shown as a gallery
|
||||||
|
* And many more.
|
||||||
|
|
||||||
## Screenshots
|
# Documentation
|
||||||
|
|
||||||
<img src="https://github.com/Psycojoker/prosopopee/raw/master/pics/2018-04-30-113447_872x817_scrot.png" width="15%"></img> <img src="https://github.com/Psycojoker/prosopopee/raw/master/pics/2018-04-30-114059_1128x908_scrot.png" width="15%"></img> <img src="https://github.com/Psycojoker/prosopopee/raw/master/pics/2018-04-30-113707_1195x788_scrot.png" width="15%"></img> <img src="https://github.com/Psycojoker/prosopopee/raw/master/pics/2018-04-30-113821_1128x847_scrot.png" width="15%"></img>
|
Currentl no fancy documentation, but you can access the source code for the website of my company MagosIT Kft.
|
||||||
|
|
||||||
|
See: [magosit-website] (https://github.com/magosit-website)
|
||||||
|
|
||||||
|
You can also try browsing the original [prosopopee docs](http://prosopopee.readthedocs.io/en/latest/sections.html)
|
||||||
|
|
||||||
|
[More docs] (http://prosopopee.readthedocs.org/en/latest/)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
Prosopopee currently supports:
|
MagosCMS currently supports:
|
||||||
|
|
||||||
* Lightweight
|
* Lightweight and fast
|
||||||
|
* Hackable for your own needs
|
||||||
* Thumbnails & multiple resolutions for fast previews (JPEG progressive)
|
* Thumbnails & multiple resolutions for fast previews (JPEG progressive)
|
||||||
* Videos support
|
* Videos support
|
||||||
* Mobile friendly
|
* Mobile friendly
|
||||||
* Caching for fast rendering
|
* Caching for fast rendering
|
||||||
* Multi level gallery
|
* Multi level gallery
|
||||||
* Support themes (default, material, light)
|
* Support for themes (**only the default theme works for now**)
|
||||||
* Password access (encrypt page)
|
* Password access (encrypt page)
|
||||||
* Image lazy loading
|
* Image lazy loading
|
||||||
* Night Mode
|
* Night Mode
|
||||||
* Completely static output is easy to host anywhere
|
* Completely static output is easy to host anywhere
|
||||||
* Hackable
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
You can find example usages here:
|
Example website:
|
||||||
|
|
||||||
* http://surleschemins.fr
|
* [www.magosit.hu - under construction] (www.magosit.hu)
|
||||||
* http://media.faimaison.net/photos/galerie/
|
|
||||||
* https://www.thebrownianmovement.org/
|
|
||||||
* http://outside.browny.pink
|
|
||||||
* http://such.life
|
|
||||||
* http://www.street-art.me
|
|
||||||
|
|
||||||
## Code example
|
## Code example
|
||||||
|
|
||||||
@ -76,6 +80,11 @@ sections:
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
Currently its executable is still named prosopopee.
|
||||||
|
|
||||||
|
TODO: rename this!
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
prosopopee
|
prosopopee
|
||||||
prosopopee preview
|
prosopopee preview
|
||||||
@ -85,19 +94,10 @@ prosopopee (-h | --help)
|
|||||||
prosopopee.py --version
|
prosopopee.py --version
|
||||||
```
|
```
|
||||||
|
|
||||||
## Docker
|
|
||||||
|
|
||||||
https://hub.docker.com/r/beudbeud/prosopopee/
|
|
||||||
|
|
||||||
## Licence
|
## Licence
|
||||||
|
|
||||||
GLPv3
|
GLPv3 - just like the orginal prosopopee!
|
||||||
|
|
||||||
## Documentation
|
## Why a fork?
|
||||||
|
|
||||||
http://prosopopee.readthedocs.org/en/latest/
|
|
||||||
|
|
||||||
## IRC
|
|
||||||
|
|
||||||
channel : irc.freenode.net#prosopopee
|
|
||||||
|
|
||||||
|
I have actually asked the original creator of prosopopee if he would like my changes or if I should fork this off. His original project is much more aimed at photo gallery sites while mine is aimed at creating44
|
||||||
|
BIN
logo_shaded_alpha.png
Normal file
BIN
logo_shaded_alpha.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 81 KiB |
@ -296,7 +296,10 @@ def get_settings():
|
|||||||
"settings.yaml in the current working directory")
|
"settings.yaml in the current working directory")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
settings = yaml.safe_load(open("settings.yaml", "r"))
|
# Deprecated:
|
||||||
|
# settings = yaml.safe_load(open("settings.yaml", "r"))
|
||||||
|
yamli = yaml.YAML(typ='safe', pure=True)
|
||||||
|
settings = yamli.load(open("settings.yaml", "r"))
|
||||||
except yaml.YAMLError as exc:
|
except yaml.YAMLError as exc:
|
||||||
if hasattr(exc, 'problem_mark'):
|
if hasattr(exc, 'problem_mark'):
|
||||||
mark = exc.problem_mark
|
mark = exc.problem_mark
|
||||||
@ -352,7 +355,9 @@ def get_settings():
|
|||||||
def get_gallery_templates(theme, gallery_path="", parent_templates=None):
|
def get_gallery_templates(theme, gallery_path="", parent_templates=None):
|
||||||
theme_path = Path(__file__).parent.joinpath("themes", theme).exists()
|
theme_path = Path(__file__).parent.joinpath("themes", theme).exists()
|
||||||
|
|
||||||
available_themes = theme, "', '".join(Path(__file__).parent.joinpath("themes").listdir())
|
# available_themes = theme, "', '".join(Path(__file__).parent.joinpath("themes").listdir())
|
||||||
|
themesdir = "".join(Path(__file__).parent.joinpath("themes"))
|
||||||
|
available_themes = theme, "', '".join(os.listdir(themesdir))
|
||||||
|
|
||||||
error(theme_path, "'%s' is not an existing theme, available themes are '%s'" % available_themes)
|
error(theme_path, "'%s' is not an existing theme, available themes are '%s'" % available_themes)
|
||||||
|
|
||||||
@ -387,7 +392,10 @@ def process_directory(gallery_name, settings, parent_templates, parent_gallery_p
|
|||||||
gallery_path = gallery_name
|
gallery_path = gallery_name
|
||||||
|
|
||||||
try:
|
try:
|
||||||
gallery_settings = yaml.safe_load(open(Path(".").joinpath(gallery_path, "settings.yaml").abspath(), "r"))
|
# DEPRECATED:
|
||||||
|
# gallery_settings = yaml.safe_load(open(Path(".").joinpath(gallery_path, "settings.yaml").abspath(), "r"))
|
||||||
|
yamli = yaml.YAML(typ='safe', pure=True)
|
||||||
|
gallery_settings = yamli.load(open(os.path.abspath(Path(".").joinpath(gallery_path, "settings.yaml")), "r"))
|
||||||
except yaml.YAMLError as exc:
|
except yaml.YAMLError as exc:
|
||||||
if hasattr(exc, 'problem_mark'):
|
if hasattr(exc, 'problem_mark'):
|
||||||
mark = exc.problem_mark
|
mark = exc.problem_mark
|
||||||
@ -395,14 +403,14 @@ def process_directory(gallery_name, settings, parent_templates, parent_gallery_p
|
|||||||
else:
|
else:
|
||||||
error(False, "There are something wrong in %s/settings.yaml" % (gallery_path))
|
error(False, "There are something wrong in %s/settings.yaml" % (gallery_path))
|
||||||
|
|
||||||
error(isinstance(gallery_settings, dict), "Your %s should be a dict" % gallery_name.joinpath("settings.yaml"))
|
error(isinstance(gallery_settings, dict), "Your %s should be a dict" % os.path.join(gallery_name, "settings.yaml"))
|
||||||
error(gallery_settings.get("title"), "You should specify a title in %s" % gallery_name.joinpath("settings.yaml"))
|
error(gallery_settings.get("title"), "You should specify a title in %s" % os.path.join(gallery_name, "settings.yaml"))
|
||||||
|
|
||||||
gallery_cover = {}
|
gallery_cover = {}
|
||||||
|
|
||||||
sub_galleries = [x for x in Path(".").joinpath(gallery_path).listdir() if x.joinpath("settings.yaml").exists()]
|
sub_galleries = [x for x in os.listdir(os.path.join(Path("."), gallery_path)) if os.path.exists(os.path.join(x, "settings.yaml"))]
|
||||||
|
|
||||||
Path("build").joinpath(gallery_path).makedirs_p()
|
os.path.join(Path("build"), gallery_path).makedirs_p()
|
||||||
|
|
||||||
if not gallery_settings.get("public", True):
|
if not gallery_settings.get("public", True):
|
||||||
build_gallery(settings, gallery_settings, gallery_path, parent_templates)
|
build_gallery(settings, gallery_settings, gallery_path, parent_templates)
|
||||||
@ -414,7 +422,7 @@ def process_directory(gallery_name, settings, parent_templates, parent_gallery_p
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
error(gallery_settings.get("sections") is not False,
|
error(gallery_settings.get("sections") is not False,
|
||||||
"The gallery in %s can't have both sections and subgalleries" % gallery_name.joinpath("settings.yaml"))
|
"The gallery in %s can't have both sections and subgalleries" % os.path.join(gallery_name, "settings.yaml"))
|
||||||
|
|
||||||
# Sub galleries found, create index with them instead of a gallery
|
# Sub galleries found, create index with them instead of a gallery
|
||||||
theme = gallery_settings.get("theme", settings.get("theme", "exposure"))
|
theme = gallery_settings.get("theme", settings.get("theme", "exposure"))
|
||||||
@ -443,18 +451,18 @@ def process_directory(gallery_name, settings, parent_templates, parent_gallery_p
|
|||||||
|
|
||||||
def create_cover(gallery_name, gallery_settings, gallery_path):
|
def create_cover(gallery_name, gallery_settings, gallery_path):
|
||||||
error(gallery_settings.get("title"), "Your gallery describe in %s need to have a "
|
error(gallery_settings.get("title"), "Your gallery describe in %s need to have a "
|
||||||
"title" % gallery_name.joinpath("settings.yaml"))
|
"title" % os.path.join(gallery_name, "settings.yaml"))
|
||||||
|
|
||||||
error(gallery_settings.get("cover"), "You should specify a path to a cover picture "
|
error(gallery_settings.get("cover"), "You should specify a path to a cover picture "
|
||||||
"in %s" % gallery_name.joinpath("settings.yaml"))
|
"in %s" % os.path.join(gallery_name, "settings.yaml"))
|
||||||
|
|
||||||
if isinstance(gallery_settings["cover"], dict):
|
if isinstance(gallery_settings["cover"], dict):
|
||||||
cover_image_path = gallery_path.joinpath(gallery_settings["cover"]["name"])
|
cover_image_path = Path(gallery_path).joinpath(gallery_settings["cover"]["name"])
|
||||||
cover_image_url = gallery_name.joinpath(gallery_settings["cover"]["name"])
|
cover_image_url = Path(gallery_name).joinpath(gallery_settings["cover"]["name"])
|
||||||
cover_image_type = gallery_settings["cover"]["type"]
|
cover_image_type = gallery_settings["cover"]["type"]
|
||||||
else:
|
else:
|
||||||
cover_image_path = gallery_path.joinpath(gallery_settings["cover"])
|
cover_image_path = Path(gallery_path).joinpath(gallery_settings["cover"])
|
||||||
cover_image_url = gallery_name.joinpath(gallery_settings["cover"])
|
cover_image_url = Path(gallery_name).joinpath(gallery_settings["cover"])
|
||||||
cover_image_type = "image"
|
cover_image_type = "image"
|
||||||
|
|
||||||
error(cover_image_path.exists(), "File for %s cover image doesn't exist at "
|
error(cover_image_path.exists(), "File for %s cover image doesn't exist at "
|
||||||
@ -625,7 +633,7 @@ def main():
|
|||||||
|
|
||||||
front_page_galleries_cover = []
|
front_page_galleries_cover = []
|
||||||
|
|
||||||
galleries_dirs = [x for x in Path(".").listdir() if x.joinpath("settings.yaml").exists()]
|
galleries_dirs = [x for x in os.listdir(Path(".")) if os.path.isfile(os.path.join(x, "settings.yaml"))]
|
||||||
|
|
||||||
error(galleries_dirs, "I can't find at least one directory with a settings.yaml in the current working "
|
error(galleries_dirs, "I can't find at least one directory with a settings.yaml in the current working "
|
||||||
"directory (NOT the settings.yaml in your current directory, but one INSIDE A "
|
"directory (NOT the settings.yaml in your current directory, but one INSIDE A "
|
||||||
@ -638,8 +646,8 @@ def main():
|
|||||||
|
|
||||||
os.chdir('build')
|
os.chdir('build')
|
||||||
handler = http.server.SimpleHTTPRequestHandler
|
handler = http.server.SimpleHTTPRequestHandler
|
||||||
httpd = TCPServerV4(("", 9000), handler)
|
httpd = TCPServerV4(("", 8080), handler)
|
||||||
print('Start server on http://localhost:9000')
|
print('Start server on http://localhost:8080')
|
||||||
try:
|
try:
|
||||||
httpd.serve_forever()
|
httpd.serve_forever()
|
||||||
except (KeyboardInterrupt, SystemExit):
|
except (KeyboardInterrupt, SystemExit):
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
{% for gallery in galleries_line|reverse %}<!-- comment tricks against space between inline-block
|
{% for gallery in galleries_line|reverse %}<!-- comment tricks against space between inline-block
|
||||||
--><div class="gallery-square">
|
--><div class="gallery-square">
|
||||||
<div class="subgaldiv">
|
<div class="subgaldiv">
|
||||||
<a href="{{ gallery.link }}">
|
{# The ending '/' is really needed here for uWebsockets serving these! #}
|
||||||
|
<a href="{{ gallery.link }}/">
|
||||||
<div class="gallery-title">
|
<div class="gallery-title">
|
||||||
<h2>{{ gallery.title }}</h2>
|
<h2>{{ gallery.title }}</h2>
|
||||||
{% if gallery.sub_title %}<h3>{{ gallery.sub_title }}</h3>{% endif %}
|
{% if gallery.sub_title %}<h3>{{ gallery.sub_title }}</h3>{% endif %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user